Neural Network from Scratch – Machine Learning Python


From scratch implementation of neural network in Python using only the numpy library. There’s a lot of mathematics behind Neural Networks particularly for back-prop and I’ve made previous videos going through the mathematics for NN and a blog post to enable us to focus on the implementation in this video.

✅ Support My Channel Through Patreon:

Github repository:

Blog post:



Comment List

  • Aladdin Persson
    November 15, 2020

    where is the math you said you go through in the first minute? you are talking there about previous videos. I don't find them.
    thanks in advance and thanks for all your videos.

  • Aladdin Persson
    November 15, 2020

    Could you help: How can I assign the accuracy to a variable, like a=accuracy or a = binary_accuracy. This is part of the code of the neural network:

    model = Sequential()

    model.add(Dense(48, input_dim=48, activation='relu'))

    model.add(Dense(24, activation='relu'))

    model.add(Dense(2, activation='sigmoid'))



    metrics=['binary_accuracy']), target_data, epochs=1000)

    scores = model.evaluate(training_data, target_data)

    "training_data, target_data are arrays"

    Result of evaluation:

    binary_accuracy: 0.5000

    binary_accuracy: 50.00%

  • Aladdin Persson
    November 15, 2020

    I just have a question. Can we make the number of layers to be added parameterised?

  • Aladdin Persson
    November 15, 2020

    Very Informative. Really loved it.

  • Aladdin Persson
    November 15, 2020

    Just a small correction in the video I said 3 layered where I was counting the input layer as well: this is not correct, as you don't normally count the input layer. This implementation is then of a 2 layered Neural net.

Write a comment