Skip to content

Instantly share code, notes, and snippets.

@maymayw
maymayw / ValIter.py
Created February 10, 2019 19:23
public secret
import numpy as np
from rl.lib.envs.gridworld import GridworldEnv
env = GridworldEnv()
def valiter(env, dr=1.0, theta = 0.0001):
def onestepahead(s, V):
q = np.zeros(env.nA)
for a in np.arange(env.nA):
[(prob, nexts, reward, done)] = env.P[s][a]