public static void compareMomentumHL(String filename, int reps, int epochsPerRep, int printFrequency,
			ANN ann, double[] mentums, int[] hlsizes, double[][] inputs, double[][] outputs) throws IOException {
		File file = new File(filename);
		FileWriter f = new FileWriter(file.getAbsolutePath());

		int numDataPoints = epochsPerRep/printFrequency + 1;

		f.write("0\t");
		for (int i = 0; i < epochsPerRep; i++) {
			if (i%printFrequency == 0) f.write(i + "\t");
		}
		f.write("\n");

		for (int mentum = 0; mentum < mentums.length; mentum++) {
			ann.momentum = mentums[mentum];
			System.out.println("mentum is " + ann.momentum);
			for (int hlsize = 0; hlsize  < hlsizes.length; hlsize++) {
				ann = new ANN(1, ann.learningSpeed, ann.momentum, ann.layerSize(0), hlsizes[hlsize], ann.layerSize(2));
				System.out.println("hlsize is " + ann.layerSize(1));

				double[][] tracks = new double[numDataPoints][reps];

				for (int q = 0; q < reps; q++) {
					ann.reset();

					double initerr = ANN.populationError(ann.outputs(inputs), outputs);
					tracks[0][q] = initerr;

					int dataPoint = 1;
					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(mentums[mentum] + "/" + hlsizes[hlsize] + "\t");
				for (int dp = 0; dp < tracks.length; dp++) {
					f.write(median(tracks[dp]) + "\t");
				}
				f.write("\n");
			}
		}
		f.close();
	}