![]() ![]() I am aware of this question, but I'm willing to go as low level as possible. Torch.rand(self.num_layers, self.batch_size, self.hidden_size).to(device)) Return (torch.rand(self.num_layers, self.batch_size, self.hidden_size).to(device), #return torch.rand(self.num_layers, self.batch_size, self.hidden_size) Lstm_out, self.hidden = self.lstm(cur_ft_tensor, self.hidden) Output_scores = torch.sigmoid(output_space) #we'll need to check if we need this sigmoidĬur_ft_tensor=feature_list#.view()Ĭur_ft_tensor=cur_ft_tensor.view() Output_space = self.hidden2out(lstm_out.view(len( feature_list), -1)) Lstm_out, _ = self.lstm( feature_list.view(len( feature_list), 1, -1)) Self.hidden2out = nn.Linear(hidden_size, output_size) Self.lstm = nn.LSTM(input_size, hidden_size,num_layers) Self.matching_in_out = matching_in_out #length of input vector matches the length of output vector Def _init_(self, input_size, hidden_size, output_size,num_layers, matching_in_out=False, batch_size=1): ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |