当前位置: 首页 > news >正文

有哪些网站是封面型滑块验证wordpress

有哪些网站是封面型,滑块验证wordpress,可以观看国外短视频的app,察隅网站建设文章目录 1. 数学角度#xff1a; y W x b \displaystyle y W\,x b yWxb示例 2. 编程实现角度#xff1a; y x W T b \displaystyle y x\,W^T b yxWTb3. 常见错误与易混点解析4. 小结参考链接 在神经网络或机器学习的线性层#xff08;Linear Layer / Fully Connect… 文章目录 1. 数学角度 y W x b \displaystyle y W\,x b yWxb示例 2. 编程实现角度 y x W T b \displaystyle y x\,W^T b yxWTb3. 常见错误与易混点解析4. 小结参考链接 在神经网络或机器学习的线性层Linear Layer / Fully Connected Layer中经常会见到两种形式的公式 数学文献或传统线性代数写法 y W x b \displaystyle y W\,x b yWxb一些深度学习代码中写法 y x W T b \displaystyle y x\,W^T b yxWTb 初次接触时很多人会觉得两者“方向”不太一样不知该如何对照理解再加上矩阵维度 ( in_features , out_features ) (\text{in\_features},\, \text{out\_features}) (in_features,out_features) 和 ( out_features , in_features ) (\text{out\_features},\, \text{in\_features}) (out_features,in_features) 的各种写法常常让人疑惑不已。本文将从数学角度和编程实现角度剖析它们的关系并结合实际示例指出一些常见的坑与需要特别留意的下标对应问题。 1. 数学角度 y W x b \displaystyle y W\,x b yWxb 在线性代数中如果我们假设输入 x x x 是一个列向量通常会写作 x ∈ R ( in_features ) \displaystyle x\in\mathbb{R}^{(\text{in\_features})} x∈R(in_features)或者在更严格的矩阵形状记法下写作 ( in_features , 1 ) (\text{in\_features},\,1) (in_features,1)。那么一个最常见的全连接层可以表示为 y W x b , y W\,x b, yWxb, 其中 W W W 是一个大小为 ( out_features , in_features ) \bigl(\text{out\_features},\,\text{in\_features}\bigr) (out_features,in_features) 的矩阵 b b b 是一个 out_features \text{out\_features} out_features-维的偏置向量形状 ( out_features , 1 ) (\text{out\_features},\,1) (out_features,1) y y y 则是输出向量大小为 out_features \text{out\_features} out_features。 示例 假设 in_features 3 \text{in\_features}3 in_features3 out_features 2 \text{out\_features}2 out_features2。那么 W ∈ R 2 × 3 , x ∈ R 3 × 1 , b ∈ R 2 × 1 . W \in \mathbb{R}^{2\times 3},\quad x \in \mathbb{R}^{3\times 1},\quad b \in \mathbb{R}^{2\times 1}. W∈R2×3,x∈R3×1,b∈R2×1. 矩阵写开来就是 W [ w 11 w 12 w 13 w 21 w 22 w 23 ] , x [ x 1 x 2 x 3 ] , b [ b 1 b 2 ] . W \begin{bmatrix} w_{11} w_{12} w_{13} \\[5pt] w_{21} w_{22} w_{23} \end{bmatrix},\quad x \begin{bmatrix} x_{1}\\ x_{2}\\ x_{3} \end{bmatrix},\quad b \begin{bmatrix} b_{1}\\ b_{2} \end{bmatrix}. W[w11​w21​​w12​w22​​w13​w23​​],x ​x1​x2​x3​​ ​,b[b1​b2​​]. 那么线性变换结果 W x b Wx b Wxb 可以展开为 W x b [ w 11 x 1 w 12 x 2 w 13 x 3 w 21 x 1 w 22 x 2 w 23 x 3 ] [ b 1 b 2 ] [ w 11 x 1 w 12 x 2 w 13 x 3 b 1 w 21 x 1 w 22 x 2 w 23 x 3 b 2 ] . \begin{aligned} Wx b \begin{bmatrix} w_{11}x_1 w_{12}x_2 w_{13}x_3 \\ w_{21}x_1 w_{22}x_2 w_{23}x_3 \end{bmatrix} \begin{bmatrix} b_1 \\ b_2 \end{bmatrix} \\ \begin{bmatrix} w_{11}x_1 w_{12}x_2 w_{13}x_3 b_1 \\ w_{21}x_1 w_{22}x_2 w_{23}x_3 b_2 \end{bmatrix}. \end{aligned} Wxb​[w11​x1​w12​x2​w13​x3​w21​x1​w22​x2​w23​x3​​][b1​b2​​][w11​x1​w12​x2​w13​x3​b1​w21​x1​w22​x2​w23​x3​b2​​].​ 这就是最传统、在数学文献或线性代数课程中最常见的表示方法。 2. 编程实现角度 y x W T b \displaystyle y x\,W^T b yxWTb 在实际的深度学习代码例如 PyTorch、TensorFlow中经常看到的却是下面这种写法 y x W.T b注意这里 W.shape 通常被定义为 ( out_features , in_features ) (\text{out\_features},\, \text{in\_features}) (out_features,in_features)而 x.shape 在批量处理时则是 ( batch_size , in_features ) (\text{batch\_size},\, \text{in\_features}) (batch_size,in_features)。于是 (x W.T) 的结果是 ( batch_size , out_features ) (\text{batch\_size},\, \text{out\_features}) (batch_size,out_features)。 为什么会出现转置 因为在数学里我们通常把 x x x 当作“列向量”放在右边于是公式变成 y W x b y Wx b yWxb。 但在编程里尤其是处理批量输入时x 常写成“行向量”的形式 ( batch_size , in_features ) (\text{batch\_size},\, \text{in\_features}) (batch_size,in_features)这就造成了在进行矩阵乘法时需要将 W大小 ( out_features , in_features ) (\text{out\_features},\, \text{in\_features}) (out_features,in_features)转置成 ( in_features , out_features ) (\text{in\_features},\, \text{out\_features}) (in_features,out_features)才能满足「行×列」的匹配关系。 从结果上来看 ( batch_size , in_features ) × ( in_features , out_features ) ( batch_size , out_features ) . (\text{batch\_size}, \text{in\_features}) \times (\text{in\_features}, \text{out\_features}) (\text{batch\_size}, \text{out\_features}). (batch_size,in_features)×(in_features,out_features)(batch_size,out_features). 所以在代码里就写成 x W.T再加上偏置 b通常会广播到 batch_size \text{batch\_size} batch_size 那个维度。 本质上这和数学公式里 y W x b y W\,x b yWxb 并无冲突只是一个“列向量”和“行向量”的转置关系。只要搞清楚最终你想让输出 y y y 的 shape 是多少就能明白在代码里为什么要写 .T。 3. 常见错误与易混点解析 有些教程或文档会不小心写成“如果我们有一个形状为 ( in_features , out_features ) (\text{in\_features},\text{out\_features}) (in_features,out_features) 的权重矩阵 W W W……”——然后又要做 W x Wx Wx想得到一个 out_features \text{out\_features} out_features-维的结果。但按照线性代数的常规写法行数必须和输出维度匹配、列数必须和输入维度匹配。所以 正确 的说法应该是 W ∈ R ( out_features ) × ( in_features ) . W\in\mathbb{R}^{(\text{out\_features}) \times (\text{in\_features})}. W∈R(out_features)×(in_features). 否则从矩阵乘法次序来看就对不上。 但这又可能让人迷惑为什么深度学习框架 torch.nn.Linear(in_features, out_features) 却给出 weight.shape (out_features, in_features) 其实正是同一个道理它和上面“数学文献里”用到的 W W W 形状完全一致。 4. 小结 从数学角度 最传统的记号是 y W x b , W ∈ R ( out_features ) × ( in_features ) , x ∈ R ( in_features ) , y ∈ R ( out_features ) . y W\,x b, \quad W \in \mathbb{R}^{(\text{out\_features})\times(\text{in\_features})},\, x \in \mathbb{R}^{(\text{in\_features})},\, y \in \mathbb{R}^{(\text{out\_features})}. yWxb,W∈R(out_features)×(in_features),x∈R(in_features),y∈R(out_features). 从深度学习代码角度 由于批量数据常被视为行向量每一行代表一个样本特征因此形状通常是 ( batch_size , in_features ) (\text{batch\_size},\, \text{in\_features}) (batch_size,in_features)。对应的权重 W 定义为 ( out_features , in_features ) (\text{out\_features},\, \text{in\_features}) (out_features,in_features)。为了完成行乘以列的矩阵运算需要对 W 做转置y x W.T b得到的 y.shape 即 ( batch_size , out_features ) (\text{batch\_size},\, \text{out\_features}) (batch_size,out_features)。 避免踩坑 写公式时仔细确认 in_features \text{in\_features} in_features、 out_features \text{out\_features} out_features 的位置以及矩阵行列顺序。编程实践中理解“为什么要 .T”非常重要那只是为了匹配「行×列」的矩阵乘法规则本质上还是和 y W x b y Wx b yWxb 相同。 通过理解并区分“列向量”与“行向量”的不同惯例避免因为矩阵维度或转置不当而导致莫名其妙的错误或 bug。 参考链接 PyTorch 文档torch.nn.Linear深度学习中的矩阵运算初步 —— batch_size 与矩阵乘法常见线性代数符号行向量与列向量
http://www.hkea.cn/news/14444012/

相关文章:

  • 嘉兴港区建设局网站网站建设需求调研方法
  • 服务器网站80端口打不开云端视差wordpress企业主题破解版
  • 阿里巴巴建设网站首页四川建设网官网住房和城乡厅
  • 怎么分析网站的外链建设情况摄影师网站制作
  • 网站做漏洞扫描费用网站页面设计与实现
  • 咸阳网站建设方案东莞高埗做网站哪个公司好
  • wordpress网站下载北京seo多少钱
  • 有个人做网站的吗wordpress的xss漏洞
  • 任丘网站开发建设怎么选物联网是什么
  • 网站消耗流量视觉品牌网站建设
  • 新开传奇网站发布网站tp5企业网站开发百度云
  • 专业柳州网站建设多少钱做公司的后台网站用什么软件好
  • 英语网站海报手抄报怎么做搜索引擎优化seo什么意思
  • 太阳宫网站建设泰安网络设计公司
  • 档案网站建设的意义沈阳专业网站建设公司排名
  • 做网站法人拍照背景东营新闻联播视频
  • 江门建设建筑网站wordpress文章右边自定义字段
  • 网站建设费缴税腾讯网页游戏平台
  • 网站建设与维护 电子版ug编程培训
  • 站长工具seo综合查询推广建设银行+贷款+查询+网站
  • 荣茂网站建设成都宅天下装饰公司怎么样
  • 做网站服务器是必须购买的吗网站前端改版涉及到的问题
  • 网站开发项目总结范文小程序怎么申请注册费用
  • 网站导读怎么做wordpress visual composer主题
  • 张家港网站建设哪家好龙岩天宫山海拔
  • 网站列表页模板wordpress源码分析
  • 扎区门户网站建设大连网站推广公司
  • 重庆网站公司用jsp做校园网站
  • 快站怎么做淘客网站心理软件定制开发
  • 做网站备案都需要什么东西北京理工大学网站网页设计