nicodjimenez / lstm

Minimal, clean example of lstm neural network training in python, for learning purposes.
1.75k stars 651 forks source link

Error in using 2 outputs #48

Open raj1052 opened 3 years ago

raj1052 commented 3 years ago

This implementation is for 50 input and 1 output. I'm trying to use it with 2 output and it gives an error as follows.

File "test.py", line 43, in example_0 loss = lstm_net.y_list_is(y_list, ToyLossLayer) File "lstm.py", line 155, in y_list_is diff_h = loss_layer.bottom_diff(self.lstm_node_list[idx].state.h, y_list[idx]) File "test.py", line 17, in bottom_diff diff[0] = 2 * (pred[0] - label) ValueError: setting an array element with a sequence.