From the course: Training Neural Networks in C++

Unlock the full course today

Join today to access over 23,900 courses taught by industry experts.

Challenge: Finish the perceptron

Challenge: Finish the perceptron - C++ Tutorial

From the course: Training Neural Networks in C++

Challenge: Finish the perceptron

(upbeat music) - [Instructor] Ready for your first challenge? Let's finish up the Perceptron class. In order to test the class, we will need to be able to set the weights at specific values. So we need the set_weights function you see at line 24. And remember, we will 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 member 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 will 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