10.2: Neural Networks: Perceptron Part 1 - The Nature of Code

The Coding Train · 523K views · 2017 · 44:39

Open on YouTube

Machine learning & deep learningEducation & learningtutorial

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they followed when writing their own perceptron code in C++ and Python, then link it while asking why their implementation misbehaves.

Recommended by 2 people across 2 different months, 2017 to 2022.

What it is

Daniel Shiffman of The Coding Train builds a simple perceptron from scratch in Processing, as part of his Nature of Code machine learning series. He covers the perceptron idea, activation functions, weights, a guess function, supervised learning, a training loop, learning rate and bias, using the task of classifying points above or below a line.

What people said

Recommends yarin Cohen · 2021-06 · Stack Overflow · on “Training a Perceptron model”

Following The Coding Train awesome video [this video] I'm using a Perceptron model to train a Neural Network on an XOR gates. I have 2 inputs and 1 output. Most of my code is very similar to the video, beside I'm using a different data set of XOR gates. I'm running into problem after training the model, it doesn't guess the correct answer even after 10 of thousands of training datas and I'm not sure why. Here is my full code: Perceptron.h #include <stdio.h> /* printf, scanf, puts, NULL */ #include <stdlib.h> /* srand, rand */ #include <time.h> /* time */ #include <vector> using std::vector; class Perceptron { private: vector<float> weights; float lr = 0.15; public: Perceptron() { // initialize th

Recommends Kavin Bharathi · 2022-06 · Stack Overflow · on “Perceptron outputs the same value for all inputs”

Thank you for your input. I wanna add that I was learning about perceptrons from the youtube channel "The Coding Train", from this video [this video] . I'll try your approach. Thank you again...

Cites Rahul Titare · 2017-07 · Stack Overflow · on “Classification perceptron implementation”

I have written Percentron example in Python from here [this video] . Here is the complete code import matplotlib.pyplot as plt import random as rnd import matplotlib.animation as animation NUM_POINTS = 5 LEANING_RATE=0.1 fig = plt.figure() # an empty figure with no axes ax1 = fig.add_subplot(1,1,1) plt.xlim(0, 120) plt.ylim(0, 120) points = [] weights = [rnd.uniform(-1,1),rnd.uniform(-1,1),rnd.uniform(-1,1)] circles = [] plt.plot([x for x in range(100)], [x for x in range(100)]) for i in range(NUM_POINTS): x = rnd.uniform(1, 100) y = rnd.uniform(1, 100) circ = plt.Circle((x, y), radius=1, fill=False, color='g') ax1.add_patch(circ) points.append((x,y,1)) circles.append(circ) def activation(val): i