我使用theano
函数并想使用它givens
来迭代所有输入样本。代码如下:
index = T.scalar('index')
train_set = np.array([[0.2, 0.5, 0.01], [0.3, 0.91, 0.4], [0.1, 0.7, 0.22],
[0.7, 0.54, 0.2], [0.1, 0.12, 0.3], [0.2, 0.52, 0.1],
[0.12, 0.08, 0.4], [0.02, 0.7, 0.22], [0.71, 0.5, 0.2],
[0.1, 0.42, 0.63]])
train = function(inputs=[index], outputs=cost, updates=updates,
givens={x: train_set[index]})
它最终会引发一个错误:
ValueError: setting an array element with a sequence.
你能告诉我为什么,以及如何解决这个问题吗?