Notes, programming assignments and quizzes from all courses within the Coursera Deep Learning specialization offered by deeplearning.ai

Overview

Deep Learning Specialization on Coursera (offered by deeplearning.ai)

Programming assignments and quizzes from all courses in the Coursera Deep Learning specialization offered by deeplearning.ai.

Instructor: Andrew Ng

Notes

For detailed interview-ready notes on all courses in the Coursera Deep Learning specialization, refer www.aman.ai.

Setup

Run setup.sh to (i) download a pre-trained VGG-19 dataset and (ii) extract the zip'd pre-trained models and datasets that are needed for all the assignments.

Credits

This repo contains my work for this specialization. The code base, quiz questions and diagrams are taken from the Deep Learning Specialization on Coursera, unless specified otherwise.

2021 Version

This specialization was updated in April 2021 to include developments in deep learning and programming frameworks, with the biggest change being shifting from TensorFlow 1 to TensorFlow 2. This repo has been updated accordingly as well.

Programming Assignments

Course 1: Neural Networks and Deep Learning

Course 2: Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization

Course 3: Structuring Machine Learning Projects

  • There are no programming assignments for this course. But this course comes with very interesting case study quizzes (below).

Course 4: Convolutional Neural Networks

Course 5: Sequence Models

Quiz Solutions

Course 1: Neural Networks and Deep Learning

  • Week 1 Quiz - Introduction to deep learning: Text | PDF
  • Week 2 Quiz - Neural Network Basics: Text | PDF
  • Week 3 Quiz - Shallow Neural Networks: Text | PDF
  • Week 4 Quiz - Key concepts on Deep Neural Networks: Text | PDF

Course 2: Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization

  • Week 1 Quiz - Practical aspects of deep learning: Text | PDF
  • Week 2 Quiz - Optimization algorithms: Text | PDF
  • Week 3 Quiz - Hyperparameter tuning, Batch Normalization, Programming Frameworks: Text | PDF

Course 3: Structuring Machine Learning Projects

  • Week 1 Quiz - Bird recognition in the city of Peacetopia (case study): Text | PDF
  • Week 2 Quiz - Autonomous driving (case study): Text | PDF

Course 4: Convolutional Neural Networks

  • Week 1 Quiz - The basics of ConvNets: Text | PDF
  • Week 2 Quiz - Deep convolutional models: Text | PDF
  • Week 3 Quiz - Detection algorithms: Text | PDF
  • Week 4 Quiz - Special applications: Face recognition & Neural style transfer: Text | PDF

Course 5: Sequence Models

  • Week 1 Quiz - Recurrent Neural Networks: Text | PDF
  • Week 2 Quiz - Natural Language Processing & Word Embeddings: PDF
  • Week 3 Quiz - Sequence models & Attention mechanism: Text | PDF

Disclaimer

I recognize the time people spend on building intuition, understanding new concepts and debugging assignments. The solutions uploaded here are only for reference. They are meant to unblock you if you get stuck somewhere. Please do not copy any part of the code as-is (the programming assignments are fairly easy if you read the instructions carefully). Similarly, try out the quizzes yourself before you refer to the quiz solutions. This course is the most straight-forward deep learning course I have ever taken, with fabulous course content and structure. It's a treasure by the deeplearning.ai team.

Comments
  • not opening datasets

    not opening datasets

    Actually , i have lost my subscription from coursera so i m not able to access this course.All the .h5 files u have uploaded is not working and giving the error "OSError: Unable to open file (file signature not found)".U can check this here "https://stackoverflow.com/questions/38089950/error-opening-file-in-h5py-file-signature-not-found". If u may uplaod the correct files ,it will be really helpful. Thanks in advance

    opened by adeshs95 5
  • setup.sh not working

    setup.sh not working

    Hi,

    I cloned the repository on my system. I set permissions to execute setup.sh file. On running setup.sh, I am getting following error -

    Archive:  ./C5 - Sequence Models/Week 2/Word Vector Representation/data/glove.6B.50d.txt.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C5 - Sequence Models/Week 2/Word Vector Representation/data/glove.6B.50d.txt.zip or
            ./C5 - Sequence Models/Week 2/Word Vector Representation/data/glove.6B.50d.txt.zip.zip, and cannot find ./C5 - Sequence Models/Week 2/Word Vector Representation/data/glove.6B.50d.txt.zip.ZIP, period.
    
    Archive:  ./C5 - Sequence Models/Week 2/Emojify/data/glove.6B.50d.txt.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C5 - Sequence Models/Week 2/Emojify/data/glove.6B.50d.txt.zip or
            ./C5 - Sequence Models/Week 2/Emojify/data/glove.6B.50d.txt.zip.zip, and cannot find ./C5 - Sequence Models/Week 2/Emojify/data/glove.6B.50d.txt.zip.ZIP, period.
    
    Archive:  ./C5 - Sequence Models/Week 3/Trigger word detection/XY_dev/X_dev.npy.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C5 - Sequence Models/Week 3/Trigger word detection/XY_dev/X_dev.npy.zip or
            ./C5 - Sequence Models/Week 3/Trigger word detection/XY_dev/X_dev.npy.zip.zip, and cannot find ./C5 - Sequence Models/Week 3/Trigger word detection/XY_dev/X_dev.npy.zip.ZIP, period.
    
    Archive:  ./C5 - Sequence Models/Week 3/Trigger word detection/models/tr_model.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C5 - Sequence Models/Week 3/Trigger word detection/models/tr_model.h5.zip or
            ./C5 - Sequence Models/Week 3/Trigger word detection/models/tr_model.h5.zip.zip, and cannot find ./C5 - Sequence Models/Week 3/Trigger word detection/models/tr_model.h5.zip.ZIP, period.
    
    Archive:  ./C5 - Sequence Models/Week 3/Trigger word detection/XY_train/X.npy.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C5 - Sequence Models/Week 3/Trigger word detection/XY_train/X.npy.zip or
            ./C5 - Sequence Models/Week 3/Trigger word detection/XY_train/X.npy.zip.zip, and cannot find ./C5 - Sequence Models/Week 3/Trigger word detection/XY_train/X.npy.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 2/ResNets/datasets/train_signs.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 2/ResNets/datasets/train_signs.h5.zip or
            ./C4 - Convolutional Neural Networks/Week 2/ResNets/datasets/train_signs.h5.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 2/ResNets/datasets/train_signs.h5.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 2/ResNets/ResNet50.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 2/ResNets/ResNet50.h5.zip or
            ./C4 - Convolutional Neural Networks/Week 2/ResNets/ResNet50.h5.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 2/ResNets/ResNet50.h5.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 2/KerasTutorial/datasets/train_happy.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 2/KerasTutorial/datasets/train_happy.h5.zip or
            ./C4 - Convolutional Neural Networks/Week 2/KerasTutorial/datasets/train_happy.h5.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 2/KerasTutorial/datasets/train_happy.h5.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 3/Car detection for Autonomous Driving/model_data/yolo.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 3/Car detection for Autonomous Driving/model_data/yolo.h5.zip or
            ./C4 - Convolutional Neural Networks/Week 3/Car detection for Autonomous Driving/model_data/yolo.h5.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 3/Car detection for Autonomous Driving/model_data/yolo.h5.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/nn4.small2.v7.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/nn4.small2.v7.h5.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/nn4.small2.v7.h5.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/nn4.small2.v7.h5.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5a_3x3_conv2_w.csv.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5a_3x3_conv2_w.csv.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5a_3x3_conv2_w.csv.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5a_3x3_conv2_w.csv.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4a_1x1_conv_w.csv.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4a_1x1_conv_w.csv.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4a_1x1_conv_w.csv.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4a_1x1_conv_w.csv.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4e_3x3_conv2_w.csv.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4e_3x3_conv2_w.csv.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4e_3x3_conv2_w.csv.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4e_3x3_conv2_w.csv.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5b_3x3_conv2_w.csv.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5b_3x3_conv2_w.csv.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5b_3x3_conv2_w.csv.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5b_3x3_conv2_w.csv.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4a_3x3_conv2_w.csv.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4a_3x3_conv2_w.csv.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4a_3x3_conv2_w.csv.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4a_3x3_conv2_w.csv.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5a_1x1_conv_w.csv.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5a_1x1_conv_w.csv.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5a_1x1_conv_w.csv.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5a_1x1_conv_w.csv.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_3c_3x3_conv2_w.csv.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_3c_3x3_conv2_w.csv.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_3c_3x3_conv2_w.csv.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_3c_3x3_conv2_w.csv.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4e_5x5_conv2_w.csv.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4e_5x5_conv2_w.csv.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4e_5x5_conv2_w.csv.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_4e_5x5_conv2_w.csv.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5b_1x1_conv_w.csv.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5b_1x1_conv_w.csv.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5b_1x1_conv_w.csv.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/weights/inception_5b_1x1_conv_w.csv.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/train_face.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/train_face.h5.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/train_face.h5.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/train_face.h5.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/test_happy.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/test_happy.h5.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/test_happy.h5.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/test_happy.h5.zip.ZIP, period.
    
    Archive:  ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/train_happy.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/train_happy.h5.zip or
            ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/train_happy.h5.zip.zip, and cannot find ./C4 - Convolutional Neural Networks/Week 4/Face Recognition/datasets/train_happy.h5.zip.ZIP, period.
    
    Archive:  ./C2 - Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/Week 3/datasets/train_signs.h5.zip
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    unzip:  cannot find zipfile directory in one of ./C2 - Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/Week 3/datasets/train_signs.h5.zip or
            ./C2 - Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/Week 3/datasets/train_signs.h5.zip.zip, and cannot find ./C2 - Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/Week 3/datasets/train_signs.h5.zip.ZIP, period.
    
    ./setup.sh: line 8: ./C4 - Convolutional Neural Networks/Week 4/Neural Style Transfer/pretrained-model/imagenet-vgg-verydeep-19.mat: No such file or directory
    

    On running file command with one of the zip files I get following -

    file glove.6B.50d.txt.zip glove.6B.50d.txt.zip: ASCII text With 7z command I get following -

    7z e glove.6B.50d.txt.zip

    7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
    p7zip Version 16.02 
    Scanning the drive for archives:
    1 file, 133 bytes (1 KiB)
    
    Extracting archive: glove.6B.50d.txt.zip
    ERROR: glove.6B.50d.txt.zip
    glove.6B.50d.txt.zip
    Open ERROR: Can not open the file as [zip] archive
    
    ERRORS:
    Is not archive
    
    Can't open as archive: 1
    Files: 0
    Size:       0
    Compressed: 0
    
    

    Can you provide the correct zip files?

    opened by iamsoze 3
  • Cat vs non cat dataset

    Cat vs non cat dataset

    There is a problem in loading cat vs non cat dataset. Its giving "OSError: Unable to open file (file signature not found)" while loading dataset. I think , the dataset is not upoaded properly.May u plz look into it.

    opened by adeshs95 3
  • C2 - Week 1 - PA 2 - Regularization - data.mat

    C2 - Week 1 - PA 2 - Regularization - data.mat

    I cannot manage to download the dataset data.mat for C2 - PA2. This is the link to the file in this GitHub: https://github.com/amanchadha/coursera-deep-learning-specialization/blob/6ebc4d60a90c1592aee3eaa3113eb4b37d9b4b19/C2%20-%20Improving%20Deep%20Neural%20Networks%20Hyperparameter%20tuning,%20Regularization%20and%20Optimization/Week%201/Regularization/datasets/data.mat Can anybody share a download link to a file, e.g., via OneDrive, Google Drive, or any other similar service?

    Much appreciated!

    opened by BJBijvoet 2
  • Updated solution for exercise 2

    Updated solution for exercise 2

    A trick when you want to flatten a matrix X of shape (a,b,c,d) to a matrix X_flatten of shape (b$$c$$d, a) is to use:

    X_flatten = X.reshape(X.shape[0], -1).T      # X.T is the transpose of X
    
    opened by jansenicus 1
  • Some of the weight files (csv) are zipped

    Some of the weight files (csv) are zipped

    Hi Aman,

    Thanks for uploading this repo. In Course 4, week 4 assignment, some of the weight files of FaceNet has not been unzipped properly. While cloning and running the code its throwing error. Please check and update.

    Thanks

    opened by SKrishna93 1
  • C1 - Week 3 - PA 3 - Planar data classification with one hidden layer

    C1 - Week 3 - PA 3 - Planar data classification with one hidden layer

    The function "plot_decision_boundary(model, X, y)" does not work to plot the decision boundaries according to the trained neural network due to incorrect shapes. If you want to plot the decision boundaries for "4.5 Predictions" and "4.6 - Tuning hidden layer size (optional/ungraded exercise)", use the following function instead (place within the same .py file as your function "predict(parameters, X)", otherwise you'll need to import the functions):

    def plot_decision_boundary_nn(parameters, X, Y):
        # Set min and max values and give it some padding
        x_min, x_max = X[0, :].min() - 1, X[0, :].max() + 1
        y_min, y_max = X[1, :].min() - 1, X[1, :].max() + 1
        h = 0.01
        # Generate a grid of points with distance h between them
        xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))
        grid_points = np.c_[xx.ravel(), yy.ravel()].T
        # Predict the function value for the whole grid
        Z = predict(parameters, grid_points)
        Z = Z.reshape(xx.shape)
        # Plot the contour and training examples
        plt.contourf(xx, yy, Z, cmap=plt.cm.Spectral)
        plt.ylabel('x2')
        plt.xlabel('x1')
        plt.scatter(X[0, :], X[1, :], c=Y, cmap=plt.cm.Spectral)
    

    Figure

    opened by BJBijvoet 0
  • Error debbuging C4-Week2-Assignment1

    Error debbuging C4-Week2-Assignment1

    Hello In course 4 (ConvNets), Week2, Assignment 1 (ResNets) , section 3.2 (The convolutional block), I did the implementation myself and got an error. When I looked at this solution, I find it exactly the same as mine but gives the same error:

    I am getting the following error in the function "convolutional block":


    AssertionError Traceback (most recent call last) Input In [13], in <cell line: 14>() 12 assert type(A) == EagerTensor, "Use only tensorflow and keras functions" 13 assert tuple(tf.shape(A).numpy()) == (3, 2, 2, 6), "Wrong shape." ---> 14 assert np.allclose(A.numpy(), convolutional_block_output1), "Wrong values when training=False." 15 print(A[0]) 17 B = convolutional_block(X, f = 2, filters = [2, 4, 6], training=True)

    AssertionError: Wrong values when training=False.


    Can you please advise?

    Thanks,

    Boris M.

    opened by BorisMartinez-AI 0
  • Problem downloading h5 files on course 2 week 3

    Problem downloading h5 files on course 2 week 3

    Hi!

    First of all, thanks for all the content, It's helping me a lot.

    I'm a newbie on GitHub, so maybe It's my mistake. I've clone the entire repository and then I tried to use the following command to get de h5 file:

    • git lfs pull

    But I'm getting the next error message: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access. Failed to fetch some objects from 'https://github.com/amanchadha/coursera-deep-learning-specialization.git/info/lfs'

    I would appreciate any help.

    Thanks on advice !!

    PD. I found here how to proceed: https://stackoverflow.com/questions/58078170/github-how-to-download-hdf5-file

    opened by bsotelo22 1
  • This Solution isn't upto date

    This Solution isn't upto date

    This Solution isn't upto date as i looked up into the matter, the updated version requires more packages to be initiated

    import numpy as np import copy import matplotlib.pyplot as plt import h5py import scipy from PIL import Image from scipy import ndimage from lr_utils import load_dataset from public_tests import *

    %matplotlib inline %load_ext autoreload %autoreload 2

    and so with this we will have different solution

    opened by praveen-mishra-22 1
  • Course1 - Week 2 - PA 2 - Logistic Regression with a Neural Network mindset

    Course1 - Week 2 - PA 2 - Logistic Regression with a Neural Network mindset

    In part 2 where we try to reshape the training and test examples, i.e. to flatten matrix "train_set_x_orig" and "test_set_x_orig".

    In this note, the author uses "train_set_x_flatten = train_set_x_orig.reshape(train_set_x_orig.shape[1]*train_set_x_orig.shape[2]*train_set_x_orig.shape[3],train_set_x_orig.shape[0])", which fails in making every colum as a training example and a wrong result of train accuracy and test accuracy.

    I think "train_set_x_flatten = train_set_x_orig.reshape(train_set_x_orig.shape[0], -1).T" would be better.

    please feel free to discuss this:)

    opened by nucleosome 2
  • C2-W2 Optimization_methods task update_parameters_with_adam needs updatation

    C2-W2 Optimization_methods task update_parameters_with_adam needs updatation

    The older function used to return 3 variables parameters,v,s like

    return parameters,v,s
    

    At the end of the function but for now the tests got updated and now it wants to get 5 variables returned to test the function. So the function here also needs to be updated to reflect that.

    See the newer version of test it wants to unpack 5 values from the function in place of 3 as with the previous versions new_tests This is the older code in this repo that returned 3 variables only. I have included the older version of test also here that wanted to unpack 3 variables. image

    opened by opticSquid 0
Owner
Aman Chadha
Tinkerer @ . AI @ Stanford.
Aman Chadha
DeepLearning Anomalies Detection with Bluetooth Sensor Data

Final Year Project. Constructing models to create offline anomalies detection using Travel Time Data collected from Bluetooth sensors along the route.

null 1 Jan 10, 2022
PAWS 🐾 Predicting View-Assignments with Support Samples

This repo provides a PyTorch implementation of PAWS (predicting view assignments with support samples), as described in the paper Semi-Supervised Learning of Visual Features by Non-Parametrically Predicting View Assignments with Support Samples.

Facebook Research 437 Dec 23, 2022
A list of awesome PyTorch scholarship articles, guides, blogs, courses and other resources.

Awesome PyTorch Scholarship Resources A collection of awesome PyTorch and Python learning resources. Contributions are always welcome! Course Informat

Arnas Gečas 302 Dec 3, 2022
Annotated notes and summaries of the TensorFlow white paper, along with SVG figures and links to documentation

TensorFlow White Paper Notes Features Notes broken down section by section, as well as subsection by subsection Relevant links to documentation, resou

Sam Abrahams 437 Oct 9, 2022
Python/Rust implementations and notes from Proofs Arguments and Zero Knowledge

What is this? This is where I'll be collecting resources related to the Study Group on Dr. Justin Thaler's Proofs Arguments And Zero Knowledge Book. T

Thor 66 Jan 4, 2023
Use deep learning, genetic programming and other methods to predict stock and market movements

StockPredictions Use classic tricks, neural networks, deep learning, genetic programming and other methods to predict stock and market movements. Both

Linda MacPhee-Cobb 386 Jan 3, 2023
This repository is related to an Arabic tutorial, within the tutorial we discuss the common data structure and algorithms and their worst and best case for each, then implement the code using Python.

Data Structure and Algorithms with Python This repository is related to the Arabic tutorial here, within the tutorial we discuss the common data struc

Mohamed Ayman 33 Dec 2, 2022
This repository contains all the code and materials distributed in the 2021 Q-Programming Summer of Qode.

Q-Programming Summer of Qode This repository contains all the code and materials distributed in the Q-Programming Summer of Qode. If you want to creat

Sammarth Kumar 11 Jun 11, 2021
Repository for scripts and notebooks from the book: Programming PyTorch for Deep Learning

Repository for scripts and notebooks from the book: Programming PyTorch for Deep Learning

Ian Pointer 368 Dec 17, 2022
aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)

Bayesian Methods for Hackers Using Python and PyMC The Bayesian method is the natural approach to inference, yet it is hidden from readers behind chap

Cameron Davidson-Pilon 25.1k Jan 2, 2023
Notes taking website build with Docker + Django + React.

Notes website. Try it in browser! / But how to run? Description. This is monorepository with notes website. Website provides web interface for creatin

Kirill Zhosul 2 Jul 27, 2022
DeepProbLog is an extension of ProbLog that integrates Probabilistic Logic Programming with deep learning by introducing the neural predicate.

DeepProbLog DeepProbLog is an extension of ProbLog that integrates Probabilistic Logic Programming with deep learning by introducing the neural predic

KU Leuven Machine Learning Research Group 94 Dec 18, 2022
Implementation for our AAAI2021 paper (Entity Structure Within and Throughout: Modeling Mention Dependencies for Document-Level Relation Extraction).

SSAN Introduction This is the pytorch implementation of the SSAN model (see our AAAI2021 paper: Entity Structure Within and Throughout: Modeling Menti

benfeng 69 Nov 15, 2022
This application is the basic of automated online-class-joiner(for YıldızEdu) within the right time. Gets the ZOOM link by scheduled date and time.

This application is the basic of automated online-class-joiner(for YıldızEdu) within the right time. Gets the ZOOM link by scheduled date and time.

215355 1 Dec 16, 2021
[SIGIR22] Official PyTorch implementation for "CORE: Simple and Effective Session-based Recommendation within Consistent Representation Space".

CORE This is the official PyTorch implementation for the paper: Yupeng Hou, Binbin Hu, Zhiqiang Zhang, Wayne Xin Zhao. CORE: Simple and Effective Sess

RUCAIBox 26 Dec 19, 2022
Implementation of 'lightweight' GAN, proposed in ICLR 2021, in Pytorch. High resolution image generations that can be trained within a day or two

512x512 flowers after 12 hours of training, 1 gpu 256x256 flowers after 12 hours of training, 1 gpu Pizza 'Lightweight' GAN Implementation of 'lightwe

Phil Wang 1.5k Jan 2, 2023
Rayvens makes it possible for data scientists to access hundreds of data services within Ray with little effort.

Rayvens augments Ray with events. With Rayvens, Ray applications can subscribe to event streams, process and produce events. Rayvens leverages Apache

CodeFlare 32 Dec 25, 2022