private void increaseNeuronCount(final int targetLayer,
final int neuronCount) {
// check for errors
if (targetLayer > this.network.getLayerCount()) {
throw new NeuralNetworkError("Invalid layer " + targetLayer);
}
if (neuronCount <= 0) {
throw new NeuralNetworkError("Invalid neuron count " + neuronCount);
}
final int oldNeuronCount = this.network
.getLayerNeuronCount(targetLayer);
final int increaseBy = neuronCount - oldNeuronCount;
if (increaseBy <= 0) {
throw new NeuralNetworkError(
"New neuron count is either a decrease or no change: "
+ neuronCount);
}
// access the flat network