bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
grid_world_gif Namespace Reference

Functions

 read (path, side)
 where (plane)
 draw (board, side, title, trail)
 main ()

Variables

dict ACTIONS = {-1: "start", 0: "up", 1: "down", 2: "left", 3: "right"}
list PIECES = [("goal", 1, "#f4c542"), ("pit", 2, "#d1495b"), ("wall", 3, "#555555")]

Detailed Description

Make a GIF of episodes on bitrl's Gridworld.

The DQN examples write episode.csv after training: a row for every step, the
episode, the action that led to the board (-1 for the first board), the reward
and the board, 4 x side x side values: a one-hot plane each for the player,
the goal, the pit and the wall, row by row.

Usage: python grid_world_gif.py episode.csv --out dqn.gif [--title DQN] [--side 4] [--episodes 1,2,0]

Needs matplotlib and imageio.

Function Documentation

◆ draw()

grid_world_gif.draw ( board,
side,
title,
trail )

◆ main()

grid_world_gif.main ( )

◆ read()

grid_world_gif.read ( path,
side )

◆ where()

grid_world_gif.where ( plane)

Variable Documentation

◆ ACTIONS

dict grid_world_gif.ACTIONS = {-1: "start", 0: "up", 1: "down", 2: "left", 3: "right"}

◆ PIECES

list grid_world_gif.PIECES = [("goal", 1, "#f4c542"), ("pit", 2, "#d1495b"), ("wall", 3, "#555555")]