Any Help with the lstm_unroll Model in lstm.py?
I am reading the code in example/rnn/lstm.py. Could someone please explain what the last few lines are doing? Are we some how reshape label, which is a symbol here? Many thanks!
**################################################################################
# Make label the same shape as our produced data path
# I did not observe big speed difference between the following two ways
label = mx.sym.transpose(data=label)
label = mx.sym.Reshape(data=label, target_shape=(0,))
#label_slice = mx.sym.SliceChannel(data=label, num_outputs=seq_len)
#label = [label_slice[t] for t in range(seq_len)]
#label = mx.sym.Concat(*label, dim=0)
#label = mx.sym.Reshape(data=label, target_shape=(0,))
################################################################################**
@KCHWang The code is trying to squeeze the labels into a single vector.
@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?
Sequential Consistency, 保持预测结果与标签顺序一致,
@KCHWang I met a same problem with you when I run lstmocr.py with my own data(number=18), occur following error:
Traceback(msot recent call last):
File "lstm_ocr.py",line 165,in <module>
batch_end_callback=mx.callback.Speedometer(BATCHSIZE,50))
File "../../python/mxnet/model.py",line 745,in fit
self._init_params(dict(data.provide_data+data.provide_label))
File "../..python/mxnet/model.py",line 486,in _init_params
assert(arg_shapes is not None)
AssertionError
can you show me the iterator that you do yourself? I have no idea to deal with my data, thank you!
I have the same question. Do you have a solution? How to train my own data in the lstm?