File tree Expand file tree Collapse file tree 7 files changed +52
-26
lines changed
Expand file tree Collapse file tree 7 files changed +52
-26
lines changed Original file line number Diff line number Diff line change 11jiangmiemie :
22 name : Allen
3- title : software engineer
3+ title : normal software engineer
44 url : https://github.com/jiangyangcreate
5- image_url : https://jiangmiemie.com/img/logo-192.svg
5+ image_url : https://jiangmiemie.com/img/logo-192.svg
6+ socials :
7+ github : jiangyangcreate
Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ title: 卷积神经网络
1313
1414新的图像可以用更少的数据反应出图像的特征。这个过程就是特征提取。
1515
16-
17-
1816我们从一个6x6的矩阵开始:
1917
2018$$
257255 $$
258256 用途:均匀地平滑图像。
259257
260- ``` python
258+ ``` python showLineNumbers
261259import numpy as np
262260import matplotlib.pyplot as plt
263261from matplotlib.font_manager import FontProperties
Original file line number Diff line number Diff line change @@ -451,7 +451,10 @@ epochs = 5
451451for epoch in range (epochs):
452452 running_loss = 0.0
453453 for i, (images, labels) in enumerate (train_loader):
454- # 模型训练,把模型设置为训练模式,可有可无
454+ # 模型训练,把模型设置为训练模式
455+ # 激活BatchNorm层的参数更新机制,使用当前批次的均值和方差进行归一化,并更新运行时统计值
456+ # 激活Dropout层,随机丢弃一部分神经元,防止过拟合
457+ # 确保梯度计算和参数更新正常进行
455458 model.train()
456459 # 前向传播
457460 outputs = model(images)
@@ -483,7 +486,9 @@ PyTorch的自动微分引擎很智能(你也可以在模型中像构建前向
483486 with torch.no_grad():
484487 # 加载测试集
485488 for images, labels in test_loader:
486- # 测试模型,把模型设置为测试模式,此时可有可无
489+ # 测试模型,把模型设置为测试模式
490+ # BatchNorm层会使用运行时统计数据而不是批次统计数据
491+ # Dropout层会停止随机丢弃神经元
487492 model.eval()
488493 outputs = model(images)
489494 # 获取预测值
@@ -516,7 +521,16 @@ total = 0
516521# 关闭梯度计算
517522with torch.no_grad():
518523 for images, labels in test_loader:
519- # 测试模型,把模型设置为测试模式,此时可有可无
524+ # 测试模型,把模型设置为测试模式
525+ """
526+ 本代码不加model.train()和model.eval()原因有以下几点:
527+ 1. 模型中没有BatchNorm和Dropout等层,调用与否确实不会有区别
528+ 2. 创建模型后,PyTorch默认是训练模式,所以不调用model.train()也能正常训练,只有明确调用model.eval()后才会切换到评估模式
529+
530+ 更复杂的模型如ResNet、BERT等都包含这些层。
531+ 所以需要养成习惯始终在相应阶段调用model.train()和model.eval()
532+ 这样代码更规范,也能避免在模型变复杂后出现意外问题。
533+ """
520534 model.eval()
521535 outputs = model(images)
522536 _, predicted = torch.max(outputs.data, 1 )
Original file line number Diff line number Diff line change @@ -7,22 +7,24 @@ title: 模型社区与部署
77
88大模型社区是指围绕大型深度学习模型构建的开放协作平台和生态系统,除了模型还提供:数据集、教程、体验等功能。这些社区由研究人员、开发者、数据科学家、工程师及爱好者组成,他们共同致力于大模型的研究、开发、优化和应用。
99
10- 现在模型非常多,各有千秋,且更新迭代非常快。下面的表格列出了部分公司及其主要大模型代号:
11-
12- | ** 公司名称** | ** 大模型代号** |
13- | :---------------------------: | :----------------: |
14- | ** OpenAI** | GPT |
15- | ** Meta** | Llama |
16- | ** Anthropic(前 OpenAI 成员)** | Claude |
17- | ** X** | Grok |
18- | ** 谷歌** | Gemini |
19- | ** 微软** | Phi |
20- | ** 百度** | 文心大模型 (Ernie) |
21- | ** 阿里巴巴** | 通义千问 (Qwen) |
22- | ** 腾讯** | 混元 (Hunyuan) |
23- | ** 字节跳动** | 豆包(coze) |
24- | ** 华为** | 盘古大模型 (Pangu) |
25- | ** 智谱** | 智谱清言 (GLM) |
10+ 下面的表格列出了部分公司及其主要大模型代号,排名不分先后:
11+
12+ | ** 公司名称** | ** 大模型代号** |
13+ | :-----------: | :----------------: |
14+ | ** Anthropic** | Claude |
15+ | ** 阿里巴巴** | 通义千问 (Qwen) |
16+ | ** OpenAI** | GPT |
17+ | ** 谷歌** | Gemini |
18+ | ** 深度求索** | DeepSeek |
19+ | ** 月之暗面** | KIMI |
20+ | ** xAI** | Grok |
21+ | ** 智谱** | 智谱清言 (GLM) |
22+ | ** 微软** | Phi |
23+ | ** Meta** | Llama |
24+ | ** 字节跳动** | 豆包(coze) |
25+ | ** 百度** | 文心大模型 (Ernie) |
26+ | ** 腾讯** | 混元 (Hunyuan) |
27+ | ** 华为** | 盘古大模型 (Pangu) |
2628
2729社区具有明显的马太效应,即头部效应明显,头部模型拥有最多的资源,最新的技术,最多的用户。这里列举两个在国内外有一定影响力的社区。
2830
Original file line number Diff line number Diff line change @@ -14,6 +14,16 @@ Terminals
1414## 远程连接
1515
1616SSH 是 Linux 系统的登录工具,现在广泛用于服务器登录和各种加密通信。
17+ ::: info
18+
19+ Linux 内核衍生版本众多,譬如 ubuntu、debian、centos、fedora、archlinux 等。
20+
21+ 不同版本之间存在差异,譬如 ubuntu 大版本号之外,小版本号也很重要,此外有时候版本号和代号会混用,譬如 ros 2(一种机器人操作系统) 只能使用 Ubuntu 的 noble 即 Ubuntu 24.04。
22+
23+ 下面是最近 Ubuntu 的版本号和代号:
24+ - 24.10 的代号是 oracular
25+ - 24.04 代号是 noble
26+ :::
1727
1828假设本机的账户与密码默认都是 linaro
1929
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ module.exports = {
169169 } ,
170170 colorMode : {
171171 defaultMode : "light" , //定义首次访问的颜色
172- disableSwitch : true , //隐藏明暗切换按钮
172+ disableSwitch : false , //隐藏明暗切换按钮
173173 respectPrefersColorScheme : true , //跟随用户系统默认
174174 } ,
175175 //配置标准的明暗主题
Original file line number Diff line number Diff line change 11import Box from "@mui/material/Box" ;
2- import { PhotoAlbum } from "react-photo-album" ;
2+ import PhotoAlbum from "react-photo-album" ;
33import Layout from "@theme/Layout" ;
44import React , {
55 useState ,
You can’t perform that action at this time.
0 commit comments