com.asher_stern.crf.function.optimization.ConstantLineSearch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of CRF Show documentation
Show all versions of CRF Show documentation
Implementation of linear-chain Conditional Random Fields (CRF) in pure Java
package com.asher_stern.crf.function.optimization;
import com.asher_stern.crf.function.Function;
/**
* A simple inexact and inaccurate non-efficient line search which merely returns a small
* constant for any input.
*
* @author Asher Stern
* Date: Nov 7, 2014
*
*/
public class ConstantLineSearch implements LineSearch
{
public static final double DEFAULT_RATE = 0.01;
public ConstantLineSearch()
{
this(DEFAULT_RATE);
}
public ConstantLineSearch(double constantRate)
{
super();
this.constantRate = constantRate;
}
@Override
public double findRate(F function, double[] point, double[] direction)
{
return constantRate;
}
private final double constantRate;
}