summaryrefslogtreecommitdiff
path: root/gi/posterior-regularisation/prjava/src/optimization/linesearch/InterpolationPickFirstStep.java
blob: 0deebcdb9304841d50dcdb8df766436f14cd87c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package optimization.linesearch;


public class InterpolationPickFirstStep extends GenericPickFirstStep{
	public InterpolationPickFirstStep(double initValue) {
		super(initValue);
	}
	
	public double getFirstStep(LineSearchMethod ls){
		if(ls.getPreviousStepUsed() != -1 && ls.getPreviousInitialGradient()!=0){
			double newStep = Math.min(300, 1.02*ls.getPreviousInitialGradient()*ls.getPreviousStepUsed()/ls.getInitialGradient());
		//	System.out.println("proposing " + newStep);
			return newStep;
			
		}
		return _initValue;
	}
	public void collectInitValues(WolfRuleLineSearch ls){
		
	}
	
	public void collectFinalValues(WolfRuleLineSearch ls){
		
	}
}