Program: 31713
Project: 31713
Buggy source:
/** 
 * Process one level.
 * @param currentLevel The current level.
 */
private void processLevel(final int currentLevel){
  final int fromLayerIndex=this.layerIndex[currentLevel + 1];
  final int toLayerIndex=this.layerIndex[currentLevel];
  final int fromLayerSize=this.layerCounts[currentLevel + 1];
  final int toLayerSize=this.layerFeedCounts[currentLevel];
  double dropoutRate=0;
  if (this.layerDropoutRates.length > currentLevel && this.layerDropoutRates[currentLevel] != 0) {
    dropoutRate=this.layerDropoutRates[currentLevel];
  }
  final int index=this.weightIndex[currentLevel];
  final ActivationFunction activation=this.getNetwork().getActivationFunctions()[currentLevel + 1];
  final double currentFlatSpot=this.flatSpot[currentLevel + 1];
  int yi=fromLayerIndex;
  for (int y=0; y < fromLayerSize; y++) {
    final double output=this.layerOutput[yi];
    double sum=0;
    int wi=index + y;
    if (this.owner.isELM() || dropoutRate == 0d || dropoutRandomSource.nextDouble() > dropoutRate) {
      int xi=toLayerIndex;
      for (int x=0; x < toLayerSize; x++) {
        if (this.owner.isELM() && currentLevel == 0) {
          this.gradients[wi]=0d;
        }
 else {
          this.gradients[wi]+=output * this.getLayerDelta()[xi];
        }
        sum+=this.weights[wi] * this.getLayerDelta()[xi];
        wi+=fromLayerSize;
        xi++;
      }
      this.getLayerDelta()[yi]=sum * (activation.derivativeFunction(this.layerSums[yi],this.layerOutput[yi]) + currentFlatSpot);
    }
 else {
      this.getLayerDelta()[yi]=0;
    }
    yi++;
  }
}

Fixed version (ground truth):
/** 
 * Process one level.
 * @param currentLevel The current level.
 */
private void processLevel(final int currentLevel){
  final int fromLayerIndex=this.layerIndex[currentLevel + 1];
  final int toLayerIndex=this.layerIndex[currentLevel];
  final int fromLayerSize=this.layerCounts[currentLevel + 1];
  final int toLayerSize=this.layerFeedCounts[currentLevel];
  double dropoutRate=0;
  if (this.layerDropoutRates.length > currentLevel && this.layerDropoutRates[currentLevel] != 0) {
    dropoutRate=this.layerDropoutRates[currentLevel];
  }
  final int index=this.weightIndex[currentLevel];
  final ActivationFunction activation=this.getNetwork().getActivationFunctions()[currentLevel + 1];
  final double currentFlatSpot=this.flatSpot[currentLevel + 1];
  int yi=fromLayerIndex;
  for (int y=0; y < fromLayerSize; y++) {
    final double output=this.layerOutput[yi];
    double sum=0;
    int wi=index + y;
    if (this.owner.isELM() || dropoutRate == 0d || dropoutRandomSource.nextDouble() > dropoutRate) {
      int xi=toLayerIndex;
      for (int x=0; x < toLayerSize; x++) {
        if (this.owner.isELM() && currentLevel == (this.getNetwork().getEndTraining() - 1)) {
          this.gradients[wi]=0d;
        }
 else {
          this.gradients[wi]+=output * this.getLayerDelta()[xi];
        }
        sum+=this.weights[wi] * this.getLayerDelta()[xi];
        wi+=fromLayerSize;
        xi++;
      }
      this.getLayerDelta()[yi]=sum * (activation.derivativeFunction(this.layerSums[yi],this.layerOutput[yi]) + currentFlatSpot);
    }
 else {
      this.getLayerDelta()[yi]=0;
    }
    yi++;
  }
}