public static void compareMomentumLearningSpeed(String filename, int reps, int epochsPerRep, int printFrequency,
			ANN ann, double[] mentums, double[] lisps, double[][] inputs, double[][] outputs) throws IOException {
		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[][] medianEpochPerML = new double[mentums.length*lisps.length][numDataPoints];

		for (int mentum = 0; mentum < mentums.length; mentum++) {
			ann.momentum = mentums[mentum];
			System.out.println("mentum is " + ann.momentum);
			for (int lisp = 0; lisp  < lisps.length; lisp++) {
				ann.learningSpeed = lisps[lisp];
				System.out.println("lisp is " + ann.learningSpeed);

				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("M" + mentums[mentum] + "/L" + lisps[lisp] + "\t");
				for (int dp = 0; dp < tracks.length; dp++) {
					Arrays.sort(tracks[dp]);
					medianEpochPerML[mentum*lisps.length + lisp][dp] = tracks[dp][mloc];
					f.write(tracks[dp][mloc] + "\t");
				}
				f.write("\n");
			}
		}
		f.close();
	}