CS33: Exam 1 Study Guide
Definitions
You should generally be familiar with the definitions of the terms we've used in class, and be comfortable using them. Here are a few that are especially important:
- Artificial Intelligence Making computers better at tasks that humans are good at.
- AI is made up of many subfields such as robotics, planning, game playing, and machine learning.
- ML has become the dominant approach.
- Machine Learning Any computer program that improves its performance at some task through experience.
- There are three main approaches to machine learning: supervised learning, reinforcement learning, and unsupervised learning.
- Supervised Learning When we train a model using data sets that pair inputs with correct answers (targets).
- Examples we've seen in the class include linear regression, logistic regression, and deep learning.
- Deep Learning A term coined to describe the type of artificial neural network in modern use that has many hidden layers.
- Large Language Model (LLM) A specific type of deep learning model designed to produce text by sequentially generating a plausible-next-word given the context (i.e. the words so far).
Should I use AI for this?
- Be able to reason about real-world problem scenarios to assess possible impacts or dangers
- Be able to reason about what sorts of problems AI models are appropriate for, and how we might go about deciding
- Understand both the strengths and the limitations of LLMs, and why their capabilities might be called "jagged"
- Understand how long the term AI has been in use, and how its use has shifted over that time
- Practice problems:
- Consider an AI system designed to recognize the faces of students to automatically unlock doors around campus when a student who has permission to enter that door approaches.
- What types of mistakes are possible?
- What are the consequences of each type of mistake?
- What sort of tradeoff between these types of mistakes is reasonable?
- What sort of accuracy rate (if any) would be sufficient to make such a system safe for use?
- What sorts of concerns might such a system present even if it had a high accuracy?
- Consider the same questions, but for a facial recognition system intended for different environments. For example, airport security cameras, or police body cameras.
Working with Data
- Be able to define 'data'
- Understand the relationship between data and the world it is intended to reflect
- Understand some of the factors that can result in data not accurately reflecting the world
- Know the different types of data that can be stored and how they are categorized
- Understand the process that data goes through before we can apply AI/ML techniques
- Understand what Exploratory Analysis is
- Be able to apply reasoning and analysis to data in order to gain understanding and draw conclusions
- Practice: try working through the Titanic data cleaning example from class, or try doing some Exploratory Analysis on a new data set
Models, Linear and Logistic Regression with Gradient Descent
- Be able to define 'model'
- Be able to explain what makes models useful? What makes models dangerous?
- Understand why we add a column of 1's to the example vectors
- Understand how to interpret the weights of a model once it's been fitted to some data
- Understand the assumptions Linear Regression makes about the data or problem
- Understand the assumptions Logistic Regression makes about the data or problem
- Understand when to use Linear and when to use Logistic regression
- Be able to evaluate a problem and decide whether Linear (or Logistic) Regression is likely to be useful
- Understand why we use Logistic Sigmoid instead of Step-Edge for Logistic Regression
- Understand the difference between Stochastic and Batch gradient descent
- Understand how to handle multi-class problems using Logistic Regression
- Understand how the update equation for SGD is calculated and applied (NOTE: you do not need to be able to do the derivation, but you should have a conceptual understanding of what is being done and why)
- Understand the role of the learning rate (alpha), and the dangers of having it be too big or too small.
- Be able to apply gradient descent by hand. Try working through some practice problems:
- Consider a sample problem with two examples: ([5,3], 1) and ([-2,4], 3)
- Assume the initial weights are initialized to 0. Calculate the predictions (should be 0 for both examples), and then calculate the sum squared error.
- Do one iteration of gradient descent using a learning rate (alpha) of 0.01
- Re-calculate the predictions and the error using the updated weights
- For more practice, try doing several more steps.
- Try doing SGD with one update per example, and compare it to doing batch-updates
- Try using a different set of data points (i.e. come up with your own examples to practice on)
- Try doing a similar problem using the Logistic Regression framework; you'll need to ensure the target values are 0 or 1, e.g. ([5,3], 0) and ([-2, 4], 1)
Artificial Neural Networks
- Understand the operation of nodes (simulated neurons) in an ANN
- Describe the important differences between the Step-Edge, Logistic Sigmoid, and Rectified Linear activation functions
- Understand the relationship between ANNs and linear/logistic regression models
- Describe the difference between shallow and deep networks
- Understand the similarities and the differences between ANNs and biological neural networks
- Know the differences between input, output, and hidden nodes
- Be able to decide how many input and output nodes are necessary for a given problem
- Be capable of calculating the number of learnable parameters in a given network
- Understand the similarities and differences between SGD for logistic regression and SGD for an ANN
- Know how the Error Backpropagation Algorithm calculates error, both for output nodes and for hidden nodes (NOTE: you do not need to be able to do the derivation, but you should have a conceptual understanding of what is being done and why).
- Practice problems:
- Consider an ANN with one hidden layer; it has 4 input nodes, 6 hidden nodes, and 3 output nodes. How many total learnable parameters does it have?
- Try doing this for several other network architectures
- Imagine we want to create an ANN to fit a data set with 7 columns, one of which is the target. The target is a class label, which have the values 'cat', 'dog', or 'bird'. How many input nodes would the network have? How many output nodes?