dLife Home Page

dlife.rl
Class DecayingLearningRate

java.lang.Object
  extended by dlife.rl.DecayingLearningRate
All Implemented Interfaces:
LearningRateFunction, Serializable

public class DecayingLearningRate
extends Object
implements LearningRateFunction

A learning rate function that decreases as a function of the number of times a (State,Action) pair is tried. The function used is:

where rate is specified in a parameter to the constructor and n is the number of times the current (State,Action) pair has been tried. The larger the value of rate, the slower the decay.

Version:
Apr 26, 2011
Author:
Grant Braught, Dickinson College
See Also:
Serialized Form

Constructor Summary
DecayingLearningRate(QTable q, double rate)
          Construct a new DecayingLearningRate function.
 
Method Summary
 double alpha(State s, Action a)
          Get the learning rate for next update of the Q-value for the specified (State,Action) pair.
 boolean equals(Object o)
          Check if two DecayingLearningRate functions are the same.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecayingLearningRate

public DecayingLearningRate(QTable q,
                            double rate)
Construct a new DecayingLearningRate function.

Parameters:
q - the Q-Table.
rate - controls the rate of decay. Larger values cause slower decay, smaller values cause faster decay.
Method Detail

alpha

public double alpha(State s,
                    Action a)
Get the learning rate for next update of the Q-value for the specified (State,Action) pair. Note: if an implementing class requires additional information (e.g. the Q-Table) that class should accept the information as a parameter to its constructor.

Specified by:
alpha in interface LearningRateFunction
Parameters:
s - the State.
a - the Action.
Returns:
the learning rate.

equals

public boolean equals(Object o)
Check if two DecayingLearningRate functions are the same. They are the same if they have the same rate and the same Q-Table.

Overrides:
equals in class Object
Parameters:
o - another DecayingLearningRate object.
Returns:
true if this DecayingLearningRate is the same as o and false otherwise.

dLife Home Page