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: about 1 year 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.
- Host: GitHub
- URL: https://github.com/ilias-ant/tf-notify
- Owner: ilias-ant
- License: apache-2.0
- Created: 2022-07-14T15:39:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-28T15:57:28.000Z (over 3 years ago)
- Last Synced: 2025-04-02T00:46:53.035Z (about 1 year ago)
- Topics: callback, keras, notifications, slack, telegram, tensoflow
- Language: Python
- Homepage: https://tf-notify.readthedocs.io
- Size: 241 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# tf-notify
[](https://pypi.org/project/tf-notify/) [](https://www.python.org/) [](https://www.tensorflow.org/)
[](https://codecov.io/gh/ilias-ant/tf-notify) [](https://github.com/psf/black) [](https://github.com/ilias-ant/tf-notify/actions/workflows/ci.yml)
[](https://tf-notify.readthedocs.io/en/latest/?badge=latest)
[](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!
## 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).


