Getting wrong output

@SaiManoj_Y Hmm, are you passing the tests before this ?


DLS Course 1 Week 4 has two assignments. Which one are you asking about?

Please give the name of the assignment or the notebook title.

Deep Neural Network - Application

@Tmosh I brought it up, he must be looking at the ‘application’ exercise I think, but obviously he is getting too many returns. I can’t think why that would be…

if you need any information ?

@SaiManoj_Y – tail end of the L_layer_model function, you only have this, correct ?

return parameters, costs

i will share


only parameters

@SaiManoj_Y Ohh… well you need both. But that is code we didn’t need to touch… Try replacing it with that line and see if it works.

The “return” statement is outside of the area you are supposed to modify.

File “”, line 35
return parameters, cost
SyntaxError: ‘return’ outside function

Perhaps you have incorrect indentation.

1 Like

@SaiManoj_Y … of course it still needs to be ‘in’ your function… Check your indenting towards the top header definition (?)

tell me where i need to change the code

# mentor edit: code removed

@TMosh going to let you handle this.

1 Like

@SaiManoj_Y from my perspective this mostly looks correct. But at least the notebook I worked with doesn’t have the plot code, so I am not sure where that came from…

can you give the correct code to run

1 Like

Please do not post your code on the forum. That’s not allowed by the Code of Conduct.

I recommend you save your notebook (use the File menu to rename it), then use the “Help” tool (the question mark inside a circle, in the upper right corner of the browser) and “Get latest version”.

Then use the File menu to open the new copy of the notebook.

You’ll also need to restart the kernel (“Cell → Restart kernel & clear output”).

Then you can start over, using your old file as a reference.