General questions about DLS course 1 week 4

Hi, Zohreh.

Good questions! There is a lot that could be said on question 1), but I’ll try to give some answers:

  1. This is a big question that is really beyond the scope of this course. Methods of finding data and “cleaning” or preparing it to be useful for training DL systems falls under the heading of “Data Science” and there is another specialization called Practical Data Science from DeepLearning.Ai that covers this area. Generally speaking you need to gather an “adequate amount” of labeled data that covers the types of inputs you want your system to handle. What size will be adequate in a given case is not so easy to know: you basically have to try and see. This type of issue (how much data and how much variety you need) will be discussed in more detail as we go through Courses 2 and 3 in this series.

If the question is more practical, e.g. you already have a bunch of images and want to package them in the same way that they are packaged for our networks here, that is an easier question but one that is also beyond the scope of this course. You can find the load_dataset routines in each assignment by clicking “File → Open” and then finding the appropriate python file which contains the utility routines. You’ll find that they are packaged as “h5” files, which is a popular database format. Here’s a thread in which a fellow student has given an example of how to create an h5 file containing images. Try googling “create h5 file python” for more information.

  1. We don’t need the concept of a cross validation set until we get to the topic of choosing/tuning hyperparameters. That will be covered in Course 2 of this series, so stay tuned for that. Here they are just keeping things simpler. This is the first course in the series and they just want to concentrate on the basics of the networks.

  2. You just have to look at the logic and see what’s going on. squeeze removes trivial dimensions from an object, so whether you do that or not just depends on what you need in the next step. The “copy()” question is more important and also a bit more subtle: it has to do with python semantics. It’s important to understand that when you pass an object as a parameter to a function in python, it is passed “by reference” and not “by value”. That means that if you then modify that object down in the function, you have modified “global data”. In most cases, you do not want that as a side effect. You want your functions to be “local” (self-contained) in their effects. So the way you get around that is do to a “copy” from the passed object down in the function, with the express purpose of breaking that connection to the global object. Here’s a thread which discusses that in more detail. And be sure to read this other post later on that thread. It’s not just procedure calls in which you have to be careful about object semantics in python. :scream_cat: