Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raynardj/torchember
PyTorch module tracking and visualization
https://github.com/raynardj/torchember
flask module pytorch statistics track visualization
Last synced: 5 days ago
JSON representation
PyTorch module tracking and visualization
- Host: GitHub
- URL: https://github.com/raynardj/torchember
- Owner: raynardj
- License: apache-2.0
- Created: 2020-02-11T13:13:34.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-12T00:19:08.000Z (almost 2 years ago)
- Last Synced: 2025-01-18T17:42:50.064Z (19 days ago)
- Topics: flask, module, pytorch, statistics, track, visualization
- Language: Jupyter Notebook
- Homepage: https://raynardj.github.io/torchember/
- Size: 5.02 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Torch Ember
> Tracking and visualize after the burning pytorch![logo](nbs/logo1.png)
## This framework tracks the pytorch model:* On ```nn.Module``` level
* Down to the metrics/ features of all tensors, includes
* inputs/outputs of each module
* weight/grad tensors
* By **minimal** extra coding
* Besides WebUI, Visualization compatible with **notebook** environment## Other lovely features
* Customizable metrics, with easy decorator syntax
* Split the tracking log in the way you like, just ```mark(k=v,k1=v2...)```
* You can easily switch on/off the tracking:
* Even cost of computation is tiny, torchember don't have to calculate metric for every iteration
* Hence, you can track eg. only the last steps, only each 200 steps .etc## Installation
```pip install torchember```## Fast Tutorial
* Instant colab tutorial here:
![Jupyter notebooks widget pic](nbs/002.png)
* Full [documentations](https://raynardj.github.io/torchember/)
### WebUI intro Video
* [video here](https://www.youtube.com/watch?v=2NbXDqcZKPY)![WebUI intro pic](nbs/001.png)
### Step1, Track your model
Place you torch ember tracker on your model
```python
from torchember.core import torchEmber
te = torchEmber(model)
```The above can track input and output of every module,The following can track status of every module
```python
for i in range(1000):
...
loss.backward()
optimizer.step()
te.log_model()```
Train your model as usual
### Step2 Plan A, visualize in notebook
For colab, kaggle kernels, there isn't an option to run another service, you can visualize the result in notebook.Of course the following is feasible in usual jupyter notebook.
```python
from torchember.visual import VisualByTensorvis = VisualByTensor()
```
* This extra line of code is for colab
```python
vis.scatter_plot(vis.ember_sub_df)
```### Step2 Plan B, Check the analysis on the WebUI
Run the service from terminal
```shell
$ torchember
```
The default port will be 8080Or assign a port
```shell
$ torchember --port=4200
```Visit your analysis at ```http://[host]:[port]```