Keras序列类文档说
Every Sequence must implement the __getitem__ and the __len__ methods. If you
want to modify your dataset between epochs you may implement on_epoch_end. The
method __getitem__ should return a complete batch.
然而, training_generator.pyfit_generator
中其他类似方法的源代码调用方法,生成器作为参数传递。根据我的理解,这意味着子类应该是一个需要实现方法的迭代器。next
Sequence
__next__
为了使用从Sequence
类似fit_generator
,predict_generator
等方法的子类化的类,是否需要实现__next__
方法?