Skip to main content

Grading

Nickname

Change your nickname in the Discord server to your full name, first and last. This is how we identify you. This item carries 0 points. If you skip it and open a ticket without a first and last name in your nickname, we subtract 10 points from your Assignment 1 grade as a penalty.

Development Environment Setup

This section is optional and carries no points. Please refer to the Virtualization guide for setup instructions. After you clone or import the class github repo you can show that your development environment is correctly set up:
  1. Complete this notebook. It prints your Torch version and the device it resolved, which is cuda on an NVIDIA machine, mps on an Apple Silicon Mac running natively, and cpu otherwise. A screenshot of that output is the proof, whichever setup you chose.
  2. Create an account on Hugging Face and provide a screenshot of your profile.
Screenshots must be stored as .png files, named dev-environment-xyz.png, and located under the assignment submission folder in your cloned class repo.

Grid Anomaly Detection

In February 2021 Winter Storm Uri broke the Texas grid. Temperatures collapsed, generation failed, and ERCOT began shedding load in the early hours of 15 February. Around 4.5 million homes and businesses lost power and hundreds of people died. Background is in the 2021 Texas power crisis article. You will build a model of ordinary grid behaviour, freeze it, and decide whether its residuals separate that week from a normal week. The model is the ridge regression from the linear regression and SGD pages. Only the design matrix changes. You will add temperature, calendar indicators, and interactions between them, and fit it by stochastic gradient descent.

What you will need

The notebook reads real ERCOT data from the gridstatus.io API, so you need your own API key. It is free.
  1. Go to the gridstatus.io developer documentation and create an account.
  2. Copy your API key from your account page.
  3. Make the notebook see it under the name GRIDSTATUS_API_KEY. The first code cell calls load_dotenv() and then reads os.environ["GRIDSTATUS_API_KEY"], so the name has to match exactly.
In Colab, open the Secrets panel using the key icon in the left sidebar. Add a secret named GRIDSTATUS_API_KEY, paste your key as the value, and turn on notebook access for it. Then run this once, before the first cell:
Running locally, create a file named .env next to the notebook with a single line:
Check that .env appears in your .gitignore before you commit anything.
Do not paste your API key into a notebook cell. You submit this notebook with every cell output saved, so a key written into a cell is committed to your repository and visible to anyone who can read it. The Colab Secrets panel and the .env file both keep the key out of the file you hand in.

Assignment Notebook

Open Notebook in Colab

Grid Anomaly Detection Notebook

Submitting

Commit the notebook to your own private clone of the class repo, under assignments/assignment-1. Save all cell outputs before you commit. A notebook without outputs is graded as if the cells never ran. Then submit the complete GitHub URL of that directory, not of the repository root, to Canvas or Brightspace. The assignment submission guide covers the rest: setting up your clone, adding the TAs as collaborators, and the README each assignment folder needs.