I have the following PyTorch RNN mode:
Jump to turn (6)
- 1I have the following PyTorch RNN mode:
- 2class CharRNN(nn.Module): def init(self, inputsize, hiddensize, outputsize, embe
- 3The model input is a sequence of text that has been converted to a sequence of u
- 4def samplefromoutput(logits, temperature=1.0): """ Sample from the logits with t
- 5What does unsqueeze do above?
- 6Why is it unsqueezed twice?
- User
I have the following PyTorch RNN mode:
- Assistant
It looks like your message got cut off. Could you please provide the details of your PyTorch RNN model? If you have code or specific questions about your model, feel free to share that, and I'll be happy to help you!
- User
class CharRNN(nn.Module): def init(self, input_size, hidden_size, output_size, embedding_dim=30): super(CharRNN, self).init() self.hidden_size = hidden_size self.embedding = torch.nn.Embedding(output_size, embedding_dim) self.W_e = nn.Parameter(torch.randn(hidden_size, embedding_dim) * 0.01) # Smaller std self.b_e = nn.Parameter(torch.zeros(hidden_size)) self.W_h = nn.Parameter(torch.randn(hidden_size, hidden_size) * 0.01) # Smaller std self.b_h = nn.Parameter(torch.zeros(hidden_size)) #TODO: set the fully connected layer self.fc = nn.Linear(hidden_size, output_size)