SkalskiP / ILearnDeepLearning.py

This repository contains small projects related to Neural Networks and Deep Learning in general. Subjects are closely linekd with articles I publish on Medium. I encourage you both to read as well as to check how the code works in the action.
https://medium.com/@skalskip
MIT License
1.32k stars 466 forks source link

Fix numpy David model training #39

Open patrykgruszka opened 3 years ago

patrykgruszka commented 3 years ago

First of all, thanks for the great neural network example.

I've got an error trying to run the 01/03 script (Let's code a Neural Network in plain NumPy):

Traceback (most recent call last):
  File "/mynn/main.py", line 60, in <module>
    params_values = train(np.transpose(X_train), np.transpose(y_train.reshape((y_train.shape[0], 1))), NN_ARCHITECTURE, 10, 0.01)[0]
KeyError: 0

I think there is unnecessary [0] index reference. After removing this everything run smoothly.

By the way I've also removed unnecessary semicolons in the python scripts.