C2_W1_Assignment jax.numpy

Good evening everyone,

{mentor edit: notebook link removed}

I have converted the df into jax.numpy

np.array().astype(‘float32’).

Yet the grader returns 0% and i have this feedback:

There was a problem compiling the code from your notebook. Details:
Value ‘<function L_of_omega_array at 0x7fbad5ff1830>’ with dtype object is not a valid JAX array type. Only arrays of numeric types are supported by JAX.

I am at my wit end.

If someone has an idea…

Thanks in advance

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

  2. Direct links to your private notebook are not supported. It leads to the user’s own notebook, not yours.

  3. You do not need to add that import statement, it was already provided in the first cell in the notebook, in Section 2.1.
    Every time you open a notebook, you must run all of the cells starting from the top. This is how the assets are imported and the workspace is created.

The issue in your code is probably where you first create the prices_B values, by using a the “df” dataframe reference.

When I ask for the whole workbook to be graded, i received 0 mark. When i insert # grade-up-to-here to only have the first question graded, i received the 30% mark attached to the first question.

@TMosh, I have MPed you a screenshot with the grader at 30% when i only require marking for the first question

[edit: problem solved]

So that means there is a bug later in the notebook. Do you still get the same error that you are showing in your first post on this thread?

i have simply inserted # grade-up-to-here before the last line of code. It worked.
I have also download a fresh notebook but to no avail.
The only thing that has worked was inserting # grade-up-to-here.
The autograder really has a problem

The grader works fine for me. The theory would be that there is a bug in your code later in the notebook. Do you still get the error about the type of L_of_omega_array?

It looks like you are referencing a function as if it is an array.

Thank you Paul, it works as long as I insert # grade-up-to-here. Got 100%

yes indeed additonally in the last question i have called L_of_omega_array instead of L_of_omega. Maybe this mistake somewhat has interfered with the code above

So are you saying that everything works now? That you found the bug in your code?

Yes. For some reason, the error in question 4 has affected other part of the notebook. That’s why it worked when I inserted #grade up to here as only the 3 first questions were graded

1 Like

If there is a runtime error anyplace in the graded parts of the notebook, then you get 0 points for everything. For example if you have exception like the one you showed above, then the grader cannot complete its execution, which is why you end up with 0 points for everything.

1 Like

Note that most courses do not support the “Grade Up To Here” directive.
It can give very confusing results.

And “#grade up to here” should never be required to pass any assignment.

I strenuously recommend not using “#grade up to here”. It causes far more headaches than it has ever solved.

1 Like