pytorch函数
gather
函数的用法为torch.gather(input, dim, index, out=None) → Tensor
Parameters:
input (Tensor) – The source tensor
dim (int) – The axis along which to index
index (LongTensor) – The indices of elements to gather
out (Tensor, optional) – Destination tensor
例如
在转one-hot编码时会用到gather函数
scatter
scatter_(input, dim, index, src)将src中数据根据index中的索引按照dim的方向填进input中。
https://blog.csdn.net/qq_16234613/article/details/79827006
循环神经网络
隐节点之间的权重是共享的,而非每两个之间存在一个单独的权重矩阵。