Open golnooshAbd opened 4 months ago
https://github.com/lkulowski/LSTM_encoder_decoder/blob/79a6ecef04f1fa6b152ffdd16c903fb5a284478b/code/lstm_encoder_decoder.py#L160
https://github.com/lkulowski/LSTM_encoder_decoder/blob/79a6ecef04f1fa6b152ffdd16c903fb5a284478b/code/lstm_encoder_decoder.py#L161
Basically these lines are wrong and should be changed like below to iterate on all samples, although, it still doesn't consider the last samples which are not fit into (less than) one batch.
input_batch = input_tensor[:, b * batch_size: (b + 1) * batch_size, :] target_batch = target_tensor[:, b * batch_size: (b + 1) * batch_size, :]
https://github.com/lkulowski/LSTM_encoder_decoder/blob/79a6ecef04f1fa6b152ffdd16c903fb5a284478b/code/lstm_encoder_decoder.py#L160
https://github.com/lkulowski/LSTM_encoder_decoder/blob/79a6ecef04f1fa6b152ffdd16c903fb5a284478b/code/lstm_encoder_decoder.py#L161
Basically these lines are wrong and should be changed like below to iterate on all samples, although, it still doesn't consider the last samples which are not fit into (less than) one batch.