public String toString() {
    StringBuilder result = new StringBuilder();
    String newLine = System.getProperty("line.separator");
    result.append("Neural network with " + n + " layers:" + newLine);
    for(int i = 0; i < n; i++) {
      result.append("  x:    ");
      for(int j = 0; j < x[i].length; j++) result.append(" " + x[i][j]);
      result.append(newLine);
      result.append("  delta:");
      for(int j = 0; j < delta[i].length; j++) result.append(" " + delta[i][j]);
      result.append(newLine);
      result.append("  weight:");
      result.append(newLine);
      result.append("  ");
      for(int j = 0; j < weight[i].length; j++) {
        result.append("[");
        for(int k = 0; k < weight[i][j].length; k++) {
          result.append(" " + weight[i][j][k]);
        }
        result.append(" ] ");
      }
      result.append(newLine);
    }
    return new String(result);
  }