Create App.py
Browse files
App.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Compare your experiments with Aim on Spaces
|
2 |
+
Let's use a quick example of a PyTorch CNN trained on MNIST to demonstrate end-to-end Aim on Spaces deployment. The full example is in the Aim repo examples folder.
|
3 |
+
|
4 |
+
from aim import Run
|
5 |
+
from aim.pytorch import track_gradients_dists, track_params_dists
|
6 |
+
|
7 |
+
# Initialize a new Run
|
8 |
+
aim_run = Run()
|
9 |
+
...
|
10 |
+
items = {'accuracy': acc, 'loss': loss}
|
11 |
+
aim_run.track(items, epoch=epoch, context={'subset': 'train'})
|
12 |
+
|
13 |
+
# Track weights and gradients distributions
|
14 |
+
track_params_dists(model, aim_run)
|
15 |
+
track_gradients_dists(model, aim_run)
|