├── src ├── tensorgram.egg-info │ ├── dependency_links.txt │ ├── top_level.txt │ ├── requires.txt │ ├── SOURCES.txt │ └── PKG-INFO ├── __pycache__ │ └── tensorgram.cpython-37.pyc └── tensorgram.py ├── Images ├── merged.png ├── start.jpeg ├── chatid.jpeg ├── graphs.jpeg ├── training.jpeg └── tensorgram.gif ├── dist ├── tensorgram-0.0.7.tar.gz └── tensorgram-0.0.7-py3-none-any.whl ├── requirements.txt ├── .github ├── ISSUE_TEMPLATE │ ├── documentation.md │ ├── bug_report.md │ └── feature_request.md └── config.yml ├── setup.py ├── LICENSE ├── CONTRIBUTORS.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md └── README.md /src/tensorgram.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/tensorgram.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | tensorgram 2 | -------------------------------------------------------------------------------- /Images/merged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksdkamesh99/TensorGram/HEAD/Images/merged.png -------------------------------------------------------------------------------- /Images/start.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksdkamesh99/TensorGram/HEAD/Images/start.jpeg -------------------------------------------------------------------------------- /Images/chatid.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksdkamesh99/TensorGram/HEAD/Images/chatid.jpeg -------------------------------------------------------------------------------- /Images/graphs.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksdkamesh99/TensorGram/HEAD/Images/graphs.jpeg -------------------------------------------------------------------------------- /Images/training.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksdkamesh99/TensorGram/HEAD/Images/training.jpeg -------------------------------------------------------------------------------- /Images/tensorgram.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksdkamesh99/TensorGram/HEAD/Images/tensorgram.gif -------------------------------------------------------------------------------- /src/tensorgram.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | keras>=2.4 2 | tensorflow>=2.3 3 | matplotlib>=3.2 4 | requests 5 | -------------------------------------------------------------------------------- /dist/tensorgram-0.0.7.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksdkamesh99/TensorGram/HEAD/dist/tensorgram-0.0.7.tar.gz -------------------------------------------------------------------------------- /dist/tensorgram-0.0.7-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksdkamesh99/TensorGram/HEAD/dist/tensorgram-0.0.7-py3-none-any.whl -------------------------------------------------------------------------------- /src/__pycache__/tensorgram.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksdkamesh99/TensorGram/HEAD/src/__pycache__/tensorgram.cpython-37.pyc -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==1.1.1 2 | gunicorn==19.9.0 3 | itsdangerous==1.1.0 4 | Jinja2==2.10.1 5 | MarkupSafe==1.1.1 6 | Werkzeug==0.15.5 7 | numpy>=1.9.2 8 | scipy>=0.15.1 9 | matplotlib>=1.4.3 10 | pandas>=0.19 11 | urllib3==1.25.10 12 | urlopen==1.0.0 -------------------------------------------------------------------------------- /src/tensorgram.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | README.md 2 | setup.py 3 | src/tensorgram.py 4 | src/tensorgram.egg-info/PKG-INFO 5 | src/tensorgram.egg-info/SOURCES.txt 6 | src/tensorgram.egg-info/dependency_links.txt 7 | src/tensorgram.egg-info/requires.txt 8 | src/tensorgram.egg-info/top_level.txt -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Documentation \U0001F4DA" 3 | about: Suggest improvement in the documenation 4 | title: '' 5 | labels: documentation 6 | assignees: '' 7 | 8 | --- 9 | 10 | # What are the proposed changes 11 | Provides details of the proposed changes 12 | 13 | # Provide a screenshot of the issue and also after resolving the issue 14 | Provide a screenshot for better understanding -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Bug Report \U0001F41B" 3 | about: Create a bug report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Additional context** 27 | Add any other context about the problem here. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Feature request \U0001F386" 3 | about: Suggest an idea for this project to improve 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | with open("README.md", "r") as fh: 4 | long_description = fh.read() 5 | 6 | setuptools.setup( 7 | name="tensorgram", 8 | version="0.0.7", 9 | author="Sai Durga Kamesh Kota", 10 | author_email="ksdkamesh99@gmail.com", 11 | description="A realtime remote service to get the keras callbacks to the telegram including the details of metrics ", 12 | long_description=long_description, 13 | long_description_content_type="text/markdown", 14 | url="https://github.com/ksdkamesh99/TensorGram", 15 | packages=setuptools.find_packages(), 16 | classifiers=[ 17 | "Programming Language :: Python :: 3", 18 | "License :: OSI Approved :: MIT License", 19 | "Operating System :: OS Independent", 20 | ], 21 | python_requires='>=3.6', 22 | py_modules=["tensorgram"], 23 | package_dir={'':'src'}, 24 | install_requires=["keras>=2.4", "tensorflow>=2.3","matplotlib>=3.2","requests"] 25 | 26 | ) 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Sai Durga Kamesh Kota 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/config.yml: -------------------------------------------------------------------------------- 1 | # Configuration for welcome - https://github.com/behaviorbot/welcome 2 | 3 | # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome 4 | # Comment to be posted to on first time issues 5 | 6 | newIssueWelcomeComment: > 7 | Hello there!👋 Welcome to the project!🚀⚡ 8 | 9 | 10 | Thank you and congrats🎉 for opening your very first issue in this project.TensorGram is a realtime remote service to get the keras callbacks to the telegram including the details of metrics. 11 | Kindly 🌟 this repo and follow me. Your Love towards me it truely appreciated. 12 | Please adhere to our [Code of Conduct](https://github.com/ksdkamesh99/TensorGram/blob/main/CONTRIBUTORS.md).🙌 13 | 14 | 15 | 16 | 17 | 18 | # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome 19 | # Comment to be posted to on PRs from first time contributors in your repository 20 | 21 | newPRWelcomeComment: > 22 | Hello there!👋 Welcome to the project!💖 23 | 24 | 25 | Thank you and congrats🎉 for opening your first pull request.✨ TensorGram is a realtime remote service to get the keras callbacks to the telegram including the details of metrics . 26 | Kindly 🌟 this repo and follow me. Your Love towards me it truely appreciated. 27 | Please adhere to our [Code of Conduct](https://github.com/ksdkamesh99/TensorGram/blob/main/CONTRIBUTORS.md).🙌 We will get back to you as soon as we can 😄. 28 | 29 | 30 | 31 | 32 | # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge 33 | # Comment to be posted to on pull requests merged by a first time user 34 | 35 | firstPRMergeComment: > 36 | Congrats on merging your first pull request! 🎉 All the best for your amazing open source journey ahead 🚀. 37 | -------------------------------------------------------------------------------- /src/tensorgram.py: -------------------------------------------------------------------------------- 1 | import keras 2 | from urllib import request 3 | from urllib.parse import quote 4 | import requests 5 | import io 6 | import matplotlib.pyplot as plt 7 | 8 | 9 | class TensorGram(keras.callbacks.Callback): 10 | 11 | def __init__(self,modelname,id): 12 | self.modelname=modelname 13 | self.id=id 14 | self.attributes={} 15 | self.key_attributes=[] 16 | def parse_url(self,t): 17 | t=t.split(' ') 18 | t='%20'.join(t) 19 | return t 20 | def on_train_begin(self, logs=None): 21 | self.text="Model "+self.modelname+" Training Started" 22 | self.text=str(self.text) 23 | url="https://ksdkamesh99.pythonanywhere.com/send?id="+str(self.id)+"&data="+self.parse_url(self.text) 24 | s=request.urlopen(url) 25 | 26 | 27 | def on_train_end(self, logs=None): 28 | self.text="Model "+self.modelname+" Traning Completed" 29 | self.text=str(self.text) 30 | url="https://ksdkamesh99.pythonanywhere.com/send?id="+str(self.id)+"&data="+self.parse_url(self.text) 31 | s=request.urlopen(url) 32 | for i in self.key_attributes: 33 | self.image_buff(self.attributes[i],i) 34 | 35 | def on_epoch_begin(self, epoch, logs=None): 36 | self.text="Model "+self.modelname+" Epoch "+str(epoch+1)+" Running" 37 | self.text=str(self.text) 38 | url="https://ksdkamesh99.pythonanywhere.com/send?id="+str(self.id)+"&data="+self.parse_url(self.text) 39 | s=request.urlopen(url) 40 | 41 | def on_epoch_end(self, epoch, logs=None): 42 | self.text="Model "+self.modelname+" loss after epoch "+str(epoch+1)+" is "+str(logs.get('loss')) 43 | self.text=str(self.text) 44 | if epoch==0: 45 | self.key_attributes=list(logs.keys()) 46 | for i in self.key_attributes: 47 | self.attributes[i]=[] 48 | for i in self.key_attributes: 49 | self.attributes[i].append(logs.get(i)) 50 | url="https://ksdkamesh99.pythonanywhere.com/send?id="+str(self.id)+"&data="+self.parse_url(self.text) 51 | s=request.urlopen(url) 52 | def image_buff(self,attri,title): 53 | plt.figure() 54 | plt.plot(attri) 55 | plt.title(title) 56 | buf = io.BytesIO() 57 | plt.savefig(buf, format='png') 58 | files={'photo':buf.getbuffer()} 59 | url="https://ksdkamesh99.pythonanywhere.com/sendphoto?id="+str(self.id)+"&caption="+title 60 | ss=requests.post(url,files=files) 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | ## Contributors ✨ 2 | 3 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 4 | 5 | 6 | 7 | 8 |
|
11 |
12 | 13 | ksdkamesh99 14 | 15 | 16 | 👑 💻 👀 💬 Author 17 | 18 | |
19 |
20 |
21 | 22 | akrish4 23 | 24 | 25 | 📖 26 | 27 | |
28 |
29 |
30 | 31 | muthuannamalai12 32 | 33 | 34 | 📖 35 | 36 | |
37 |
38 |
39 | 40 | Sloth-Panda 41 | 42 | 43 | 📖 44 | 45 | |
46 |
47 |
48 | 49 | ImgBotApp 50 | 51 | 52 | 💻 53 | 54 | |
55 |
56 |
57 | 58 | tharunc 59 | 60 | 61 | 📖 62 | 63 | |
64 |
99 |
100 |
101 | [](https://github.com/ksdkamesh99/TensorGram)
102 |
14 |
15 |
16 |
17 |
67 |
68 |
69 |
70 |
74 |
75 |
76 |
77 |
108 |
109 |
110 |
111 |
5 |
6 |
7 |
8 |
12 | 13 | [](https://pepy.tech/project/tensorgram) 14 | [](https://github.com/ksdkamesh99/TensorGram/blob/main/LICENSE) 15 | [](https://github.com//ksdkamesh99/TensorGram/stargazers) 16 | [](https://github.com/thinktocode/COVID-19-Tracker/issues) 17 | [](https://img.shields.io/github/contributors/ksdkamesh99/TensorGram) 18 | [](https://github.com/thinktocode/COVID-19-Tracker) 19 | [](https://github.com/thinktocode/COVID-19-Tracker/pulls) 20 | [](https://github.com//ksdkamesh99/TensorGram/network/members) 21 | 22 |
23 | 24 | 25 | ## Features:- 26 | 27 | 1. 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. 28 | 2. 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. 29 | 3. Updates you get are from a telegram bot. 30 | 31 | ## Installation:- 32 | 33 | You can easily install this telegram using following command. 34 | ``` 35 | pip install tensorgram 36 | ``` 37 | ## Dependencies/Requirements:- 38 | 39 | 1. Keras 40 | 2. Tensorflow 41 | 3. Requests 42 | 4. Matplotlib 43 | 44 | #### Works on python>=3.7 45 | 46 | ## How to use:- 47 | 48 | * Create a neural network in keras.The sample code is as follows. 49 | ``` 50 | import tensorflow 51 | from tensorflow.keras.models import Sequential 52 | from tensorflow.keras.layers import Dense, Dropout, Activation 53 | import numpy as np 54 | from tensorflow.keras.optimizers import SGD 55 | 56 | X = np.array([[0,0],[0,1],[1,0],[1,1]]) 57 | y = np.array([[0],[1],[1],[0]]) 58 | 59 | model = Sequential() 60 | model.add(Dense(8, input_dim=2)) 61 | model.add(Activation('tanh')) 62 | model.add(Dense(1)) 63 | model.add(Activation('sigmoid')) 64 | 65 | sgd = SGD(learning_rate=0.1) 66 | model.compile(loss='binary_crossentropy', optimizer=sgd,metrics=['accuracy']) 67 | 68 | 69 | 70 | ``` 71 | 72 | * Now go to Telegram app and search for @tensorgram_bot and join the channel by clicking on the chat. 73 | 74 |
75 |
76 |
77 |
78 |
82 |
83 |
84 |
85 |
116 |
117 |
118 |
119 |
|
136 |
137 | |
140 |
158 | ## License
159 |
160 | This project follows the [MIT License](/LICENSE).
161 |
162 | ## Contact:-
163 | For any kind of suggesstions/ help in code Please mail me at ksdkamesh99@gmail.com.
164 |
165 |
166 |
--------------------------------------------------------------------------------