Machine Learning
for FRC
Edmond Lee
Programming Mentor
Overview
What is Machine Learning?
General Practice
Model
Training
Data
Prediction
Learning Algorithm
Test Data
Applying Machine Learning in FRC?
Let’s think briefly about how machine learning can be used in FRC Vision:
Linear Regression
Modeling the Cost Function
Gradient Descent
Workshop
Hints
Row vector (1xN matrix): [1 2 3], Column Vector (Nx1 matrix): [1; 2; 3]
Math operations after a dot (.*) perform element-wise operations on matrices, else they will be matrix operations.
Many errors are due to operations on incompatible matrices, use size() to inspect dimensions
Useful functions include plot(), sum(), be sure to look at the documentation
Hypothesis is theta *x, not theta transposed as in the PDF, because it is a column vector already, so dimensions are correct
Why does X contain a column of 1s as well as the original input? The 1 serves as a bias value to allow the model to be shifted and it gets multiplied with theta_0. What happens if we use a columns of zeros instead?
Overfitting and Underfitting
Neural Networks
Optimizing a neural network
CNNs
SSD Caffe
Setting up the repo
Gathering data
Training a model
Centering the robot
The problem: We want the robot to move the preloaded gear to the pipe. The pipe is in between two pieces of reflective tape.
Detection 0: 370 225 466 405 Detection 0: 289 270 332 352 Detection 0: 289 262 313 311
Detection 1: 6 211 93 395 Detection 1: 445 274 479 354 Detection 1: 204 255 225 303
Future Work
Attributions