Skip to content

mudler/Algorithm-QLearning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Algorithm::QLearning - Reinforcement Learning done in Pure Perl

DESCRIPTION

Algorithm::QLearning is a base class for implementations of Q-Learning based algorithms written in Pure Perl, have a look at Algorithm::QLearning::NFQ for a Neural Network implementation.

ATTRIBUTES

discount_factor

Defaults to 0.5, it's the discount factor of the Q-Learning function.

learning_rate

Defaults to 1, it's the learning rate of the Q-Learning function.

epsilon

Defaults to 0.1, it's the probability to choose a random path

actions

List of actions of the system (needed if your environment doesn't send the best possible volue for the agent, this enables the automatic search of the best possible value for the next state)

[1,2,3,4]

METHODS

qfunc

Returns the qvalue of the Q-Learning function.

Takes as input: current status, current action, environment result status, environment reward, [best_possible value for next state, optional]

egreedy

Return the new picked action, based on the epsilon specified, and the given actions

_bpv

Represent the best possible value, it's internal

LICENSE

Copyright (C) mudler.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

mudler mudler@dark-lab.net

About

Algorithm::QLearning - Reinforcement Learning done in Pure Perl

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages