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

main.java.burlap.behavior.learningrate.ConstantLR Maven / Gradle / Ivy

Go to download

The Brown-UMBC Reinforcement Learning and Planning (BURLAP) Java code library is for the use and development of single or multi-agent planning and learning algorithms and domains to accompany them. The library uses a highly flexible state/observation representation where you define states with your own Java classes, enabling support for domains that discrete, continuous, relational, or anything else. Planning and learning algorithms range from classic forward search planning to value-function-based stochastic planning and learning algorithms.

The newest version!
package burlap.behavior.learningrate;

import burlap.mdp.core.action.Action;
import burlap.mdp.core.state.State;


/**
 * A class for specifying a constant learning rate that never changes.
 * @author James MacGlashan
 *
 */
public class ConstantLR implements LearningRate {

	public double learningRate = 0.1;
	
	/**
	 * Constructs constant learning rate of 0.1
	 */
	public ConstantLR(){
		//do nothing
	}
	
	/**
	 * Constructs a constant learning rate for the given value
	 * @param learningRate the constant learning rate to use
	 */
	public ConstantLR(Double learningRate){
		this.learningRate = learningRate;
	}
	
	@Override
	public double peekAtLearningRate(State s, Action ga) {
		return this.learningRate;
	}

	@Override
	public double pollLearningRate(int agentTime, State s, Action ga) {
		return this.learningRate;
	}

	@Override
	public void resetDecay() {
		//no change needed
	}

	@Override
	public double peekAtLearningRate(int featureId) {
		return this.learningRate;
	}

	@Override
	public double pollLearningRate(int agentTime, int featureId) {
		return this.learningRate;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy