Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ilias-ant/tf-notify

Want to get notified on the progress of your TensorFlow model training? Enter, a TensorFlow Keras callback to send notifications on the messaging app of your choice.
https://github.com/ilias-ant/tf-notify

callback keras notifications slack telegram tensoflow

Last synced: 4 months ago
JSON representation

Want to get notified on the progress of your TensorFlow model training? Enter, a TensorFlow Keras callback to send notifications on the messaging app of your choice.

Awesome Lists containing this project

README

        

# tf-notify

[![PyPI](https://img.shields.io/pypi/v/tf-notify?color=blue&label=PyPI&logo=PyPI&logoColor=white)](https://pypi.org/project/tf-notify/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tf-notify?logo=python&logoColor=white)](https://www.python.org/) [![TensorFlow version](https://shields.io/badge/tensorflow-2.7%20%7C%202.8%20%7C%202.9%20-simple?logo=tensorflow&style=flat)](https://www.tensorflow.org/)
[![codecov](https://codecov.io/gh/ilias-ant/tf-notify/branch/main/graph/badge.svg?token=2H0VB8I8IH)](https://codecov.io/gh/ilias-ant/tf-notify) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ilias-ant/tf-notify/ci.yml?branch=main)](https://github.com/ilias-ant/tf-notify/actions/workflows/ci.yml)
[![Documentation Status](https://readthedocs.org/projects/tf-notify/badge/?version=latest)](https://tf-notify.readthedocs.io/en/latest/?badge=latest)
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/tf-notify?color=orange)](https://www.python.org/dev/peps/pep-0427/)

> Want to get notified on the progress of your TensorFlow model training?

This package provides a [tf.keras](https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/Callback) callback to send notifications to a messaging app of your choice.

## Install

The recommended installation is via `pip`:

```bash
pip install tf-notify
```

## Supported Apps

The following apps are currently supported. But, do check the project frequently, as many more will soon be supported!



Slack


Telegram


Email (SMTP)

## Usage

```python
import tensorflow as tf
from tf_notify import SlackCallback

# define the tf.keras model to add callbacks to
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=[
SlackCallback(webhook_url='https://url.to/webhook')
], # send a Slack notification when training ends!
)
```

You should see something like this on your Slack:

## How to contribute

If you wish to contribute, [this](CONTRIBUTING.md) is a great place to start!

## License

Distributed under the [Apache-2.0 license](LICENSE).