Getting Started
Packages
We use the following major packages:
numpy: working with \(n\)-D arraystorch: training of differentiable modelstorchvision: tools for vision modelspandas: working with datamatplotlib: plottingtqdm: progress bars in the command linescikit-learn: source some classic datasets
The following command uses pip to install these python packages and some other minor ones:
pip install torch torchvision numpy matplotlib tqdm pandas scikit-learn requests validators openpyxl
Virtual Environment
Virtual environments allow you to install a custom set of packages with custom package versions for a project.
Inside the dlcourse directory, run
python -m venv code-venv
to create a blank virtual environment.
Activate it, and then install packages. Upon activation, the command line prompt changes to start with the name of the virtual environment. Here, it would be (code-venv):
source code-venv/bin/activate
pip install <packages above>
When you are done, you can run deactivate to return to the default global environment.
NumPy
A nice overview of using numpy is located online here.
Two KEY issues to watch out for:
- Standard matrix multiplication in
numpyuses the@symbol, not the*symbol. Users coming fromMatlaborJuliaoften trip over this issue a few times until they internalize the new symbol. - 2D Arrays are stored in row-major form.