class CNN(nn.Module):
def __init__(self, vocab_size, embedding_dim, n_filters, filter_sizes, output_dim,
dropout, pad_idx):
super().__init__()
...
self.s = [torch.nn.Parameter(torch.arange(1, embedding_dim+1, dtype=torch.float), requires_grad=True)]
I can’t see self.s in
for p in model.parameters():
print(p)
but it does show up when it’s
self.s = torch.nn.Parameter(torch.arange(1, embedding_dim+1, dtype=torch.float), requires_grad=True)
Is there another way to initialize multiple learn able parameters?