Skip to main content

Keras Notify Callback

forthebadge made-with-python

PyPI version

A Tensorflow/Keras callback which sends information about your model training, on various messaging platforms.

Installation

Using pip:

pip install keras-notify

Usage

Import the required module and add it to the list callbacks while training your model.

Example:

>>> from keras-notify import TelegramCallback
>>> telegram_callback = TelegramCallback('<BotToken>',
                                         '<ChatID>',
	                                 'CNN Model',
	                                 ['loss', 'val_loss'],
	                                 ['accuracy', 'val_accuracy'],
	                                 True)
>>> model.fit(x_train, y_train,
              batch_size=32,
              epochs=10,
              validation_data=(x_test, y_test),
              callbacks=[telegram_callback])

Telegram

  1. Create a telegram bot using BotFather
    • Search for @BotFather on telegram.
    • Send /help to get list of all commands.
    • Send /newbot to create a new bot and complete the setup.
    • Copy the bot token after creating the bot.
  2. Get the chat ID
    • Search for the bot you created and send it any random message.
    • Go to this URL https://api.telegram.org/bot<BOT_TOKEN>/getUpdates (replace <BOT_TOKEN> with your bot token)
    • Copy the chat id of the user you want to send messages to.
    • You receive the chat id only if you send the message first and then go to the above url.
  3. Use the TelegramCallback() class.
TelegramCallback(bot_token=None, chat_id=None, modelName='model', loss_metrics=['loss'], acc_metrics=[], getSummary=False):

Arguments:

  • bot_token : unique token of Telegram bot {str}
  • chat_id : Telegram chat id you want to send message to {str}
  • modelName : name of your model {str}
  • loss_metrics : loss metrics you want in the loss graph {list of strings}
  • acc_metrics : accuracy metrics you want in the accuracy graphs {list of strings}
  • getSummary : Do you want message for each epoch (False) or a single message containing information about all epochs (True). {bool}

Slack

  1. Create a Slack workspace
  2. Create a new channel
  3. Search for the Incoming Webhooks in the Apps and install it.
  4. Copy the Webhook URL
  5. Use the SlackCallback() class.
SlackCallback(bot_token=None, chat_id=None, modelName='model', loss_metrics=['loss'], acc_metrics=[], getSummary=False):

Arguments:

  • webhookURL : unique webhook URL of the app {str}
  • channel : channel name or username you want to send message to {str}
  • modelName : name of your model {str}
  • loss_metrics : loss metrics you want in the loss graph {list of strings}
  • acc_metrics : accuracy metrics you want in the accuracy graph {list of strings}
  • getSummary : Do you want message for each epoch (False) or a single message containing information about all epochs (True). {bool}

Sending images in Slack is not supported currently.

ToDo

  • WhatsApp
  • E-Mail
  • Zulip
  • Messages

Metadata

Release files for keras-notify 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keras-notify 0.0.1
File Size Uploaded Provenance Actions
keras-notify-0.0.1.tar.gz 5.2 kB Without provenance Details for keras-notify-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for keras-notify 0.0.1
File Interpreter ABI Platform Actions
keras_notify-0.0.1-py3-none-any.whl Python 3 none any Details for keras_notify-0.0.1-py3-none-any.whl

Total release size: 9.9 kB

Release files / keras-notify-0.0.1.tar.gz

Download URL keras-notify-0.0.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1534e00288f09615ccc1519aec23bd860092b81d8a1c563afca5378ce81429e6
BLAKE2b-256 checksum
How to use checksums
531fbd6e04a1cba65b4ff40708588976fb4cfe1c2f860bca0654a02097d633a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

Release files / keras_notify-0.0.1-py3-none-any.whl

Download URL keras_notify-0.0.1-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88c79a8fd4cf5be95424d6deac4117377f9edef74fb3047fc31527c8b783f618
BLAKE2b-256 checksum
How to use checksums
a28c5d935b2fdb58f3d44c050b4a12b3ced4f6d2ff51fae249954601d3ae4d65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

Security for keras-notify 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page