Functions | Variables
qtable Namespace Reference

Functions

def rendertrial (maxiter=100)
 

Variables

float DECAY_RATE = 0.99
 
 env = DPendulum()
 — Environment More...
 
list h_rwd = []
 
float LEARNING_RATE = 0.85
 
int NEPISODES = 500
 — Hyper paramaters More...
 
int NSTEPS = 50
 
 NU = env.nu
 
 NX = env.nx
 
 Q = np.zeros([env.nx,env.nu])
 
 Qref = reward+DECAY_RATE*np.max(Q[x2,:])
 
 RANDOM_SEED = int((time.time()%10)*1000)
 — Random seed More...
 
 reward
 
float rsum = 0.0
 
 u = np.argmax(Q[x,:] + np.random.randn(1,NU)/episode)
 
 x = env.reset()
 
 x2
 

Detailed Description

Example of Q-table learning with a simple discretized 1-pendulum environment.

Function Documentation

def qtable.rendertrial (   maxiter = 100)
Roll-out from random state using greedy policy.

Definition at line 29 of file qtable.py.

Variable Documentation

float qtable.DECAY_RATE = 0.99

Definition at line 20 of file qtable.py.

qtable.env = DPendulum()

— Environment

Definition at line 23 of file qtable.py.

list qtable.h_rwd = []

Definition at line 39 of file qtable.py.

float qtable.LEARNING_RATE = 0.85

Definition at line 19 of file qtable.py.

int qtable.NEPISODES = 500

— Hyper paramaters

Definition at line 17 of file qtable.py.

int qtable.NSTEPS = 50

Definition at line 18 of file qtable.py.

qtable.NU = env.nu

Definition at line 25 of file qtable.py.

qtable.NX = env.nx

Definition at line 24 of file qtable.py.

qtable.Q = np.zeros([env.nx,env.nu])

Definition at line 27 of file qtable.py.

qtable.Qref = reward+DECAY_RATE*np.max(Q[x2,:])

Definition at line 49 of file qtable.py.

qtable.RANDOM_SEED = int((time.time()%10)*1000)

— Random seed

Definition at line 12 of file qtable.py.

qtable.reward

Definition at line 46 of file qtable.py.

float qtable.rsum = 0.0

Definition at line 43 of file qtable.py.

qtable.u = np.argmax(Q[x,:] + np.random.randn(1,NU)/episode)

Definition at line 45 of file qtable.py.

qtable.x = env.reset()

Definition at line 42 of file qtable.py.

qtable.x2

Definition at line 46 of file qtable.py.



pinocchio
Author(s):
autogenerated on Tue Jun 1 2021 02:45:06