A custom callback for email (via SMTP) integration is introduced, called EmailCallback
:
import tensorflow as tf
from tf_notify import EmailCallback
model = tf.keras.Sequential(name="neural-network")
model.add(tf.keras.layers.Dense(1, input_dim=784))
model.compile(
optimizer=tf.keras.optimizers.RMSprop(learning_rate=0.1),
loss="mean_squared_error",
metrics=["mean_absolute_error"],
)
model.fit(
x_train,
y_train,
batch_size=128,
epochs=2,
verbose=0,
validation_split=0.5,
callbacks=[
EmailCallback(
to="[email protected]",
from_="[email protected]",
host="smtp.mail.yahoo.com",
port=465,
username="my-cool-username",
password="my-cool-password", # one-time app password
ssl=True,
)
],
)
Documentation:
The public atrributes for all available callbacks are now documented