知识卡片
张量切片需要先确定轴语义
张量是多维数组,索引和切片必须与各轴含义对应。本书神经网络常以通道优先表示,并可加批次轴;Transformer则通常以N×d表示N个token及其d维特征。符号相似不表示形状相同,进行矩阵乘法或广播前应写清各轴。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
Index or slice of a tensor: x[c, i, j, k], x[:, :, k]; if x is a multidimensional tensor and we wish to slice by the first dimension, we may use xt or x[t] or x[t, :], all of which have the same meaning.
参考来源
- 位置:《Foundations of Computer Vision (Antonio Torralba, Phillip Isola etc.)》符号约定专题《符号与矩阵微积分约定》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Foundations of Computer Vision (Antonio Torralba, Phillip Isola etc.)/_epub-src/OPS/xhtml/c000b.xhtml)
- 结论依据:摘录中关于张量切片需要先确定轴语义的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:Index or slice of a tensor: x[c, i, j, k], x[:, :, k]; if x is a multidimensional tensor and we wish to slice by the first dimension, we may use xt or x[t] or x[t, :], all of which have the same meaning.