k-Armed Bandit 1.0.0
A collection of k-armed bandits and assoicated agents for reinforcement learning
Loading...
Searching...
No Matches
Variables
analysis Namespace Reference

Variables

int K = 10
 
int N = 2000
 
int M = 1000
 
list bandits = []
 
 single_bandit = bandit.Normal(k=K)
 
list agents
 
list agent_names
 
 rewards = numpy.zeros(shape=(len(agents), N, M), dtype=numpy.float)
 
 _table
 
 a
 
float cumulative_mean_reward = 0.0
 
 action = test_agent.act()
 
list reward = bandits[n].select(index=action)
 
 mean_rewards = numpy.mean(a=rewards, axis=1)
 

Variable Documentation

◆ _table

analysis._table
protected

Definition at line 45 of file analysis.py.

◆ a

analysis.a

Definition at line 45 of file analysis.py.

◆ action

analysis.action = test_agent.act()

Definition at line 49 of file analysis.py.

◆ agent_names

list analysis.agent_names
Initial value:
1= [
2 '0.0',
3 '0.01',
4 '0.1',
5]

Definition at line 33 of file analysis.py.

◆ agents

list analysis.agents
Initial value:
1= [
2 agent.Greedy(k=K),
3 agent.EpsilonGreedy(k=K, epsilon=0.01),
4 agent.EpsilonGreedy(k=K, epsilon=0.1),
5]
A greedy agent that occasionally explores.
An agent that always exploits, never explores.
Definition greedy.py:4

Definition at line 28 of file analysis.py.

◆ bandits

list analysis.bandits = []

Definition at line 24 of file analysis.py.

◆ cumulative_mean_reward

float analysis.cumulative_mean_reward = 0.0

Definition at line 46 of file analysis.py.

◆ K

int analysis.K = 10

Definition at line 17 of file analysis.py.

◆ M

int analysis.M = 1000

Definition at line 21 of file analysis.py.

◆ mean_rewards

analysis.mean_rewards = numpy.mean(a=rewards, axis=1)

Definition at line 58 of file analysis.py.

◆ N

int analysis.N = 2000

Definition at line 19 of file analysis.py.

◆ reward

analysis.reward = bandits[n].select(index=action)

Definition at line 50 of file analysis.py.

◆ rewards

analysis.rewards = numpy.zeros(shape=(len(agents), N, M), dtype=numpy.float)

Definition at line 39 of file analysis.py.

◆ single_bandit

analysis.single_bandit = bandit.Normal(k=K)

Definition at line 26 of file analysis.py.