Python 2.7.12 (x64)
Library problems used near: PyBrain, SciPy
Context of the problem: it is necessary to obtain from PyBrain a result passed via a variable of type list, the contents of which change when the function is accessed, the result is a two-dimensional ndarray.
Task: it is necessary to build a list of several two-dimensional ndarray of different sizes.
The problem itself: not a two-dimensional ndarray is written into the specified variable of the list type, but a list of one-dimensional ndarray.
Partially successful solution attempts: trying to get rid of the external list means scipy.array () and scipy.vstack () gives a completely satisfactory result, but only on a separate variable - when trying to assign an element of that list the value of this variable it falls to list from one-dimensional ndarray.
Who can tell how to get around this problem?
I unfortunately still can not repeat this problem in "greenhouse" conditions, but attempts to find a problem look like this:
out=[] self.layer[i]._forwardImplementation(self.inputs[i],out) print 'out =\n',out,type(out) out=vstack(out) print 'out =\n',out,type(out) self.outputs[i][:]=array(out.T) print 'self.outputs[i] =\n',self.outputs[i],type(self.outputs[i]) And the conclusion of this:
out = [array([ 0., 0., 1., 1.]), array([ 0., 1., 0., 1.])] <type 'list'> out = [[ 0. 0. 1. 1.] [ 0. 1. 0. 1.]] <type 'numpy.ndarray'> self.outputs[i] = [array([ 0., 0.]), array([ 0., 1.]), array([ 1., 0.]), array([ 1., 1.])] <ty pe 'list'>