Tensorboard for Pytorch
One of my favorite tool in machine learning is Tensorboard which can be used to visualize a number of different statistics about your model. It has been always hard for me to interpret the behaviour of a neural network.
Taking a glance at the parameters or how they progress over the training procedure is always valuable, especially getting to know your model better enables you further improve the performance of the model. Tensorboard provides convenient and efficient tools to visualize your models’ statistics.
Firstly, install tensorboard via pip:
Call tensorboard with the following command on command line (here –logdir accepts the directory for the tensorboard data):
If you are on a jupyter-notebook:
The dashboard can be accessed through this link (http://localhost:6006/)
On the other hand, if you are working on a remote server, you need to forward everything on port 6006 of the server (in 127.0.0.1:6006) to the local machine on port 16006 (again this can be any port). This can be done by connecting to a server with a small addition to the original ssh command.
Here, the “-L” option allows you to map a specific port on the server machine to your local machine’s port. Then you will be able to connect the tensorboard of interest through the following link (http://127.0.0.1:16006) from your local device.
Then, you are good to go. Enjoy tracking the important statistics through training progress. The following code snippet helps you understand how to track the statistics of interest.
For further details: