From the course: Training Neural Networks in Python

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Challenge: Write your own Backpropagation method

Challenge: Write your own Backpropagation method - Python Tutorial

From the course: Training Neural Networks in Python

Challenge: Write your own Backpropagation method

(upbeat music) - [Instructor] Ready to finish up your multilayer perceptron class? This time your task is to write a backpropagation trainer method, which will run one sample through the network with the backpropagation algorithm. Don't worry, you'll just have to write a few lines per step in the provided code. In fact, you'll just have to fill in the blanks. You can do this. And feel free to go back to the backpropagation videos if you get stuck. The method is called bp and it receives a feature vector x and a label vector y. Both are regular Python lists. So the first two lines convert those lists into NumPy arrays as usual to have the operations in NumPy. Now your challenge starts in line 87. Notice that I've placed a comment for each step and skeleton code for the loops. Now for steps three and four, you'll need a new NumPy array of arrays I added to the class to store the error terms or lowercase deltas.…

Contents