![]() ![]() You can use it to send notifications on a wide variety of platforms and it is great for keeping track of experiments in data science teams.Īs usual, you can find all of the code in this article on GitHub. Knockknock is a useful tool that lets you keep track of your model training jobs with notifications. With knockknock, we can also send notifications on the following platforms:įor detailed documentation on how to send notifications on these platforms, be sure to check out the project repository on GitHub. This is a great feature if your data science team has a Slack workspace and wants to monitor your model training jobs. Slack notifications produced while training the model. Running the code above produces the following Slack notifications. from knockknock import slack_sender import os webhook_url = os.environ channel="#general") def train_model_slack_notify(X_train, y_train, X_test, y_test): return train_model(X_train, y_train, X_test, y_test) train_model_slack_notify(X_train, y_train, X_test, y_test) Please note that I stored my webhook URL in an environment variable for security reasons. The code below demonstrates how to create a Slack notification given a webhook URL and a specific channel to post in. Visit the Slack API page and then follow steps 1–3 in this tutorial to create a webhook. To do this, you need to create a Slack workspace, add a Slack app to it, and get a Slack webhook URL that you can supply to the slack_sender function decorator. Getting Slack Notificationsįinally, if you are part of a Slack team that is working on a machine learning project, you can also set up Slack notifications in a channel when your model finishes running. Training completion notification in Knockknock. The function below creates a simple CNN, trains it on the training dataset, and returns accuracy and loss values demonstrating the model’s performance on the test dataset. (X_train, y_train), (X_test, y_test) = mnist.load_data() X_train = X_train.reshape(X_train.shape, 28, 28,1) # adds extra dimension X_test = X_test.reshape(X_test.shape, 28, 28, 1) # adds extra dimension input_shape = (28, 28, 1) X_train = X_train.astype('float32') X_test = X_test.astype('float32') X_train /= 255 X_test /= 255 y_train = to_categorical(y_train) y_test = to_categorical(y_test) Training the Model
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |