Jupyter notebooks altogether broken right now, or maybe just week one optional?

I went back to take a look at the week one optional work again, to enhance my understanding, before the end of the course. I’ve spent four hours on this. I am still on the first function. BECAUSE IT IS NOT WORKING. At first it seemed like I was getting reasonable errors, but as I have spent more and more time debugging, it is becoming clear that they are entirely and exceptionally unreasonable. It doesn’t know that if you index a numpy array it is a scalar. It doesn’t know that if you have an array indexed from 4:6 it should have dimension 2. I have been using print statements to check this one since it is optional and I assure you the end indices are 4 and 6 but the dimension is zero. I’m going to pull my hair out. I certainly hope the last lab in week four is working, and this is not just an outage of the jupyter notebooks altogether, because at this point I’ve put something like 15 weeks into this sequence, and while I’ve learned a lot and really appreciate it, I honestly did want the certificate. This next assignment is my last assignment, and I very much did have time to complete it if I had not wasted four hours with a function that can’t compute 6-4 and furthermore, hopefully the notebook will work for the upcoming last assignment of week four.

To meet the technical requirements of posting on this forum, here is the ridiculously and horribly broken notebook from week one, that I have already passed, but went back to do extra work on JUST SO I COULD LEARN BUT HAVE NOW WASTED FOUR HOURS ON THE LAST SUNDAY OF THE COURSE

Broken notebook, going to rage quit, think it’s the only valid strategy at this point, what do you do with a python interpreter that can’t subtract four from six, seriously I don’t want to quit programming, hope the next one works

Here is the next notebook I hope to be working on, and I certainly hope it works!
Excited about this lab, but think my head is going to explode. At least i have coffee

Hello @s-dorsher,

To seriously test it myself, since my copy was years ago, I got a fresh copy of the C4 W1 A1 notebook and filled the answers in. All of them passed.

I don’t know what had happened, but at least I can think of a case when array[4:6] does not give us an array of 2 elements, which is when it does not contain all of those elements:

We can’t just open your notebook with that link. I suggest you to share the full traceback of the first error which blocks you from moving forward and we can look at it together. However, I understand that you may just want to focus on W4 because time may be tight now…

Good luck to you for your W4 :wink:

Raymond

I just re-ran my notebook for the C4 W1 A1 assignment (which I last touched in Sept. 2023).

After I restarted the kernel, it worked fine.

1 Like

If you mean the optional backpropagation section of the “Step by Step” assignment in W1, it all worked fine for me. The theory would be that there must be some problem in your logic. As Raymond says, the way to proceed would be to show us the exception trace you are getting.

Note that this assignment has not changed in 2 years, so it is not a “versionitis” problem.

1 Like

Insane that it doesn’t give an index out of bounds error

No, I have not found out why it thinks F[0,0,0,0] for example is an array rather than a scalar, yet, either

I can only make guess here. when you initialize dW or db, did you give np.zeros a tuple of > 4 values, because that will return an array of > 4 dimensions and it will be an array when you index, for example, dW[0, 0, 0, 0].

Dude unless the docs are wrong and python has changed a thousand fold in the last year, you are absolutely wrong about this.

np.zeros docs

It’s just a numpy array. When you index a numpy array with every index, so that in a (2,2) array for example you might index with 1,1 or 0,1; it returns a scalar.

I forgot to attach an example. Below is what I meant. Maybe that’s not your case, because I was just making guess.

I’m so confused about why you would think I would initialize an array with something like

y = np.arange(1,5)
x=np.zeros(y)

rather than

y= np.arange(1,5)
x=np.zeros(np.shape(y))

I just finished the fourth course in the five course sequence of Deep Learning and had a previous career in computational physics, where I used python for several years. I do check numpy documentation sometimes to be sure I have written the formatting correctly, because my programming experience as a whole spans Basic, C++, IDL, scheme, C++, LabView, C, FORTRAN, Matlab, C++, Java, like one week of ruby, C++, FORTRAN, Java, HBase, MPI, OpenMP, Python, mpi4py, bash, haskell, SQL, python, pandas, machine learning, … some of these aren’t really significant, but as you can see I went back and forth a lot. But anyhow, I finished the fourth course in the Deep Learning specialization and previously finished the Machine Learning specialization. I’ve done other certificates elsewhere, at least partially. I also have three masters degrees in computational physics. I also am one week into the fifth course in this specialization.

Anyone can make an error. I really do appreciate you calling my attention to the possibility. But I don’t have that misunderstanding about how it works. That’s a really weird assumption about me.

Correcting that, very slightly, my bachelors is in physics, but it was computational physics. My masters degrees are in astronomy, physics, and physics, but it was computational astrophysics, and particle physics

Thinking about this further, if I wanted to do this the WRONG way for some reason, it would look like

y=range(5)+1
y=tuple(y)
x=np.zeros(y)

Although I’ve posted some discussions with ChatGPT on topics that go beyond coursework or homework, because they’re interesting, and I hoped they would prompt discussion, I definitely don’t use ChatGPT on homework, or anything like that. I have never even looked up solutions to homework in my entire academic career. I am a teacher/tutor. I have a passionate belief in students putting in their own effort for the purpose of learning. However, I also have a passionate belief that students (like me) should make the most of their opportunities to learn, and where AI can enhance the opportunity to go BEYOND the course material or spark discussion, that seems like a great idea to me.

I use documentation of functions for homework in this course but I do not look up solutions to homework problems, nor would I even want to. That gets in the way of learning. It is also not fair or honest. My work has been my own.

Hello, @s-dorsher,

I am sorry that my last post was confusing. It was one way I could have unintentionally made it happen.

My logic was that, if I had indexed it with 4 numbers and it returned an array, then it should be more than 4 dimensions to begin with, then how could it be more than 4 dimensions? I was just following my logic which, I admit, could be not the actual direction of your case. I hope you know that my guess was not based on assumption about you.

I had worked in a neutrino oscillation project. Your story reminded me of my time debugging code with my colleague in laboratory. I do not have the same background as you, and despite we needed to take a Fortran class, we had to learn MatLab, LabVIEW, C, C++ on our own and in our way as we needed. At that time, when any one of us ran out of idea debugging unexpected outcome, we could ask each other for help and we just stayed in front of a screen to find it. While we read the lines, sometimes we were quiet and sometimes we kept brainstorming and hoped one idea might hit something even though they could all be missing the real cause (but ourselves). If you and I were looking at the same screen, our conversation would have been completely different and probably it would have been another fun and good memory because you could have seen with your eyes how serious I was about your situation :wink: :wink: :wink:

Again, I am sorry that my last post was confusing.

Cheers,
Raymond

Btw, I am just curious, did you try ChatGPT to find out why it returned an array with your code? My motivation of this question is a bit different and it was not really about finding the cause but, mainly simply, “can ChatGPT do it?”

To see how chatbot has advanced to, I recently started a little project mostly with the help of a chatbot on a programming language that I have not learned. So far I would say it was convenient and gave me big help, but it could point me to many wrong directions. There were some errors that the most efficient solution was not the chatbot, but the combination of my programming experience, to understand the documentation of the relevant library and experimentation.

Also, chatbot could give me very good starter code while I still prefer to write my own version more.

Helpful chatbot!

Raymond

No, I did not