## Create a Simple Neural Network in Python from Scratch

In this video I’ll present you ways a synthetic neural community works, and how one can make one your self in Python. In the subsequent video we’ll make one that’s usable, however if you would like, that code can already be discovered on github. I like to recommend watching at 1.5x pace, except you are coding alongside.

Coding begins at 2:30

Github code for full neural community: https://github.com/jonasbostoen/simple-neural-network.py

### Comment List

• Polycode
November 9, 2020

In the next video we’re going to be making a blockchain in JavaScript, so subscribe if you’re interested in that stuff!

• Polycode
November 9, 2020

Very underrated channel..

• Polycode
November 9, 2020

Very clean! VERY NICE! 🙏😍 Great Video! 😊😊😊 thank you

• Polycode
November 9, 2020

finaly free code

• Polycode
November 9, 2020

WHERE IS the bias?

• Polycode
November 9, 2020

SUPERB

• Polycode
November 9, 2020

Man, this was so to the point! Thanks for your efforts. Best NN basics tutorial I've found so far! Very very useful!

• Polycode
November 9, 2020

Why do you need to transpose the arrays?

• Polycode
November 9, 2020

hey, guys, I have a problem when I run the code line 34: the synaptic_weights opreand with shape(3,1) doesn't match the np.dot shape (3,4). could any one help me

• Polycode
November 9, 2020

Pleas show me code system that diagonasis computer faults

• Polycode
November 9, 2020

Hello. What is the name of the compiler you are using to enter the code ?

• Polycode
November 9, 2020

does anyone know where the T comes from on the line with the synaptic weights?

• Polycode
November 9, 2020

Why make computation heavy algorithms in interpreted language like Python? Are you masochist and want to wait years for any resonable size NN to learn something?

• Polycode
November 9, 2020

I quite cannot get what you mean by 3 by 1 matrix in synaptic weights. In the data framework you presented in the beginning there are 4 training examples, but 3 inputs. I don't understand what is the difference between training examples(4) and inputs(3). Thanks beforehand

• Polycode
November 9, 2020

This video is 100% gold, thank you !

• Polycode
November 9, 2020

The derivative of sigmoid u have used was wrong!
S(x)'=s(x)(1-s(x)) not S(x)'=x(1-x)
https://math.stackexchange.com/questions/78575/derivative-of-sigmoid-function-sigma-x-frac11e-x

• Polycode
November 9, 2020

ValueError: shapes (4,1) and (3,1) not aligned: 1 (dim 1) != 3 (dim 0). How did you do that dot product? it is not possible

• Polycode
November 9, 2020

you are so cool. how do you learn different things so fast?

• Polycode
November 9, 2020

Excellent explanation!!!!!! Thank you very much

• Polycode
November 9, 2020

Very good explanation, but I did not understand at all the mathematics that performed 3 adjusted weights with a three-input array and three errors

• Polycode
November 9, 2020

Output = array[1[1]].value
Lol just kidding. This was a great video and I understood a ton

• Polycode
November 9, 2020

1:20 We need a little math. Bruh no pleaseee math anhhhhhhhhh

• Polycode
November 9, 2020

But your derivative is wrong. The derivative of a sigmoid function s(x) is equal to s'(x) = s(x)(1 – s(x)).

• Polycode
November 9, 2020

What does ø mean?

• Polycode
November 9, 2020

thank you

• Polycode
November 9, 2020

I don't really understand anything in this video. When i tried to change anything, i get an error. What should i do?

• Polycode
November 9, 2020

How did you manage to get your updated weights matx to assign as a (3,1) size, when the dot of the input layer and the adjustments is a (3,4) size? I have the exact same code written ( I've checked like 100 times) and this is the error I've gotten every time.

• Polycode
November 9, 2020

Great Stuff, Keep it up !!

• Polycode
November 9, 2020

My friend, your explanation in 15 minutes gave more clarity to me than hours of crash course tutorials online. So simple and well explained. Awesome stuff my man!

• Polycode
November 9, 2020

Please help.. why is it that when I change the 'rule' for outputting a 1 to be all numbers need to be a 1 I get weird outputs like this:

Outputs:
[[4.48411213e-07]
[9.91498793e-01]
[7.17983933e-03]
[7.17983933e-03]]

• Polycode
November 9, 2020

It is like your voice is putting your face to sleep. ;-;

• Polycode
November 9, 2020

Can anyone explain what transpose does?

• Polycode
November 9, 2020

9:37
Why did you write x * (1 – x) as the sigmoid derivative?
Isn't it sigmoid(x)(1 – sigmoid(x)) ?

• Polycode
November 9, 2020

Goddamn this is good.

• Polycode
November 9, 2020

Thanks for explaining .. Nice job!

• Polycode
November 9, 2020

Nice work! Finally found someone that can teach the way I can understand it..
I subscribed and look forward to watching all your videos!

• Polycode
November 9, 2020

I keep getting this error. I copied the code verbatim so i don't know what it is.
"Module 'numpy.random' has no 'random' member"

• Polycode
November 9, 2020

Hi guys, can anyone of tell me where the learning rate fit in the formula that he used?
I know the synaptic_weights are updated as W -= learning_rate*gradient. but he isn't using a learning rate anywhere, it's a bit confusing for me as most other sources update weights that way. Any help is appreciated, thanks in advance.

• Polycode
November 9, 2020

Am I the only one that does not understand the math?

• Polycode
November 9, 2020

um, arent you just basically generating a formula such that x*w1 + y*w2 + z*w3 = x?
so wouldn't it obv just eventually just make w1 = 1, w2 = 0, w3 = 0?

• Polycode
November 9, 2020

Why do you transpose the input_layer?

• Polycode
November 9, 2020

How does the sigmoid derivative work? I don;t understand the math behind it.
Thanks!

• Polycode
November 9, 2020

Hey you can't say new situation output is 1 because first all four scenarios third input is 1. Let's say,
Input 1 = A
Input 2 = B
Input 3 = C
If the boolean logic is A.C first four output is okay. But new situation should be zero instead of 1.
(This question is not related to neural networks but I'm little but confused how did you say the output of new situation)

• Polycode
November 9, 2020

How did you specifie the weights ?? Plz explain the logic..

• Polycode
November 9, 2020

this n1gga forgot euler's number in the sigmoid function. smh bruh

• Polycode
November 9, 2020

What's the name of the theme you're using?

• Polycode
November 9, 2020

i woudlve appreciated if your accent was more clear