The net can run now. Tested: 1 layer softmax-regression, 2 layer net with sigmoid hidden layer.