1
$\begingroup$

I've written a program which implements supervised learning on an artificial neural network (Mathematica 11 came out when I was about halfway through). The program runs through many training epochs (thousands, for small lists of inputs), but eventually generates an error message:

Partition::ohp: "Overhang parameters in {1,-1} must be nonzero machine-sized
integers, or lists of nonzero machine-sized integers".

The program cascades out of control from there. I've not given any overhang parameters, however. Thinking that perhaps something went amiss and unintended parameters were getting passed to Partition[] somehow, I set the Debugger to break on any message. Doing so and looking at the stack, I can see the function call generating the error message:

Partition[{-1.55924, -1.72346, 1.39834, 0.0524931}, 2].

All I can see is a list and then an integer designating the number of elements in each partition. I'm not sure where the overhang parameters are coming from. To check to make sure than the '2' I'm seeing is actually an integer, I stored the values and their heads being passed to Partition[] in a list, called SpyList2, and when the program beaks I can call them.

In[502]:= SpyList2

Out[502]= {2, Integer}

So, the '2' I'm seeing is in fact an integer and I'm left totally confused as to why I'm getting this overhang parameters error. Does anyone know what's going on? I'm not sure what the proper procedure is, since this error occurs as part of a larger block of undocumented code, which would be unintelligible if posted.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.