Created
March 27, 2018 07:40
-
-
Save JesperDramsch/606f7df42c41cac8d3435439cecae6e8 to your computer and use it in GitHub Desktop.
Small script to add keras push notifications to Telegram.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telegram_send | |
telegram_send.configure('~/.telegram/.conf') | |
class TelegramCallback(keras.callbacks.Callback): | |
def on_train_begin(self, logs={}): | |
telegram_send.send(["Starting Training"]) | |
def on_train_end(self, logs={}): | |
telegram_send.send(["Training Finished"]) | |
def on_batch_end(self, batch, logs={}): | |
telegram_send.send(["Loss: {:.8f} | Metrics: {:.5f}".format(logs.get('loss'),logs.get('acc'))]) | |
model.fit(x_train,y_train,epochs=epochs, verbose=0, callbacks=[TelegramCallback()]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment