public FlatNetwork(final int input, final int hidden1, final int hidden2,
final int output, final boolean tanh) {
final ActivationFunction linearAct = new ActivationLinear();
FlatLayer[] layers;
final ActivationFunction act = tanh ? new ActivationTANH()
: new ActivationSigmoid();
if ((hidden1 == 0) && (hidden2 == 0)) {
layers = new FlatLayer[2];
layers[0] = new FlatLayer(linearAct, input,