Assignment 01: Neural Network Demos
Learning Goals
- Learn how to use Pomona HPC servers
- See what neural networks can do
Grading Walk-Throughs
These instructions are subject to change as I have not yet met with the TAs.
This assignment will be graded as “Nailed It” / “Not Yet” by a TA. To complete (“Nailed It”) the assignment, you must
- Complete the assignment and submit your work to gradescope.
- Meet with a TA during their mentor session hours.
- Complete the walk-through with all group members. I prefer all partners to be present during the walk-through, but you can each meet with the TA separately if needed.
- Walk the TA through your answers. Do not expect to make corrections during the walk-through.
- The TA will then either
- mark your assignment as 100% on gradescope, or
- inform you that you have some corrections to make.
- If corrections are needed, then you will need to complete them and conduct a new walk-through with a TA.
If you have concerns about the grading walk-through, you can meet with me after you have first met with a TA.
Overview
For this assignment, you will need to:
- Login to a Pomona’s Jupyter Hub
- Setup the course environment
- Clone a GitHub repository
- Run a Jupyter notebook
- Cleanup your server disk usage
- Report on your experience
Everyone must work on this assignment in groups of four. Please let me know if you need help finding a partner.
Tasks
Task 1: Login to Pomona’s Jupyter Hub
Everyone in your group should perform this step individually.
Go to Pomona’s Jupyter Hub and login with your Pomona credentials.
Task 2: Setup the Course Environment
Everyone in your group should perform this step individually. You will only need to perform this step once for the semester.
Once you have logged in, you will need to setup the course environment. You can do this by running the following commands in a terminal:
# Initialize conda and mamba
/class/cs152/miniforge3/bin/conda init bash
/class/cs152/miniforge3/bin/mamba init bash
# Set the default conda environment for your login shell
echo "conda activate cs152" >> ~/.bashrc
# Re-source your environment for it to take effect
source ~/.bashrc
# Register our conda environment with Jupyter
/class/cs152/miniforge3/envs/cs152/bin/python -m ipykernel install --user --name 'cs152' --display-name "Python3 (cs152)"
Task 3: Clone the Assignment Repository
Everyone in your group should perform this step individually.
I will occasionally provide starter code for assignments and example code from lectures. This code will always be stored in a GitHub repository. You will need to clone this repository to your Jupyter Hub account.
cd ~/
git clone https://github.com/anthonyjclark/cs152spring25.git cs152
Task 4: Run the Jupyter Notebook
Only one person in your group should perform this step. This notebook will cause the server to download a lot of data, and we are likely to run into problems when multiple people are running their code at the exact same time. This will be a bit of an experiment for the semester.
After you run the demos, you must add an additional pipeline
s from the Hugging Face quick tour documentation. The gradescope assignment requires you to add at least one demo, but you can add as many as you’d like.
Task 5: Cleanup Your Server Disk Usage
Once you done running the demo notebook, you should run the following commands:
# See how much space the downloaded models are taking up
cd ~/.cache
du -hd1
# Delete the downloaded models (we won't need them again for a long time, if at all)
rm -rf huggingface
Task 6: Report on Your Experience
You should open the assignment on gradescope and answer the questions. You should be prepared to discuss your answers with a TA during the grading walk-through.
Submitting Your Assignment
You will submit your responses on gradescope. Only one partner should submit. The submitter will add the other partner through the gradescope interface.
Additional details for using gradescope can be found here: