Skip to content

Send notifications from model training to your Slack channel

Notifications You must be signed in to change notification settings

sakvaua/KerasSlackCallback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Keras Slack Callback

Simple Keras callback that pings your slack channel with training results

Getting Started

  1. Create a test Slack token. Legacy token allows you to do everything we need here. https://get.slack.help/hc/en-us/articles/215770388-Create-and-regenerate-API-tokens
  2. pip install slackclient
  3. Configure the callback
#This is how you should store your tokens
#http://python-slackclient.readthedocs.io/en/latest/auth.html#handling-tokens
token='xoxp-yourtokengoeshere'#and not like this!!!
description='Mnist model MLP 512-RELU-DO0.2-512-RELU-DO0.2'#model descrition
message='Epoch {epoch:03d} loss:{val_loss:.4f} acc:{acc:.4f} val_loss:{val_loss:.4f} val_acc:{val_acc:.4f} '#format what to report 
slack=SlackCallback(token, channel='#general', model_description=description,mode='max', monitor='val_acc',message=message,best_only=True)

channel - which channel to post results to.

model_description - pretty self explanatory

mode 'min' or 'max' - lower of higher is better (accuracy - max, loss - min)

best_only - report only if there's an improvement

  1. Use Callback history = model.fit(x_train, y_train, validation_data=(x_test, y_test),callbacks=[slack])

Prerequisites

Tensorflow 1.1+ Keras 2.x slackclient

About

Send notifications from model training to your Slack channel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published