From the course: Training Neural Networks in C++ (2021)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Challenge: Finish the perceptron

Challenge: Finish the perceptron - C++ Tutorial

From the course: Training Neural Networks in C++ (2021)

Start my 1-month free trial

Challenge: Finish the perceptron

(lively music) - [Instructor] Ready for your first challenge? Let's finish up the perceptron class. In order to test the class, we'll need to be able to set the weights as specific values. So we need the set weights function you see at line 24. And remember, we'll use a sigmoid as the activation function. So that's the second thing you'll have to write starting at line 28. So once again, your task is to write two class functions, the sigmoid activation function and a separate function to write values to the weights. For the argument, receive a vector of doubles. You may or may not validate that the length of this vector matches the number of inputs in the neuron, including the bias. This is not crucial because we'll use it for simple tests. This should take you about 15 minutes. When you are done, let me show you my solution in the next video.

Contents