https://github.com/mudler/algorithm-qlearning
Algorithm::QLearning - Reinforcement Learning done in Pure Perl
https://github.com/mudler/algorithm-qlearning
Last synced: about 1 month ago
JSON representation
Algorithm::QLearning - Reinforcement Learning done in Pure Perl
- Host: GitHub
- URL: https://github.com/mudler/algorithm-qlearning
- Owner: mudler
- License: other
- Created: 2014-10-25T11:07:21.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-28T09:46:45.000Z (about 11 years ago)
- Last Synced: 2025-03-28T07:12:14.476Z (9 months ago)
- Language: Perl
- Size: 902 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Algorithm::QLearning - Reinforcement Learning done in Pure Perl
# DESCRIPTION
[Algorithm::QLearning](https://metacpan.org/pod/Algorithm::QLearning) is a base class for implementations of Q-Learning based algorithms written in Pure Perl, have a look at [Algorithm::QLearning::NFQ](https://metacpan.org/pod/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