schedulers#
Classes#
Exponential scheduler updates a parameter from a maximum value to a minimum value with a given exponential decay.
Linear schedule updates a parameter from a maximum value to a minimum value over a given number of episodes.
Abstract class for parameter scheduling.
- class prt_rl.common.schedulers.ExponentialScheduler(obj: object, parameter_name: str, start_value: float, end_value: float, decay_rate: float)[source]#
Exponential scheduler updates a parameter from a maximum value to a minimum value with a given exponential decay.
- Parameters:
- class prt_rl.common.schedulers.LinearScheduler(obj: object, parameter_name: str, start_value: float, end_value: float | List[float], interval: int | Tuple[int, int] | List[Tuple[int, int]])[source]#
Linear schedule updates a parameter from a maximum value to a minimum value over a given number of episodes.
- Parameters:
obj (object) – Object to which the parameter belongs
parameter_name (str) – Name of the parameter to schedule
start_value (float) – Maximum value for the parameter
end_value (Union[float, List[float]]) – Minimum value for the parameter
interval (Union[int , Tuple[int, int], List[Tuple[int, int]]]) – Interval to schedule the parameter over. Can be a single integer, a tuple of integers, or a list of tuples. If a single integer is provided, the parameter will be scheduled over that many episodes. If a tuple is provided, the parameter will be scheduled over that range of episodes. If a list of tuples is provided, the parameter will be scheduled over each interval in the list.
- Raises:
ValueError – If the interval is not greater than 0 or if the length of end_value and interval are not the same
Example