Beginner Deep Learning Tutorial | MNIST Digits Classification Neural Network in Python, Keras

preview_player
Показать описание
In this beginner deep learning tutorial we will go through the entire process of creating a deep neural network in Python with Keras to classify handwritten digits. This is a problem which is trivial to a human but much more difficult for a machine, hence why we'll use some machine learning to solve it.

We'll have a high-level overview of the problem, load the data in Python, pre-process the data, build the fully connected network, train and evaluate it on our data, plot a confusion matrix and finally take a look at the mis-classified data to see how they look like and think about why they were not classified correctly by the network.

The only prerequisites for this tutorial are Python programming knowledge, and the will to learn ;) Everything else I'll explain on the way. Please let me know if you have any questions at all.

Contents:
00:00 Introduction
01:19 High Level Overview Presentation
03:19 Creating a Google Colab Notebook
04:14 Imports
05:40 Data Preparation
13:18 Building the Fully Connected Network
15:48 Training
16:53 Evaluation and Inference
21:30 Plotting a Confusion Matrix
24:01 Investigating Errors
29:55 Conclusion

Google Colab:

Code:

All My Social Links:

Follow me on instagram:

Follow me on twitter:

Like my page on facebook:

Music Used:
Joakim Karud - Classic
Рекомендации по теме
Комментарии
Автор

Just finished learning multivariable calculus and I'm ready to rock and roll :)

dhruvrachakonda
Автор

Very interesting and insightful tutorial. Thanks Andreas!

rafaelmello
Автор

Andreas, thanks for a good job! Very helpful!

megabyte_ga
Автор

very cool video. I had a question about this particular line of code "np.diagonal(np.take(y_pred_errors, y_true_errors, axis=1))". It seems like the np.take function is doing a lot of unnecessary sampling. Is there a way around this so we don't even bother with np.diagonal?

edit: For anyone interested, I think this is a little better
true_probability_errors = y_pred_errors[np.arange(len(y_true_errors)), y_true_errors]

zyankarim
Автор

Thanks for the video, keep creating, please!

mariolira
Автор

Hi can you make more projects with deep learning, this really helping me to learn

packirisamykaran
Автор

When you fit the model, you run 60000 data, but in my program it's 118 data for each epochs, am i doing it wrong ?

andreansihombing
Автор

boolean index did not match indexed array along dimension 0; dimension is 60000 but corresponding boolean dimension is 10000, this is the error I get if I try to display the samples

Okoth
Автор

about 10:04
Whoever use Keras:
from keras.utils import to_categorical


y_train = to_categorical(y_train, num_classes)
y_test = to_categorical(y_test, num_classes)


Whoever use tensorflow.keras:
from tensorflow.keras.utils import to_categorical

y_train = to_categorical(y_train, num_classes)
y_test = to_categorical(y_test, num_classes)

StunMuffin
Автор

hello author.I am doing with the same thing in evaluate and inference stage.But it shows ValueError: Input 0 of layer "sequential_9" is incompatible with the layer: expected shape=(None, 784), found shape=(None, 4704)

hongyeshao
Автор

sorry but I don't know the line x_train[y_train== i][0], what does the zero mean?

khoitaquang
Автор

Which tools and libraries do you use to code

khachlu
Автор

model.fit(x=x_train, y=y_train, batch_size=batch_size, epochs=epochs) .. . .1 frames

in autograph_handler(*args, **kwargs)
1145 except Exception as e: # pylint:disable=broad-except
1146 if hasattr(e, "ag_error_metadata"):
-> 1147 raise
1148 else:
1149 raise

kennyyap
Автор

hey is there any particular reason for choosing ur units to be 128? Im new to neural networks and I dont understand how to decide how many neurons we should have in our hidden layers. please let me know

aryansuvarna
Автор

I have a question please.
I don’t understand how output layer gives the highest probability for handwritten 0 at its 0th neuron, handwritten 4 at its 4th neuron and etc.

vaheyepremyan
Автор

Η εντολη model.fit(x=x_train, y=y_train, batch_size=batch_size, epochs=epochs)
μου βγαζει error :in wrapper(*args, **kwargs)
971 except Exception as e: # pylint:disable=broad-except
972 if hasattr(e, "ag_error_metadata"):
--> 973 raise
974 else:
975 raise
στο func_graph.py γνωριζεις πως μπορω να το διορθωσω;

Styl_Ch
Автор

i have a question ...can u please please ...tell me...if the model has already been train then do we have to train it again, when do the train weight are stored ? ...and how much time it takes

worldzodiac
Автор

i tried with same model but took a number that i drew in paint. it always predicts 8

arsalansayed
Автор

Whenever I try using x_train or y_train, it says they are not defined

hervelabrie-durand