How to choose number of hidden layers and nodes in Neural Network

preview_player
Показать описание
In this video we will understand how we can perform hyperparameter optimization on an Artificial Neural Network.

You can buy my book on Finance with Machine Learning and Deep Learning from the below url

Рекомендации по теме
Комментарии
Автор

The video is good but it doesn't answers "How to choose number of hidden layers and nodes in Neural Network
". It just applies a simple GridSearch which is mostly useless in a real world NN architecture that you can take to production.

bhaskartripathi
Автор

instead of y = (y>0.5)
you can use y = np.where(y>0.5, 1, 0)
This will turn values to 1 and 0 instead of bool

But Great Job Mr. Naik... I really appreciate your efforts

tusharnandy
Автор

The question in the title was not answered at all.
why [[20], [40, 20]] and why not [[1000], [1222, 555]].
this video is about how nicely you can make or format a generic script. no more no less.

redosem
Автор

Thank you Krish for the wonderful video. You are doing an excellent job

AbhishekDey-lyjl
Автор

Thats a good yet a naive approach.Its still pretty vague as to why [[20], [40, 20]]... Neurons can vary between any random number and why these numbers specifically ? Is there a logic behind it ? Does it depend on the number of input features or the number of input rows ?
Why only 30 epochs? Its so vague... What if I dynamically create a neural network on the fly, running a gridsearch wont work

gautam
Автор

Very good tutorial. It took some massaging due to some differences with sklearn packages, but that's part of the "fun". One suggestion - don't turn off verbose. It DOES take a long time, at least with verbose on you'll know that your computer is doing something!

michaelschlitzer
Автор

Wonderful!! This is great for situation when you're trying to automatically train models for edge devices when the input signal shape is not known, love it

christinechetty
Автор

A clear decent description of the GridSearch CV approach to find out the hyper parameters of a NN. However a couple things to mention:
1. The logic is not clear why we suddenly choose three layers with 20, (40, 20), (45, 30, 15) etc? How dis you select them?
2. Standardization does help to get faster convergence but it NEVER ensure a gobal minima. It is stochastic gradient decent that is used as a backbone of tensorflow ensures the global minima if your cost function is convex or pseudoconvex
3. Your confusion matrix for accuracy is really fishy!! Why the 2nd column of confusion matrix is completely 0 ? It means the model can not capture any of the churned cases at all. Accuracy might still be high because of high imbalance. Can you explain? Am I missing anything here?

budhadityagoswami
Автор

Great video, learnt a lot from this. I used to ask myself, when and what time to use which loss function, which encoder to user, LabelEncoder for y values in the range of 2 classes and OneHotEncoder as a compliment that is for more than 2 classes.

the_street_coder
Автор

I made a neural network with sigmoid function . But when i am training it . I got a overflow error in sigmoid function and my output is stuck, giving same output for every input

vincentjr
Автор

@ 13:24
in the confusion matrix:-
the False positive and the true negative are 0 . Isn't that mean model is not able to predict Exited =1 and its only predicting all the cases as 0?

rishavsrivastav
Автор

How did u choose 20 neurons, or 45 neurons? why not 30, 60, 80 or others> ? thanks!

dylanwang
Автор

Hi Krish,


Thanks! your video really enhanced my understanding of Machine Learning further. I appreciate your simple and straight forward explanation. However, I still have some questions to ask.


I see that your layers are kind of ascended in terms of the number of element


layers = [[20], [40, 20].[45, 30, 15]]


when I try to change it to


layers = [[40, 40], [30, 30], [30, 30, 30], [30, 30, 30, 30], [30, 30, 30, 30, 30]]


since I want to evaluate the effect of the number of nodes given the same number of layers. I got the


ValueError : Input 0 is incompatible with layer lstm_14: expected ndim=3, found ndim=2


At this moment I am kinda lost why this gives me the error.

Thanks beforehand Krish. Your help will be very much appreciated!


Cheers!


Phil

philipegunawan
Автор

its interesting explanation .please attach python code you exolained

tadiosbelay
Автор

This code is not working in Google colab but it works in my Jupyter notebook. What should I do if I want to exacute the same code in Google colab?

zaladhaval
Автор

Great video .Please provide the data set and ipynb notebook.Thanks

sandipansarkar
Автор

Plz provide the link for this code...Tq in advance

madhubabu
Автор

In the create_model function, why haven't you added an activation function in the output layer? Since it is a binary classification task, we should add a sigmoid function right?

shreyjain
Автор

Would've been nice, if you would've said the answer first and then explain how you got there, instead of the other way around.

lerneninverschiedenenforme
Автор

Hello, the video is great but the "perfect model" that it gave you predicts only zero, doesn't it?

meneliknouvellon