Login to jupyter.cs.aalto.fi with your Aalto credentials, select course CS-E4890 Deep Learning (2022).
Click on “Assignments” tab, fetch an assignment. The fetched assignment is saved to /notebooks/deeplearn2022/assignment_name.
Solve the fetched assignment.
Some assignments could be solved in a reasonable amount of time on a CPU (you can solve assignments on JupyterHub). However, we strongly recommend to find a machine with a GPU to speed up the training process.
Assignments 6, 9, 10 are computationally heavy, you need to use a GPU (see more instructions below).
Make sure that the folder /notebooks/deeplearn2022/assignment_name contains the solved notebooks and the trained models (.pth files) when needed.
Validate your notebook.
If the assignment includes model training, set skip_training=True in one of the first cells of the notebook.
Click the "Validate" button. If validation takes too long, check that you set skip_training=True.
If validation "hangs" (it can happen when the server is overloaded), simply run all the cells of the notebook (for example, select "Restart & Run All" in the menu) and check that all the cells run properly.
Go to "Assignments" tab and click “Submit” for the solved assignment. You can submit multiple times. Only the last submission before the deadline will be evaluated.
Make sure that your submission appears in the list of "Submitted assignments".
Once the feedback is released, you can fetch it in the Assignments tab.
If you would like to understand better how grading works, please read the documentation.
IMPORTANT: Tips on notebooks, please read carefully
Do not hesitate to create new code cells. This is a good way to write extra tests you may want to run. Note that all cells are executed during evaluation. As long as your new cells do not overwrite important global variables, they should not cause
any trouble to autograding.
Never create new cells by menu commands "Edit/Copy Cells" and "Edit/Paste Cells ...". These commands create cells with duplicate ids and make autograding impossible. Use menu commands "Insert/Insert Cell ..." or the button with a plus sign to
insert new cells.
When you write code required to solve an assignment (e.g., model implementation, training loop and so on), we highly recommend you to insert the code where it says # YOUR CODE HERE.
Try to avoid using global variables in your code.
If your notebook is broken, you can always re-fetch the assignment. To do that, rename the folder with the assigment and fetch the assignment again.
All notebooks contain hidden tests which are used for grading. They are hidden inside read-only cells. Therefore, the read-only cells (including cells with no executable code) should never be removed, otherwise your submission cannot be validated
and you get 0 points.
Beware that saving a notebook in Google Colab may damage important meta-data used by the autograder. To avoid possible problems, we recommend you to copy-paste your code to the notebooks fetched on JupyterHub. Sorry for the inconvenience.
Please do not copy data files (or other unnecessary files) to a folder with a fetched assignment on jupyterhub. When you submit your solution, all the files in the assignment folder get copied to the exchange folder. If the assignment folder
contains lots of unnecessary files, autograding of your submission can fail and you can lose points. When your notebook is executed on jupyterhub, the cell with data_dir = tools.select_data_dir() sets data_dir to a folder
which contains all the required datasets.
Please do not define your wrapper-models on top of the models that you are asked to implement. For example, you are asked to design an MLP model with the following API:
def __init__(self, n_inputs, n_hidden, n_outputs):
# YOUR CODE HERE
def forward(self, x):
# YOUR CODE HERE
and use that in the training loop, the hidden tests may fail and you will lose points.
Tips on PyTorch
Try to get rid of the for-loops in your computational graph. PyTorch has many highly optimized functions that can be used instead of the for-loops.
Avoid using in-place operations, such as x += y or torch.nn.ReLU(inplace=True). Supporting in-place operations is hard for autograd (see this)
and most of the time you do not need to use them.
If you have to transfer model parameters to a device (with paramater.to(device)) inside the forward() function, you probably forgot to register model parameters. Try to avoid tensor.to(device) inside forward() function unless you create a new tensor there.
If you kernel dies during training, most likely you do not clean up the computational graph after each mini-batch. For example, a typical mistake is to add loss instead of loss.item() to the running loss estimate.
Solving assignments outside of JupyterHub
Unfortunately JupyterHub does not have a way to use GPUs at the moment. Therefore you may want to solve assignments (or at least execute the training part) outside of JupyterHub.
1) Solving assignments on your computer
Install the required packages to your computer. The easiest way is to create a virtual environment using the environment file posted below.
You have two options to access the assignment files:
Copy the files to your computer from JupyterHub. There are several ways to do that:
Compress the assignment folder with command tar -cvf assignment.tar assignment_folder and download the tar-file.
You can use GUI buttons to download files.
Mount your JupyterHub directory as a network drive (more information can be found here).
Select Upload and upload your notebook *.ipynb file. Once uploaded, the notebook should open automatically.
First, change your Runtime to GPU (Runtime menu is on the top menu bar).
Next, in the notebook screen, press on the file icon on the left side of the screen, it will open the file browser. Here, you need to press Upload and select all the files on the same level as your .ipynb files and upload
them (ignore temporary files such as __pycache__).
That’s it! You should be good to go.
Important: Google Colab lets you modify cells that are supposed to be read-only. Modification of read-only cells can cause problems for autograding and you may lose points because of that. We have tested that if you do not modify read-only
cells, the notebooks prepared in Colab are totally fine for autograding. However, some submissions prepared in Colab did not contain any meta-data required for autograding (if you know what actions can cause this, please let us know). Therefore,
to be on the safe side, we recommend you to copy-paste your code to the original notebook on JupyterHub instead of uploading the notebook file. Sorry for the inconvenience.
How can I re-fetch an assignment? Rename the folder with the fetched assignment and fetch the assignment again.
I have accidentally created a duplicate of a read-only cell and I cannot remove it. What should I do? Your notebook is broken and cannot be autograded. The only way is to re-fetch the assignment and copy-paste your code to the re-fetched
I cannot get my implementation to work, I think there is a bug in the assignment code. All the assignments have been solved by several students and we are quite confident that there are no major bugs in our code. If your implementation
does not work as expected, most likely you are doing something wrong.
How do I submit trained models? You do not need to take special care of the .pth-files: when you click the "Submit" button, all the files in the assignment folder are submitted.
If validation (initiated by the Validate button) passes all the tests, will I get full points? No, it does not mean that. Validation simply runs all the cells of your notebook like you would do with "Restart & Run All". So,
basically it checks that the code runs and all visible tests pass. It does not execute the hidden tests.
How can I know the number of points that I get for my solution? You will know the number of points only after the deadline when we release the feedback.
When I click "Validate", the validation is timed out. Check that you set skip_training=True. If that flag is correct but the problem persists, simply run all the cells of the notebook (for example, select "Restart & Run
All" in the menu) and check that all the cells run properly.
I missed the deadline. Is it possible to get partial points for late submissions? Unfortunately, we have a zero-point policy for late submissions. There are two extra assignments that you can solve to replace the one for which you missed
I forgot to press "Submit" button. Can you evaluate my solution? Unfortunately, no. We have a policy of not evaluating such solutions.
I uploaded a wrong .pth file. Can you evaluate my submission with a correct model? Unfortunately, no. It is part of the assignment to submit a trained model before the deadline.
My implementation is correct but I lost points, why? We kindly ask you to spend some time trying to understand why the hidden tests failed before contacting us. The tests work correctly most of the time. If you believe that your implementation
is correct or you cannot figure out why hidden tests fail, please contact us.
Can you give me ...% of points for cell ... because my implementation in that cell is partially correct? Unfortunately, no. We have carefully thought of such cases when designing the tests.