저는 Keras fit_generator 함수에 의해 소비 될 파이썬 생성기를 만들고 있습니다. 내 발전기에서 현재의 에포크 카운트를 사용하여 값을 조정하고 싶습니다. 이 번호를 참조 할 수있는 방법이 있습니까?Keras 생성기 내에서 에포크 번호를 어떻게 참조합니까?
def generate_arrays_from_file(path):
while 1:
f = open(path)
for line in f:
x, y = process_line(line)
epoch_number = ?
x = x + epoch_number
yield (x, y)
f.close()
model.fit_generator(generate_arrays_from_file('/my_file.txt'),
samples_per_epoch=10000, nb_epoch=10)
http://stackoverflow.com/questions/4548684/how-to-get-the-seconds-since-epoch-from-the-time-date- output-of-gmtime-in-py –