0
ミニバンド勾配降下で学習率を印刷しようとしました。しかし、多くのエポックではIrは変わらない(常に0.10000000149)。しかし、それはevreryミニバッチを変更することを支持した。コードは以下の通りである:あなたが印刷されている何印刷学習率evary epoch in sgd
# set the decay as 1e-1 to see the Ir change between epochs.
sgd = SGD(lr=0.1, decay=1e-1, momentum=0.9, nesterov=True)
model.compile(loss='categorical_crossentropy',
optimizer=sgd,
metrics=['accuracy'])
class LossHistory(Callback):
def on_epoch_begin(self, batch, logs={}):
lr=self.model.optimizer.lr.get_value()
print('Ir:', lr)
history=LossHistory()
model.fit(X_train, Y_train,
batch_size= batch_size,
nb_epoch= nb_epoch,
callbacks= [history])