I tried to create a neural network that uses reinforcement training. I chose scikit-neuralnetwork as a library (because it is simple). It seems the installation of the Theano two-time crash.
Here is the simplest code that causes a crash (note that it doesn't matter which layers exist and the learning speed or n_iter):
import numpy as np from sknn.mlp import Classifier, Layer clf = Classifier( layers=[ Layer("Softmax") ], learning_rate=0.001, n_iter=1) clf.fit(np.array([[0.]]), np.array([[0.]])) # Initialize the network for learning X = np.array([[-1.], [1.]]) Y = np.array([[1.], [0.]]) clf.fit(X, Y) # crash
And here is the error I received:
ValueError: Input dimension mis-match. (input[0].shape[1] = 2, input[1].shape[1] = 1) Apply node that caused the error: Elemwise{Mul}[(0, 1)](y, LogSoftmax.0) Toposort index: 12 Inputs types: [TensorType(float64, matrix), TensorType(float64, matrix)] Inputs shapes: [(1L, 2L), (1L, 1L)] Inputs strides: [(16L, 8L), (8L, 8L)] Inputs values: [array([[ 1., 0.]]), array([[ 0.]])] Outputs clients: [[Sum{axis=[1], acc_dtype=float64}(Elemwise{Mul}[(0, 1)].0)]]
Tested in Python 2.7.11
Does sknn not support installation several times, or am I making some kind of idiotic mistake? If this is not the case, how should you implement reinforcement training?