All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.asher_stern.crf.function.optimization.ConstantLineSearch Maven / Gradle / Ivy

Go to download

Implementation of linear-chain Conditional Random Fields (CRF) in pure Java

The newest version!
package com.asher_stern.crf.function.optimization;

import java.math.BigDecimal;

import com.asher_stern.crf.function.Function;
import com.asher_stern.crf.utilities.ArithmeticUtilities;

/**
 * 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 BigDecimal DEFAULT_RATE = new BigDecimal(0.01, ArithmeticUtilities.MC);
	
	public ConstantLineSearch()
	{
		this(DEFAULT_RATE);
	}
	
	public ConstantLineSearch(BigDecimal constantRate)
	{
		super();
		this.constantRate = constantRate;
	}


	@Override
	public BigDecimal findRate(F function, BigDecimal[] point, BigDecimal[] direction)
	{
		return constantRate;
	}
	
	
	private final BigDecimal constantRate;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy