Circuit not optimizing parameters

Hi @Amandeep,

The Arraybox issue in these cases usually happens in one of three cases:

  • A: you’re updating a global variable without realizing
  • B: you have a mismatch in the size or type of the data you’re handling, or
  • C: you’re using a forbidden functionality of Numpy as seen here in the documentation.

In this case I think your problem is a combination of B and C. I think the core of the issue is in the line loss+= y_true[i]*(math.log(y_pred[i])). I would recommend trying different loss functions such as the on in this blog post until you find one that works.

Unfortunately your problem is so complex that it’s hard to know exactly where the problem is. Debugging is part of research so I recommend that you simplify as much as possible until you find the solution. You may find this post helpful too. They were facing the same “Output seems independent of input” issue that you were facing before, and it was fixed by handling the data more carefully.

I hope this helps you.