<commit_before>package edu.jhu.hlt.optimize;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

/**
 * Basic test class -- should be replaced with something more flexible.
 * 
 * @author <NAME>
 */
public class OptimizeTester {

	public List<TestFunction> getTestFunctions() {
		List<TestFunction> fs = new ArrayList<TestFunction>();
		
		fs.add(new TestFunction(new XSquared(+1d), 0d, 1e-4, new double[] {0d}, 1e-3));
		fs.add(new TestFunction(new XSquared(-1d), 0d, 1e-4, new double[] {0d}, 1e-3));
		
		return fs;
	}
	
	@Test
	public void testStochasticGradientDescent() {
		List<TestFunction> fs = getTestFunctions();
		for(TestFunction f : fs) {
			StochasticGradientDescent sgd = new StochasticGradientDescent((DifferentiableRealScalarFunction) f.getFunction(), 1e-1);
			f.checkValue(sgd.val());
			f.checkParam(sgd.getFunction().get());
		}
	}

}<commit_msg>Updating test with more time<commit_after>package edu.jhu.hlt.optimize;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

/**
 * Basic test class -- should be replaced with something more flexible.
 * 
 * @author <NAME>
 */
public class OptimizeTester {

	public List<TestFunction> getTestFunctions() {
		List<TestFunction> fs = new ArrayList<TestFunction>();
		
		fs.add(new TestFunction(new XSquared(+1d), 0d, 1e-4, new double[] {0d}, 1e-3));
		fs.add(new TestFunction(new XSquared(-1d), 0d, 1e-4, new double[] {0d}, 1e-3));
		
		return fs;
	}
	
	@Test
	public void testStochasticGradientDescent() {
		List<TestFunction> fs = getTestFunctions();
		for(TestFunction f : fs) {
			StochasticGradientDescent sgd = new StochasticGradientDescent((DifferentiableRealScalarFunction) f.getFunction(), 1);
			f.checkValue(sgd.val());
			f.checkParam(sgd.getFunction().get());
		}
	}

}
{'fraction_non_alphanumeric': 0.14309576837416482, 'fraction_numerical': 0.017260579064587972, 'mean_word_length': 4.580745341614906, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2138046', 'n_tokens_mistral': 695, 'n_tokens_neox': 613, 'n_words': 140}