Jupyter notebook.
To do: add compatible html version.
JupyterLab as a convenient notebook interface for python programming. Depending on your taste and your system, you might want to download these individually or as part of a full distribution like Anaconda.
Google Colab: is a web-based jupyter notebook interface to python that comes with tensorflow & keras pre-installed and allows you to run your code for free on their GPU servers.
Deepnote: is also a free online platform with a jupyter interface (and tensorflow & keras). But in contrast to colaboratory, several people can edit the same notebook (and execute cells) at the same time! This is ideal for hack-a-thons.
Anaconda: is a popular open-source distribution of Python and R programming languages that is specifically designed for data science and machine learning tasks. Where you can install Jupyter through the user friendly Anaconda Navigator. A good option for most OS.
Here is an example where torch is not installed. This works for WindowOS, MacOS and Linux:
# This cell will install any of the missing packages we'll use in the notebook
import sys
!{sys.executable} -m pip install torch
Perform the initial setup of Matplotlib and use the magic Jupyter command to align figures in the Jupyter notebook cell. Then, change the image dpi to 300. This will make the generated PNG images have a better quality.
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.dpi'] = 300
plt.rcParams['savefig.dpi'] = 300
For users of the Seaborn package, the following commands can be used to increase the quality of the figures:
import seaborn as sns
sns.set(rc={'figure.dpi':300, 'savefig.dpi':300})
sns.set_context('notebook')
sns.set_style("ticks")
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('svg')
However, running your Jupyter notebook might take a longer time when generating complex plots in vector format, but it will be worth it.
Alternatively:
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('pdf')