Skip to content
Snippets Groups Projects
lecture_10_td_keyboard.py 674 B
Newer Older
  • Learn to ignore specific revisions
  • tuhe's avatar
    tuhe committed
    # This file may not be shared/redistributed without permission. Please read copyright notice in the git repo. If this file contains other copyright notices disregard this text.
    from irlc.lectures.lec10.lecture_10_mc_q_estimation import automatic_play_value
    from irlc.gridworld.gridworld_environments import BookGridEnvironment
    from irlc.ex10.td0_evaluate import TD0ValueAgent
    
    tuhe's avatar
    tuhe committed
    from irlc.lectures.lec10.utils import agent_reset
    
    tuhe's avatar
    tuhe committed
    
    if __name__ == "__main__":
        env = BookGridEnvironment(render_mode='human', living_reward=-0.05)
    
    tuhe's avatar
    tuhe committed
        TD0ValueAgent.reset = agent_reset
    
    tuhe's avatar
    tuhe committed
        agent = TD0ValueAgent(env, gamma=1.0, alpha=0.2)
        automatic_play_value(env,agent,method_label='TD(0)')