I have simple code that works fine, but i need to create something like 1% of ML done and 10% of ML done etc...
trainX = np.array(features_data)
trainY = np.array(labels_data)
model = Sequential()
model.add(Dense(10, input_dim=input_dimensions, activation='relu'))
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer='adam')
model.fit(trainX, trainY, nb_epoch=3000, batch_size=2, verbose=2)
model.save(model_location)
Or how to execute some python code after epoch execution?
Epoch 1707/3000
0s - loss: 0.5908
Epoch 1708/3000
0s - loss: 0.4808
Epoch 1709/3000
// how to execute here some code on python
0s - loss: 0.7568
Epoch 1710/3000
0s - loss: 0.5906
You are looking for a Callback
. It has a special method - on_epoch_end
which is executed after each epoch. Documentation might show you different scenarios you could achieve using their API
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With