Error: ValueError: Autograd does not support differentiation of ints

Indeed, looks like something equivalent to what is going on in this forum post: Autograd ArrayBox type intermediate output from optimizer - #3 by leongfy

In this case, your ypred is turning into an ArrayBox. You can try to use qml.math.toarray on ypred. But, there’s lots going on in your code. What I suggest is to strip back your code, use dummy data (not the data generation function you’ve made), and try to isolate where the issue is coming from :slight_smile:. The most important part of this exercise is trying to reduce your code down as minimally as you can.

Let me know if this helps!