coxlab / prednet

Code and models accompanying "Deep Predictive Coding Networks for Video Prediction and Unsupervised Learning"
https://arxiv.org/abs/1605.08104
MIT License
759 stars 259 forks source link

Last batch from SequenceGenerator is incorrect #67

Open Jannkar opened 4 years ago

Jannkar commented 4 years ago

In data_utils.py, the last incomplete batch from the next() function has wrong shape (real batch is padded with zero values). This will affect to training and testing results and is caused by: index_array, current_batch_size = next(self.index_generator), self.batch_size Now the current batch_size is always the predefined self.batch_size, right?

I think the current batch size should be instead defined like this: current_batch_size = len(index_array)