KCHWang
KCHWang
@helloworldlxb Hi! Have you fixed your problem? I am having exactly the same issue here. Any wisdom please? Many thanks!
@piiswrong Let's say that I have 3 classes. Does it mean that my labels should be 0, 1 and 2? Thanks!
BYW, I get rid of the embedding layer as defined in the lstm.py and put my X_train directly to hidden layer. Is this why it is not working?
@Godricly Thanks for your reply! I am pretty sure that X_train and y_train are not empty. I did print their shape right before build this **train_iter = mx.io.NDArrayIter(X_train, y_train, batch_size=batch_size)**.
@Godricly thanks! It seems that you are right! I just wrote my own iterator.
@sxjscience Thanks! I understand that is what **label = mx.sym.Reshape(data=label, target_shape=(0,))** is doing. But what about **label = mx.sym.transpose(data=label)**? I am confused about the transpose function. Any hint please?
Here is how I define my LSTM: `def lstm_general_unroll(num_lstm_layer, seq_len, num_hidden, num_label, dropout=0.): ``` cls_weight = mx.sym.Variable("cls_weight") cls_bias = mx.sym.Variable("cls_bias") param_cells = [] last_states = [] for i in range(num_lstm_layer):...
My iterator is also similar to BucketSentenceIter in [https://github.com/dmlc/mxnet/blob/master/example/rnn/bucket_io.py](url). Here are a few critical lines: ` ``` init_state_names = [x[0] for x in self.init_states] data[:] = self.X_data[idx] label = self.label_buffer...
`data shape: (32L, 15L, 18L) label.shape: (32L, 15L)` 32 is batch size. 15 is sequence length. 18 is the dimension of input feature. In the char-cnn example, the input feature...
Could someone please show me what is wrong here? Many thanks!