Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qubvel/keras_telegram_callback
Telegram-bot callback for your Keras model
https://github.com/qubvel/keras_telegram_callback
callback keras telegram
Last synced: 15 days ago
JSON representation
Telegram-bot callback for your Keras model
- Host: GitHub
- URL: https://github.com/qubvel/keras_telegram_callback
- Owner: qubvel
- Created: 2018-04-23T20:44:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-27T18:23:45.000Z (over 5 years ago)
- Last Synced: 2024-10-03T12:42:08.482Z (about 1 month ago)
- Topics: callback, keras, telegram
- Language: Python
- Size: 6.84 KB
- Stars: 31
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Keras callback in Telegram
Telegram-bot callback for your Keras modelThis module allows your model to send learning history to your chat in Telegram messenger.
### Configure your Telegram Callback
To start use this callback you need fo register bot in telegram and get your `telegram_id`. Follow instructions below.#### Step 1. Register your telegram bot.
- Find `BotFather` in Telegram.
- Follow `BotFather` instructions to register your bot in a few steps and get `token`.#### Step 2. Get your ID.
- Find `@my_id_bot` bot in Telegram and get your `telegram_id`. If bot is not working get `telegram_id` manually (step 2a).#### Step 2a. Get your ID (optional).
- Find your bot in telegram and send message 'hello!'
- Paste in your browser `api.telegram.org/bot/getUpdates` (use token you get in previous step), if you did everything correctly you will recive a JSON where you can find your `telegram_id`.### Example
```python
from .callbacks import TelegramCallback# load data, define and compile model
...# create callback
config = {
'token': '556983321:AAHO-bSWaIqcvHL91Xw12X18OWczFIpY1s0', # paste your bot token
'telegram_id': 123456789, # paste your telegram_id
}tg_callback = TelegramCallback(config)
# start training
model.fit(x, y, batch_size=32, callbacks=[tg_callback])
```Congratulations! Now you will recive logs (losses, metrics, lr, etc.) in Telegram!