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 - C++ Tutorial
From the course: Training Neural Networks in C++ (2021)
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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Neurons and the brain1m 49s
-
A simple model of a neuron5m 43s
-
Activation functions6m 21s
-
Perceptrons: A better model of a neuron3m 53s
-
Challenge: Finish the perceptron1m
-
Solution: Finish the perceptron37s
-
Logic gates3m 11s
-
Challenge: Logic gates with perceptrons1m
-
Solution: Logic gates with perceptrons46s
-
-
-
-
-