public static void compareHiddenLayerSizes(String filename, int reps, int epochsPerRep, int printFrequency,
			ANN ann, int[] hlsizes, double[][] inputs, double[][] outputs) throws IOException {
		//ANN ann = new ANN(1, 0.5, 0.5, 2, 2, 1);
		int numDataPoints = epochsPerRep/printFrequency;
		int mloc = reps/2;
		File file = new File(filename);
		FileWriter f = new FileWriter(file.getAbsolutePath());
		f.write("0\t");
		for (int i = 0; i < epochsPerRep; i++) {
			if (i%printFrequency == 0) f.write(i + "\t");
		}
		f.write("\n");

		double[][] medianEpochPerMentum = new double[hlsizes.length][numDataPoints];

		for (int size = 0; size < hlsizes.length; size++) {
			// ann = new ANN(1, 0.5, 0.5, 2, hlsizes[size], 1);
			ann = new ANN(1, 0.5, 0.5, 4, hlsizes[size], 3);
			System.out.println("hlsize is " + hlsizes[size]);
			double[][] tracks = new double[numDataPoints][reps];
			for (int q = 0; q < reps; q++) {
				ann.reset();
				int dataPoint = 0;
				for (int i = 0; i < epochsPerRep; i++) {
					double[][] currentoutputs = new double[inputs.length][outputs[0].length];
					ANN.permute(inputs, outputs);
					for (int j = 0; j < inputs.length; j++) {
						Pattern trial = new Pattern(inputs[j], outputs[j]);
						ann.pass(trial);
						ann.updateAllWeights(trial);
						double[] currentoutput = ann.getCurrentOutput();
						currentoutputs[j] = currentoutput;
					}
					double err = ANN.populationError(ann.outputs(inputs), outputs);
					if (i%printFrequency == 0) {
						tracks[dataPoint][q] = err;
						dataPoint++;
					}
				}
			}
			f.write(hlsizes[size] + "\t");
			for (int dp = 0; dp < tracks.length; dp++) {
				Arrays.sort(tracks[dp]);
				medianEpochPerMentum[size][dp] = tracks[dp][mloc];
				f.write(tracks[dp][mloc] + "\t");
			}
			f.write("\n");
		}
		f.close();
	}