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. |