Program: 32091
Project: 32091
Buggy source:
@Override public LogisticRegressionParams doCompute(WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context){
  if (context.isFirstIteration()) {
    return new LogisticRegressionParams();
  }
 else {
    this.weights=context.getLastMasterResult().getParameters();
    double[] gradients=new double[this.inputNum];
    double trainingFinalError=0.0d;
    double testingFinalError=0.0d;
    long trainingSize=this.trainingData.size();
    long testingSize=this.testingData.size();
    this.trainingData.reOpen();
    for (    Data data : trainingData) {
      double result=sigmoid(data.inputs,this.weights);
      double error=result - data.outputs[0];
      trainingFinalError+=error * error;
      for (int i=0; i < gradients.length; i++) {
        gradients[i]+=error * data.inputs[i] * data.getSignificance();
      }
    }
    this.testingData.reOpen();
    for (    Data data : testingData) {
      double result=sigmoid(data.inputs,this.weights);
      double error=result - data.outputs[0];
      testingFinalError+=error * error;
    }
    double trainingReg=this.regularizedParameter(this.regularizedConstant,trainingSize);
    double testingReg=this.regularizedParameter(this.regularizedConstant,testingSize);
    LOG.info("String_Node_Str",context.getCurrentIteration(),trainingFinalError / trainingSize + trainingReg);
    LOG.info("String_Node_Str",context.getCurrentIteration(),testingFinalError / testingSize + testingReg);
    return new LogisticRegressionParams(gradients,trainingFinalError,testingFinalError,trainingSize,testingSize);
  }
}

Fixed version (ground truth):
@Override public LogisticRegressionParams doCompute(WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context){
  if (context.isFirstIteration()) {
    return new LogisticRegressionParams();
  }
 else {
    this.weights=context.getLastMasterResult().getParameters();
    double[] gradients=new double[this.inputNum + 1];
    double trainingFinalError=0.0d;
    double testingFinalError=0.0d;
    long trainingSize=this.trainingData.size();
    long testingSize=this.testingData.size();
    this.trainingData.reOpen();
    for (    Data data : trainingData) {
      double result=sigmoid(data.inputs,this.weights);
      double error=data.outputs[0] - result;
      trainingFinalError+=error * error;
      for (int i=0; i < gradients.length; i++) {
        if (i < gradients.length - 1) {
          gradients[i]+=error * data.inputs[i] * (result * (1d - result) + 0.1d)* data.getSignificance();
        }
 else {
          gradients[i]+=error * 1d * (result * (1d - result) + 0.1d)* data.getSignificance();
        }
      }
    }
    this.testingData.reOpen();
    for (    Data data : testingData) {
      double result=sigmoid(data.inputs,this.weights);
      double error=result - data.outputs[0];
      testingFinalError+=error * error;
    }
    double trainingReg=this.regularizedParameter(this.regularizedConstant,trainingSize);
    double testingReg=this.regularizedParameter(this.regularizedConstant,testingSize);
    LOG.info("String_Node_Str",context.getCurrentIteration(),trainingFinalError / trainingSize + trainingReg);
    LOG.info("String_Node_Str",context.getCurrentIteration(),testingFinalError / testingSize + testingReg);
    return new LogisticRegressionParams(gradients,trainingFinalError,testingFinalError,trainingSize,testingSize);
  }
}