A realtime remote service to get the keras callbacks to the telegram including the details of metrics .
- It helps by getting the updates of your model including metrics and loss function graphs which help user the view and get to a statistical conclusion about the model remotely.
- It is a biggest advantage for the users who need not spend hours and hours infront of system for watching the updates of the model.
- Updates you get are from a telegram bot.
You can easily install this telegram using following command.
pip install tensorgram
- Keras
- Tensorflow
- Requests
- Matplotlib
- Create a neural network in keras.The sample code is as follows.
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD
import numpy as np
import keras
X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([[0],[1],[1],[0]])
model = Sequential()
model.add(Dense(8, input_dim=2))
model.add(Activation('tanh'))
model.add(Dense(1))
model.add(Activation('sigmoid'))
sgd = SGD(lr=0.1)
model.compile(loss='binary_crossentropy', optimizer=sgd,metrics=['accuracy'])
- Now go to Telegram app and search for @tensorgram_bot and join the channel by clicking on the chat.
-
Store it safely as it will be required later.
-
Now we need to import the TensorGram from tensorgram library using following code.
from tensorgram import TensorGram
- Now we need to create a object of TensorGram by specifying the following attributes like model name and chat id which you obtained before.
tf=TensorGram("model-name","123456789")
- Now you can start training the model and specify the object in the callbacks.
model.fit(X, y, batch_size=1, epochs=10,callbacks=[tf],verbose=1)
- Now if you open the telegram app you will find the updates as follows.
If you find a bug (gave undesired results), kindly open an issue here by including your search query and the expected result.
If you'd like to request a new function, feel free to do so by opening an issue here. Please include sample queries and their corresponding results.
- If you wish to contribute kindly check the CONTRIBUTING.md🤝
|
You can find our Code of Conduct here.
Winter of Code is an open-source program envisioned by DevScript that helps understand the paradigm of Open Source contribution. It aims to bring students into the world of open source development and see the power of unified problem solving in real time.
## LicenseThis project follows the MIT License.
For any kind of suggesstions/ help in code Please mail me at ksdkamesh99@gmail.com.