Tutorial 27- Create CNN Model and Optimize using Keras Tuner- Deep Learning

Поділитися
Вставка
  • Опубліковано 21 гру 2019
  • Please join as a member in my channel to get additional benefits like materials in Data Science, live streaming for Members and many more
    / @krishnaik06
    Keras Tuner blog: keras-team.github.io/keras-tu...
    Google Colab Code Link: colab.research.google.com/dri...
    Please do subscribe my other channel too
    / @krishnaikhindi
    Connect with me here:
    Twitter: / krishnaik06
    facebook: / krishnaik06
    Instagram: / krishnaik06

КОМЕНТАРІ • 139

  • @samhrmujawar
    @samhrmujawar 4 роки тому +35

    Out of 309 videos 285 videos you created in 2019 itself. great work man! Keep going.

  • @neeleshjaiswal4922
    @neeleshjaiswal4922 4 роки тому +5

    Thanks for this video. Yesterday only I saw your video 26. You said you will be completing the code explaintion in the next video. I am waiting for the second part of video -26 to come.😁

  • @bhavyachhabra1600
    @bhavyachhabra1600 4 роки тому

    Great explaination like always sir! Thankyou!

  • @badcode8037
    @badcode8037 2 роки тому +5

    Pooling layer should be given after convolutional layer. Its a must to reduce the computation and it also effects the accuracy, so you have to also use it in keras tuner as well. The results you got from keras tuner wont be the same, when you will actually be bulding the final model with pooling layer

  • @divyanshuyadav1566
    @divyanshuyadav1566 3 роки тому +4

    Bro🔥🔥 You saved my time. I was thinking this from last day that how can i choose parameters for my cnn model .. in this Computer world how can someone leave things to do manually by Programmer .... See Its KerasTuner here ❤️.. thanks Bhaiya You are awesome i always check you videos. 🔥🔥

  • @MohamedAshraf-zs6nv
    @MohamedAshraf-zs6nv 3 роки тому +1

    Thanks for the great effort, I wish if you enhance the audio quality so I can follow the tutorial without struggling to catch the steps
    even videos on 6/2020 have low audio quality.
    And thanks again Krish for the valuable tutorials.

  • @manujkumarjoshi9342
    @manujkumarjoshi9342 10 місяців тому

    It is an amazing add-on while building models.

  • @GauravSharma-ui4yd
    @GauravSharma-ui4yd 4 роки тому +2

    Thanks for these video sir. Please also continue the ml deployment series

  • @vikashchandramaurya1168
    @vikashchandramaurya1168 4 роки тому

    Very helpful tutorial, thanks a lot

  • @aniketgokarn3941
    @aniketgokarn3941 3 роки тому +5

    Thank you for the video :) I have a small doubt, umm, the accuracy was increasing, but the validation loss (val_loss) at the end during training was also increasing, does not that mean , the model is over fitting?

  • @alam_tapia
    @alam_tapia 2 роки тому

    Thank you! Amazing help!

  • @StepbyStepDataScience
    @StepbyStepDataScience 3 роки тому

    Thank you. This was awesome

  • @sakshitattri4882
    @sakshitattri4882 Рік тому +5

    hii Krish... thanks for such an amazing tutorial but i have a doubt why you haven't used pooling and data augmentation for more accurate prediction?

  • @patrickduhirwenzivugira4729
    @patrickduhirwenzivugira4729 3 роки тому +1

    Thank you for the great video. How can I also tune the optimizers (let's say ['Adam, RMSprop]) with dynamic learning rates? Many tutorials keep it fixed. Thank you

  • @mukeshchoudhary_1038
    @mukeshchoudhary_1038 3 роки тому

    thank you so much for really helped

  • @OrionEx88
    @OrionEx88 4 роки тому +12

    Great video! I have a question, it seems you already chose 2 conv2d layers, and you only searched for filters, kernel size, dense layers and learning rate. Can we also search for how many conv2d layers, pooling, dropout, etc.?

    • @pranav.shetty
      @pranav.shetty 3 роки тому +1

      Yes, you can loop over the number of layers, check the sub-topic "The search space may contain conditional hyperparameters" in this link --> "keras-team.github.io/keras-tuner/"

    • @pawanagrawal7653
      @pawanagrawal7653 3 роки тому +1

      @@pranav.shetty hey, in the tutorial, 99% accuracy is on training data, how to check accuracy on test data.

  • @viplovethakran1505
    @viplovethakran1505 Рік тому

    ohh my god its very amazing really

  • @upasanabhardwaj6140
    @upasanabhardwaj6140 3 роки тому

    Thank you sir for this video.. Please upload video for the explanation of CNN for text classification.

  • @bhavyachhabra1600
    @bhavyachhabra1600 4 роки тому +5

    Sir, how can we use keras tuner alongside transfer learning?

  • @psw1
    @psw1 4 роки тому +2

    What's new in keras-tuner ? Earlier also it was possible by using scikit wrapper class for the keras model and then perforrming gridsearch or random_search for finding the best parameters.

    • @nikhildixit5167
      @nikhildixit5167 2 роки тому +1

      Kerastuner gives you flexibility to tune the number of layers as well. Apart from randomsearch there are tuners in keras which can use bayesian approach to narrow down the parameter search space.

  • @louerleseigneur4532
    @louerleseigneur4532 3 роки тому

    Thanks Krish

  • @JaiSreeRam466
    @JaiSreeRam466 4 роки тому +1

    thanks alot sir

  • @enquiryadmin8326
    @enquiryadmin8326 4 роки тому

    hi, i wanted to ask can we use pretrained models for facial emotion classification problem?

  • @raghubetageri5378
    @raghubetageri5378 4 роки тому +1

    make a video for creating our own dataset and classification......which wil be very helpful

  • @avb9697
    @avb9697 Рік тому

    hello sir ! can we apply this method for CNNS that deal with Image Classification as well? by images I mean set of JPg images which are directly used as Input Training data?

  • @bhupendrapal9176
    @bhupendrapal9176 4 роки тому +1

    I am getting beow error while executing this code. Please help me to figure this out.
    Objective value missing in metrics reported to the Oracle, expected: ['val_accuracy'], found: dict_keys(['loss', 'acc', 'val_loss', 'val_acc'])

  • @programerahmed4470
    @programerahmed4470 Рік тому

    Great video: How can I force Keras Tuner to use default hyperparameter values for the first optimization iteration

  • @faisalshehzad9504
    @faisalshehzad9504 3 роки тому

    sir, can we use CNN rather then images datasets like software defect prediction dataset of NASA repository

  • @AdarshMahabubnagar
    @AdarshMahabubnagar 3 роки тому +1

    Hi, very good explanation. but i found that the model is overfitted as the percentage of training loss and validation loss is more. kindly explain

  • @akashchatterjee5409
    @akashchatterjee5409 3 роки тому +1

    Sir can you plz tell how to reshape train set & test set if the datasets are RGB images becoz that reshape thing is not working even after giving reshape(len(img_train),50,50,3).Here 50x50 is my pixel size

  • @Abhishekpandey-dl7me
    @Abhishekpandey-dl7me 4 роки тому +13

    can you plz make a video on Adam optimizer as you have made for gradient descent, coz we r unable to understand how this adam works

    • @jermainereece1881
      @jermainereece1881 3 роки тому

      A tip : watch series on instaflixxer. Been using them for watching all kinds of movies lately.

    • @emilioreign6391
      @emilioreign6391 3 роки тому

      @Jermaine Reece yea, have been watching on InstaFlixxer for years myself :)

  • @sudeepnellur
    @sudeepnellur 4 роки тому

    thank you sir

  • @siddheshmirjankar910
    @siddheshmirjankar910 2 місяці тому

    Hi Krish! Do you have a video explaining how one can use the Keras tuner with a pre-trained model? I am currently working on a drug classification project using MobileNet. I am not able to go above a test accuracy of 85%. Also, when I try to predict an image that is input by the user, the prediction is incorrect a lot of the times. Hence, I was wondering if I can use the keras tuner to fine tune the MobileNet to get a better accuracy. Is it possible?

  • @eranfeit
    @eranfeit Рік тому

    Great video , Why did you skip the Max pooling layer ?

  • @surehdau672
    @surehdau672 3 роки тому

    Sir in kernal do we have predefined dataset for face detection like fashion_mnist dataset ?

  • @michaelvm2404
    @michaelvm2404 4 місяці тому

    Keras and Tensorflow: two tools with some of the highest numbers of installation issues that you can get.

  • @user-cc3eu4ng7f
    @user-cc3eu4ng7f Рік тому +1

    Hi,so i build a model for 1 dim cnn regression problem using keras and i did the preprocessing and reshape the data and so on, the thing is the loss for train and valid very big about number with 9 digits for both of them and the model shows accurcy equal to 1 from the first epoch .so what can i do to solve it i tried to use keras tunner but there is no difference ,any help please

  • @prasantas2195
    @prasantas2195 4 роки тому

    Hey Krish, didn't find the code in the description (as you mentioned in the video tutorial).

  • @zartashiamehak562
    @zartashiamehak562 2 роки тому

    Sir kindly guide me, can we use this code to perform binary classification on text dataset?

  • @mukund198526
    @mukund198526 3 роки тому

    Hi Krish - when i tried to follow you and gave -
    tuner_search=RandomSearch(build_model,objective='val_accuracy',max_trials=5,directory='output',project_name="Mnist Fashion")
    so seems for me it is giving error like -
    Traceback (most recent call last):
    File "/usr/local/lib/python3.7/dist-packages/kerastuner/engine/hypermodel.py", line 104, in build
    model = self.hypermodel.build(hp)
    File "", line 7, in build_model
    input_shape=(28,28,1)
    TypeError: __init__() missing 1 required positional argument: 'filters'
    is there any changes

  • @ryuk9204
    @ryuk9204 4 роки тому

    Great tutorial, Can you update the code where "no. of epoch, choice of optimizers, batch size " as a hyperparameter for keras tuner. Thanks in advance.

  • @bilalayubi419
    @bilalayubi419 4 роки тому +1

    Dear sir i am confusing how i will give input image and how get output.

  • @kavitabhosale2397
    @kavitabhosale2397 3 роки тому

    please can you tell me? ...what happen if we decrease number of filters in CNN like 64 ,32 ,16? because generally we increase number of filters in cnn

  • @rakshiths3220
    @rakshiths3220 3 роки тому +1

    how do you use maxpooling in it?

  • @rahulpalivela1449
    @rahulpalivela1449 7 місяців тому

    at the last line of code when you used model = tuner_search.get_best_models(numb_models=1)[0]
    and got the best params with epoch = 3 , how can you use these params and then use it to test your model , and you didnt mention in the video how to test the model.

  • @surajpatil4815
    @surajpatil4815 2 роки тому

    I HAVE QUESTION ON TEST ACCURACY OF FIGSHARE DATASET of brain tumor classification. My model train accuracy and validation accuracy is above 90 but for test sample the accuracy is not so good. It is showing lot of miss classification . Data augmentation has been done but no improvement

  • @ammaraikram7291
    @ammaraikram7291 3 роки тому +1

    run time error to many failed attempts to build model if anyone knows, please answer

  • @arjunpukale3310
    @arjunpukale3310 4 роки тому +2

    Sir please make video using keras tuner for cat dog classifier

  • @thevivekmathema
    @thevivekmathema 4 роки тому

    hello, can you show thsi using custom jpgs image folder and data (e.g ./Train (./cat ../dog ../panda ) ) & Test (.simlar)

  • @harshvivek14
    @harshvivek14 4 роки тому +1

    Why reshaping is required?

  • @ramaswamikv
    @ramaswamikv 2 роки тому

    after model gets trained, there is no test? lines of code missing at end in Colab Code?

  • @kanhasinghal8053
    @kanhasinghal8053 3 роки тому

    In line 11 I get error..tuner_search =RandomSearch(build_model,objective='val_accuracy' max_trails) in this line..error flatten is not defined..please help me

  • @aashishyasinha8078
    @aashishyasinha8078 4 роки тому +1

    Sir what is mobile net and vgn architecture ??

  • @abhishekpurohit3442
    @abhishekpurohit3442 3 роки тому +1

    Sir, why are we adding dense layers after adding the Convolution layers? You didn't explain this in the lectures..

    • @pran6663
      @pran6663 3 роки тому +1

      the final dense layer is to classify the object

  • @shivanisood1562
    @shivanisood1562 4 роки тому +1

    how to predict the hyperparameters for own dataset

  • @rhiteshkumarsingh4401
    @rhiteshkumarsingh4401 3 роки тому

    i am facing an error "INFO:tensorflow:Oracle triggered exit" after running tuner_search.search. Pls help how to resolve this error.

  • @anaghadeshpande4873
    @anaghadeshpande4873 3 роки тому

    Is this technique works for video data set or 3D CNN?

  • @mohinitambade2477
    @mohinitambade2477 4 роки тому

    InvalidArgumentError: Incompatible shapes: [32,1] vs. [32,22,22] error is shown at line tuner_search.search(train_images,train_labels,epochs=3, validation_split = 0.1)

  • @chaitanyaravi4482
    @chaitanyaravi4482 3 роки тому

    Hi krish
    how to reslove this error
    TypeError: __init__() missing 1 required positional argument: 'kernel_size'
    in googlecolab

  • @priyeshgautam668
    @priyeshgautam668 3 роки тому

    Can we use this for CNN pretrained models ?

  • @rakeshsahoo7316
    @rakeshsahoo7316 Рік тому

    Sir, how to adjust the parameters of CNN... like no. of convolution layer.. Pooling layer... Fully connected layer

  • @dipanwitamallick8793
    @dipanwitamallick8793 4 роки тому +3

    the validation accuracy is less than training accuracy ......so it is clearly overfitting ...any suggestions for that ????
    great video :)

    • @saicharan8376
      @saicharan8376 3 роки тому

      if u found the answer could you please post it mam

    • @SAINIVEDH
      @SAINIVEDH 3 роки тому +1

      It's normal that val acc. < train acc. But if you want to improve it try Dropout, Bagging, Early Stopping, Regularization etc.. (techniques to reduce variance of the model)

  • @enquiryadmin8326
    @enquiryadmin8326 4 роки тому

    hi, can we use pretrained models for image classification problem?

  • @manikosuru5712
    @manikosuru5712 4 роки тому +1

    Hi sir
    It's really amazing video..
    Can u perform CNN on own data like cats/dogs in google colab like how to read our data to perform simple CNN classification model.Can u pls...

    • @vasusharma1773
      @vasusharma1773 4 роки тому +1

      Yes, there is a video on this channel only which shows the step by step procedure of loading the data for cnn in google colab

  • @premranjan4440
    @premranjan4440 2 роки тому

    while training in your system it is showing out of 54000 but in mine, it is showing 1688! Why?

  • @skmusic_2022
    @skmusic_2022 4 роки тому

    I came across a term called pilot code. Can you tell me what is a AI pilot code?

  • @yashmistry61
    @yashmistry61 3 роки тому

    what is step size in hp.Int()?? How does it affect?

  • @forever-fz1hk
    @forever-fz1hk 4 роки тому

    sir just one question how to decide the output nodes in dense layer..you have taken 10 but how to decide that...or how you came with 10..please answer sir

    • @vimalshrivastava6586
      @vimalshrivastava6586 4 роки тому +2

      The output node is equal to the number of classes present in dataset.

  • @user-wl6km8vr9d
    @user-wl6km8vr9d Рік тому

    sir will you please upload video about GANs

  • @rohithvarma2454
    @rohithvarma2454 3 роки тому

    What about the pooling layer??

  • @gamerdog5585
    @gamerdog5585 9 місяців тому

    Hi can you do the project aqi prediction based on image based deep learning algorithm

  • @tirthadatta2072
    @tirthadatta2072 Рік тому

    Can anyone tell me is there any function for maintaining imbalance data in tensorflow?

  • @devloper_hs
    @devloper_hs 3 роки тому

    Awsome Library , But How To Use It For Dropout layer?

  • @syedzoofa8711
    @syedzoofa8711 2 роки тому

    It's showing me the error build_model not defined??

  • @AyushGupta-kp9xf
    @AyushGupta-kp9xf 4 роки тому +2

    Please explain the reshaping part, I didn't get that

    • @ashithjake2778
      @ashithjake2778 3 роки тому +3

      Reshape input images to following - [batch size , height, width, channel]. For greyscale images channel=1

  • @yerriswamyv1910
    @yerriswamyv1910 4 роки тому

    aren't filter and kernal same ? if same, why we are giving two separate names conv_1_filter and conv_1_kernal ?

    • @KapilSharma-co8xq
      @KapilSharma-co8xq 4 роки тому

      Filter means no. Of filters
      And kernel means size of filter

  • @pallabidas3064
    @pallabidas3064 4 роки тому

    can anyone tell me how to save this final output?

  • @AdityaYadav-pn7yb
    @AdityaYadav-pn7yb 3 роки тому

    @krish I'm getting RuntimeEroor:-Too many failed attempts to build model and TypeError: __init__() missing 1 required positional argument: 'fiters"

  • @ramsiromanidixit7322
    @ramsiromanidixit7322 3 роки тому

    How to use keras-tuner in functional api model ??

  • @spicytuna08
    @spicytuna08 2 роки тому

    can you create several env in colab?

  • @smurtiranjansahu5657
    @smurtiranjansahu5657 4 роки тому

    Sir pls make a project video of RNN using karas

  • @paraslaul3307
    @paraslaul3307 4 роки тому

    how to predict images based on labels

  • @yerriswamyv1910
    @yerriswamyv1910 4 роки тому

    How to check the accuracy on test data ? here it's multi class data.

  • @sandipansarkar9211
    @sandipansarkar9211 4 роки тому +1

    Great video but no value if we do not practice.Thanks

  • @vikasrajput1957
    @vikasrajput1957 3 роки тому

    why didnt you use pooling here?

  • @lakshit-khanna
    @lakshit-khanna 3 роки тому

    Hi sir can you please make a video on what is the right mindset a person should have before he starts building something with deep learning. I was a Django developer till now following your videos to enter in this domain. thank you sir

  • @tirthadatta7368
    @tirthadatta7368 2 роки тому

    Sir, when I run this code in Colab,
    tuner_search = RandomSearch(build_model,
    objective='val_accuracy',
    max_trials=5, executions_per_trial=3, directory='output', project_name="Mnist Fashion")
    I have got this error given below:
    RuntimeError: Too many failed attempts to build model.
    Can anyone help how to solve it??

  • @pec8377
    @pec8377 10 місяців тому

    I love your videos, and I realized something, your epochs are running damn fast.. So I looked at my code, and copied the same model.. 4 minutes on a Titan.. mmm ..After hours of searching for the cause, I discovered it was coming from the ImageDataGenerator that is slow as hell !
    If I don't use a flow from dataframe.. hard to get an epoch of more than 30s. If I put a simple shear, or any transformation in an ImageDatagenerator: 4minutes !
    But then how can I do transfer learning, like VGG16 that has a preprocess function (so my epochs are of 4minutes !) If I remove the preprocess ? few secs per epoch

  • @prachigopalani5399
    @prachigopalani5399 3 роки тому

    Plzz show how to run flask on Google colab

  • @joe8ones
    @joe8ones 4 роки тому +1

    i followed the exact sane steps, but my output is 0.09

  • @mamtagupta4-yearb.tech.mec203
    @mamtagupta4-yearb.tech.mec203 2 роки тому

    How to solve this error?
    ValueError: attempt to get argmin of an empty sequence

  • @kryptoskaggle7031
    @kryptoskaggle7031 4 роки тому +1

    what is that "step=16" in each conv2d??

    • @aarohibychithrasona4004
      @aarohibychithrasona4004 4 роки тому

      i also have the same doubt

    • @vinitgalgali8856
      @vinitgalgali8856 4 роки тому

      @@aarohibychithrasona4004 It is the step size, means 32,(32+16=48),(48+16=64)....upto 128 (max)

  • @sayantansinha4545
    @sayantansinha4545 4 роки тому

    Why did we reshape the image arrays at 9:26 ??

    • @rustombhesania7265
      @rustombhesania7265 4 роки тому

      It needs to be (nxnx1) that's y it's how cnn takes input

  • @tanvishinde805
    @tanvishinde805 3 роки тому

    waiting for adam optimizer video

  • @unscript09
    @unscript09 2 роки тому

    Sir please make a simple cnn video without using any tuners, its confusing

  • @tanvishinde805
    @tanvishinde805 3 роки тому

    what is flatten layer?

    • @tanvishinde805
      @tanvishinde805 3 роки тому

      From 24:48 I think it just flattens the multi-dimension input into single dimension

  • @carlosfotsing6779
    @carlosfotsing6779 4 роки тому

    sir can you kindly upload the code of this tutorial?. it was so interesting

  • @sup0ds
    @sup0ds 3 роки тому +4

    The validation loss 0.5 and the training loss is about 0.02, which means the model is performing very on the training data but it performs horribly on the validation data. So indirectly the training accuracy won't matter even if it is greater than 95%, the model will be predicting wrong. Requires a lot of hyperparameter tuning. But I won't complain coz u only ran for 5 epochs.

  • @saimaheshparuchuri9826
    @saimaheshparuchuri9826 2 роки тому

    Why don't you teach in pytorch sir???

  • @babaabba9348
    @babaabba9348 3 роки тому

    you should have used early stopping, obviously your model is overfitting