Sergey Zagoruyko @ WILLOW
Next iteration of Jupyter, ready to use!
My experience for keeping track of experiments:
The most powerful feature:
a bit messy but installs nodejs:
conda install -c conda-forge jupyterlab
otherwise:
pip install jupyterlab
Text editing (e.g. python code or yaml files) supports by default Sublime, Emacs and Vim.
To edit Jupyter cells there is Vim extension: https://github.com/jwkvam/jupyterlab-vim
Install with:
jupyter labextension install jupyterlab_vim
and others https://github.com/jupyter/jupyter/wiki/Jupyter-kernels
Microsoft Python extension allows importing and editing jupyter files:
from IPython.display import HTML
youtube_id = 'ctOM-Gza04Y'
HTML(f'<iframe width="560" height="315" src="https://www.youtube.com/embed/{youtube_id}?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>')
import pandas as pd
pd.read_json('/sequoia/data1/szagoruy/tmp/47179/exp_args.json')
dataroot | dataset | depth | nthread | save | seed | sphere-alpha-min | sphere-dim | sphere-m | width | |
---|---|---|---|---|---|---|---|---|---|---|
0 | /sequoia/data2/szagoruy/datasets/ | CIFAR100 | 28 | 1 | logs/resnet28-10_CIFAR100_resnet_sphereloss961... | 1 | 0 | 8 | 4 | 10 |
1 | /sequoia/data2/szagoruy/datasets/ | CIFAR100 | 28 | 1 | logs/resnet28-10_CIFAR100_resnet_sphereloss961... | 1 | 0 | 16 | 4 | 10 |
2 | /sequoia/data2/szagoruy/datasets/ | CIFAR100 | 28 | 1 | logs/resnet28-10_CIFAR100_resnet_sphereloss961... | 1 | 0 | 32 | 4 | 10 |
3 | /sequoia/data2/szagoruy/datasets/ | CIFAR100 | 28 | 1 | logs/resnet28-10_CIFAR100_resnet_sphereloss961... | 1 | 0 | 64 | 4 | 10 |
4 | /sequoia/data2/szagoruy/datasets/ | CIFAR100 | 28 | 1 | logs/resnet28-10_CIFAR100_resnet_sphereloss961... | 1 | 0 | 128 | 4 | 10 |
%pylab inline
%config InlineBackend.figure_format = 'retina'
import seaborn as sns
import torch
sns.set()
Populating the interactive namespace from numpy and matplotlib
a = torch.rand(64, 64, 3)
plt.imshow(a)
<matplotlib.image.AxesImage at 0x7fde9c958e10>
pd.DataFrame({'x': torch.randn(128).cumsum(0),
'y': torch.randn(128).cumsum(0),
}).plot.hist(figsize=(16,8), alpha=0.8);
import torch
from torch import nn
from torchviz import make_dot
lstm_cell = nn.LSTMCell(128, 128)
x = torch.randn(1, 128)
make_dot(lstm_cell(x), params=dict(list(lstm_cell.named_parameters())))
Besides writing equations in jupyter cells like that: $$D_{KL} = \sum_i p(i) \log \frac{p(i)}{q(i)},$$ it is possible to write latex files that get compiled and rendered in Jupyter lab.
%pdb on
/ %pdb off
magick turns on debugging on errors
Not a complete IDE!:
With JupyterLab:
For writing code I use IDE (mostly vim, sometimes VSCode).