RNN
迷失e城堡
这个作者很懒,什么都没留下…
展开
-
2021-01-11
LSTM理解 这篇博客讲的很清楚LSTM的torch代码与LSTM参数维度问题 LSTM实现的代码 import torch import torch.nn as nn import torch.optim as optim import torchvision from torchvision import transforms class Rnn(nn.Module): def __init__(self, in_dim, hidden_dim, n_layer, n_classes):原创 2021-01-11 20:38:35 · 70 阅读 · 0 评论 -
2021-01-10
torch.nn.Embedding维度问题 input : LongTensor of arbitrary shape containing the indices to extract Output: (*, embedding_dim), where * is the input shpe 注意: self.emb()输入的一定是一个Longtorch,这个LongTensor中可以是带有batch_size N的二维tensor,也可以是不带batch_size的一维tensor。 输入的Long原创 2021-01-10 22:53:02 · 71 阅读 · 0 评论