Program: 92545
Project: 92545
Buggy source:
@Override public double[][] learn(double[] x,double[] y){
  try {
    units=Integer.parseInt(unitsField.getText().trim());
    if (units <= 0) {
      JOptionPane.showMessageDialog(this,"String_Node_Str" + units,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      return null;
    }
  }
 catch (  Exception ex) {
    JOptionPane.showMessageDialog(this,"String_Node_Str" + unitsField.getText(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return null;
  }
  try {
    epochs=Integer.parseInt(epochsField.getText().trim());
    if (epochs <= 0) {
      JOptionPane.showMessageDialog(this,"String_Node_Str" + epochs,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      return null;
    }
  }
 catch (  Exception ex) {
    JOptionPane.showMessageDialog(this,"String_Node_Str" + epochsField.getText(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return null;
  }
  double[][] data=dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
  int[] label=dataset[datasetIndex].toArray(new int[dataset[datasetIndex].size()]);
  int k=Math.max(label) + 1;
  NeuralNetwork net=null;
  if (k == 2) {
    net=new NeuralNetwork(NeuralNetwork.ErrorFunction.CROSS_ENTROPY,NeuralNetwork.ActivationFunction.LOGISTIC_SIGMOID,data[0].length,units,1);
  }
 else {
    net=new NeuralNetwork(NeuralNetwork.ErrorFunction.CROSS_ENTROPY,NeuralNetwork.ActivationFunction.SOFTMAX,data[0].length,units,k);
  }
  for (int i=0; i < epochs; i++) {
    net.learn(data,label);
  }
  for (int i=0; i < label.length; i++) {
    label[i]=net.predict(data[i]);
  }
  double trainError=error(label,label);
  System.out.format("String_Node_Str",100 * trainError);
  double[][] z=new double[y.length][x.length];
  for (int i=0; i < y.length; i++) {
    for (int j=0; j < x.length; j++) {
      double[] p={x[j],y[i]};
      z[i][j]=net.predict(p);
    }
  }
  return z;
}

Fixed version (ground truth):
@Override public double[][] learn(double[] x,double[] y){
  try {
    units=Integer.parseInt(unitsField.getText().trim());
    if (units <= 0) {
      JOptionPane.showMessageDialog(this,"String_Node_Str" + units,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      return null;
    }
  }
 catch (  Exception ex) {
    JOptionPane.showMessageDialog(this,"String_Node_Str" + unitsField.getText(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return null;
  }
  try {
    epochs=Integer.parseInt(epochsField.getText().trim());
    if (epochs <= 0) {
      JOptionPane.showMessageDialog(this,"String_Node_Str" + epochs,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      return null;
    }
  }
 catch (  Exception ex) {
    JOptionPane.showMessageDialog(this,"String_Node_Str" + epochsField.getText(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return null;
  }
  double[][] data=dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
  int[] label=dataset[datasetIndex].toArray(new int[dataset[datasetIndex].size()]);
  int k=Math.max(label) + 1;
  NeuralNetwork net=null;
  if (k == 2) {
    net=new NeuralNetwork(NeuralNetwork.ErrorFunction.CROSS_ENTROPY,NeuralNetwork.ActivationFunction.LOGISTIC_SIGMOID,data[0].length,units,1);
  }
 else {
    net=new NeuralNetwork(NeuralNetwork.ErrorFunction.CROSS_ENTROPY,NeuralNetwork.ActivationFunction.SOFTMAX,data[0].length,units,k);
  }
  for (int i=0; i < epochs; i++) {
    net.learn(data,label);
  }
  int[] pred=new int[label.length];
  for (int i=0; i < label.length; i++) {
    pred[i]=net.predict(data[i]);
  }
  double trainError=error(label,pred);
  System.out.format("String_Node_Str",100 * trainError);
  double[][] z=new double[y.length][x.length];
  for (int i=0; i < y.length; i++) {
    for (int j=0; j < x.length; j++) {
      double[] p={x[j],y[i]};
      z[i][j]=net.predict(p);
    }
  }
  return z;
}