Keras Callbacks
I’ll look at using callbacks using LSTM networks…
Environment Setup
Python 3.5 is needed for TensorFlow 1.4+. A link to the requirements.txt can be found here
brew install pyenv
pyenv install 3.5.4
cd
virtualenv -p /Users/mchirico/.pyenv/versions/3.5.4/bin/python3.5 pbug
. pbug/bin/activate
pip install -r requirements.txt
import keras
class My_Callback(keras.callbacks.Callback):
def on_train_begin(self, logs={}):
return
def on_train_end(self, logs={}):
return
def on_epoch_begin(self, logs={}):
return
def on_epoch_end(self, epoch, logs={}):
return
def on_batch_begin(self, batch, logs={}):
return
def on_batch_end(self, batch, logs={}):
self.losses.append(logs.get('loss'))
return