Search
If you are new to CTU, see the checklist for visiting students.
Important Links:
There is a discussion forum administered for this course that can be used to solicit help for the assignments. It is monitored by the lab assistants and it is the preferred form of communication for getting assistance for the assignments since all students can see the question and answer threads. Please check the forum first if you have some confusion about an assignment.
We also ask you to write remarks about lectures (typos, questions) to a separate thread
You will implement the labs in python. The assignment templates are prepared in python 3.7. The first lab will need python with standard packages (numpy, matplotlib) and Jupiter notebook running locally on you computer.
For the case you are not too sure about your Python/NumPy skills, have a look here: http://cs231n.github.io/python-numpy-tutorial/.
We recommend using an IDE for python development. There is a professional PyCharm license available to the university https://download.cvut.cz. We use Pycharm ourselves. However, it could be somewhat slow (running on java and has many features). A lighter variant would be Visual Studio Code, see e.g. this tutorial .
Here's some lines of code useful in Jupyter notebooks.
""" Resize the notbook to full width, to fit more code and images """ from IPython.core.display import display, HTML display(HTML("<style>.container { width:100% !important; }</style>")) """ some basic packages and settings to show images inline """ import numpy as np import importlib %matplotlib inline import matplotlib.pyplot as plt """ automatically reload included modules (need to run import command to trigger reloading) """ %load_ext autoreload %autoreload 2 """ Controls for figure sizes to change """ plt.rcParams['figure.dpi'] = 200 plt.rcParams['figure.figsize'] = [16, 8] plt.rcParams.update({'errorbar.capsize': 1})
For labs 2-6 please install pytorch to you computer locally. On the servers version 1.5 is currently available but not the later ones.
An easy way to try something with deep learning is Google Colab. Take a look at intro colab space . It has tensorflow and pytorch installed and you also get GPU acceleration. But it is harder to work with a bigger project with classes, debug, etc.
See student GPU servers at the department.
ml spider torch
ml torchvision/0.9.1-fosscuda-2019b-PyTorch-1.8.0
nvidia-smi
export CUDA_VISIBLE_DEVICES=3; python mytraining.py
http://cantor.felk.cvut.cz:8888
To not have to type your password each time you login, you can configure authentication on the server used pre-shared keys. You can do so using ssh-keygen and ssh-add. This instruction for linux seems ok.
ssh-keygen
ssh-add
If you want to copy some date there and back to the server, it is convenient to mount your working directory on the server to your filesystem using sshfs. This tool works at first, but may be failing in certain cases, when you change network access point, sleep / wake computer, etc. I use the following settings:
sshfs
sshfs -o defer_permissions,reconnect,ServerAliveInterval=120,ServerAliveCountMax=3,follow_symlinks,compression=yes -o kernel_cache,entry_timeout=5,sync_read shekhovt@cantor.felk.cvut.cz:/~ ~/cantor
You can configure the system environment you get when login to the server (see Controlling Modules During Login ). For this create on the server ~/.bash_profile standardly containing
~/.bash_profile
# .bash_profile if [ -f ~/.bashrc ]; then source ~/.bashrc fi
module restore
The command module restore there loads in the modules configuration previously saved with module save. This configuration should (theoretically) work even for non-interactive shell, such as when you configure Pycharm to run your code there.
module save
Pycharm Professional has a well-integrated support for remote development. You edit the code that is stored locally. When you need to run it, it is synchronized to a directory on the server (called deployment). You can run and even debug you code on the server from Pycharm.
See pycharm Configure an interpreter using SSH, See pycharm remote deployment, remote interpreter using SSH, remote debugging. Some other variants of configuring a remote interpreter are supported (e.g. remote Conda environment).