I experienced the error below. Please note the code below that corrected the error. The correct formula was not shown or even alluded to in any of the course videos or notes. How on earth would a learner know to change the function as below. I only got the correct calculation from a utility file. It’s very, very frustrating to waste a huge amount of time debugging something that was not even covered in the course. Please correct me if I am wrong.
Note the commented line that caused the error and the correct line that was inserted.
A similar instance of the course content not matching the exercise test was in the cost function. The cost function in the tests that passed in the Step by Step exercise returned a float, but in the DNN Application exercise that threw a datatype error. The DNN Application required that an nparray containing a scaler was required. Who could anticipate that?
This causes wasted time that could be used for learning about Deep Learning AI which after all the purpose of the course. I believe these issues should be addressed. Please respond.
Hey @Michael_Lawrence,
I just used the commented line of code, and it works absolutely fine in my case. Can you tell me how to reproduce your error, so that I can understand what exactly is the issue, and if there would be an issue with the AutoGrader, I will be able to report it in that case.
Additionally, it is against the community guidelines to post the code publicly. If any of the mentors would need to see your code, or if you want to show your code to a mentor, you can DM the code to the mentor instead.
I thought this issue would get lost in the shuffle and not even be addressed. I have to say that the whole DeepLearning.ai teaching system continues to impress. Thanks for your response.
Sorry about posting the code. I am used to Stackoverflow.
Not sure what you mean by “DM” the code to a mentor. Can you explain a bit more fully how to do that?
In the meantime I will run the code again in the browser interface to see if I can reproduce the issues. I run all the code locally and then copy and paste to the browser. Obviously if the issues only occur locally then that is my problem.
If it turns out that the issues do reoccur in the browser shall I email you the screen shots?
Go to Elemento’s nametag and there a window will popup. You will find the message icon. And, you can send the file or the code directly to the concerned person.
The problem is that Michael has tried to hand copy over his functions from Step by Step into the second assignment in Week 4. That doesn’t work and they actually didn’t tell you to do that if you read the instructions carefully. They provided those functions for you in an imported file. My theory is that they did not want to call attention to the fact that they were providing “worked solutions” to the Step by Step exercise. Although as Michael discovered there are some changes that would not have passed the grader for Step by Step.
We did cover this the other day but I experienced another issue. I have between 15-20 hours wasted on debugging code that was never going to work and now documenting the issues. Please see the attached pdf.
Hey @Michael_Lawrence,
Let’s first of all refer to the comment in Exercise 1. It is asking you to simply use the implementations of the previously implemented functions in Assignment 1, which have already been imported for you in Assignment 2. You are not supposed to copy them in Assignment 2, as Paul Sir mentioned.
Just try to do this in Assignment 2, and then see, if you are getting any errors or not. Please don’t get hung upon the fact that the implementations of the same functions in Assignment 1 and Assignment 2 differs to a small extent. It is often done by the team to ensure that the auto-graders are as robust as possible.
If you still face any issues, feel free to let us know. Always happy to help.
This is not a new issue. It is simply another instance of the same issue we have discussed earlier. It was a mistake to import your functions from the Step by Step exercise. All you needed to do was fill in the code in the sections marked “START CODE HERE” to “END CODE HERE”. The correct functions were provided in the import file dnn_app_utils_v3.py and you did not need to do anything more than call them.
Agree 100% with what you are saying. However I thought that at least in theory, learners were not supposed to know that the answers were in the utility files.
If the utility files are supposed to be part of the course structure, how would one know that? In other works, where is that documented?
Hey @Michael_Lawrence,
I am starting to get a little bit confused as to what the issues you are exactly facing after following Paul Sir’s advice. Have you used the imported functions yet or not?
First let me say that I appreciate your time and that of the other mentors in addressing this issue. It seems that I have not expressed my concerns on behalf of myself and the other learners clearly.
I understand the source of your confusion. I am likewise confused. When you say “the imported functions” I assume you mean the functions in the file “dnn_app_utils_v3.py” or other DeepLearning.ai utility files. And yes I have used those functions and they work fine. Now that I am aware that these utility files exist and contain the working code for the exercises I will use them when necessary going forward. So what’s the problem?
As I mentioned to Paul in my latest email, I thought that, at least in theory, learners were not supposed to know that the answers to the coding exercises were in the utility files. If the utility files are supposed to be part of the course structure, how would one know that? In other words, where is that documented?
If the utility files are not part of the course structure then either the course content needs to be updated (which is hard), or the testing functions need to be updated (which is easy). Does that make sense?
It’s obvious to me from the outside looking in, that there is a disconnect between the people that design the course content and those creating the code. This is the typical workflow and totally understandable given the complexity of the site.
What is not understandable to me is the lack of coherence between the testing code and the course content, specifically the instructions. One of the two following scenarios should be true, which is currently not the case.
Either one or the other of the following precepts should be applied to the course structure.
The instructions should state that the users should refer to the utility files for the correct formulas and data types etc. Obviously this would include the answers to the coding exercises which may not be desirable.
The testing code should be changed where appropriate to match the formulas and data-types etc. that are presented in the course videos by Andrew Ng and the exercise instructions. In other words, test for what is taught in the course!
I don’t exactly understand the need of learners to refer to the utility files in the first place for the assignment. All the functions have been imported, and what all inputs to feed to a particular function have already been defined in the assignment itself. Additionally, these functions were implemented by the learners themselves in just the previous assignment, and if you will take a look at the code in the Utility files and the code written by you in the previous assignment, they will almost match, with most probably the exception of output types.
So, as long as you use these functions in the correct way, pass them the correct inputs, any learner can easily pass the assignment.
As for the exception of different output types in the implementations of some of the functions in the utility files, they are just made in accordance with the test cases and the grader, so that the test cases can cover a wider array of errors. Additionally, there is no single correct output type for any single function. A function’s output can be given in multiple different formats, so don’t you think it’s better to define the format of the outputs such that the test cases can be made more efficient, specially when the learner won’t have to be concerned about the output types in the first place?
Michael, I think we are just “talking past each other” here. You didn’t need to look at the utility files at all. All you had to do is call those functions (the same APIs that you already were familiar with from the previous exercise) with the correct inputs and everything would have worked: you would have passed the tests in the notebook and also the grader. End of story.
So, no, the utility functions are not really part of the course material and no-one needs to examine them. They are “support functions”. Can you learn something by reading them? Yes, in some cases, but nothing requires you to read them.
Please see the pdf posted in this thread. Michael_Heyd_DLS_DNN_Wk-4_App-2_errs.pdf.
This shows how to reproduce the error. I included screen shots of the errors. If you not experience the same errors then there is something else going on.
It’s hard to believe that the browser version or the operating system would have any impact on the calculations but I suppose it’s not impossible. Would could do screen sharing so you can verify my results first hand.