官术网_书友最值得收藏!

Programming an agent using an OpenAI Gym environment

The environment considered for this section is the Frozen Lake v0. The actual documentation of the concerned environment can be found at https://gym.openai.com/envs/FrozenLake-v0/.

This environment consists of 4 x 4 grids representing a lake. Thus, we have 16 grid blocks, where each block can be a start block(S), frozen block(F), goal block(G), or a hole block(H). Thus, the objective of the agent is to learn to navigate from start to goal without falling in the hole:

import Gym
env = Gym.make('FrozenLake-v0') #loads the environment FrozenLake-v0
env.render() # will output the environment and position of the agent

-------------------
S
FFF FHFH FFFH HFFG

At any given state, an agent has four actions to perform, which are up, down, left, and right. The reward at each step is 0 except the one leading to the goal state, then the reward would be 1. We start from the S state and our goal is to reach the G state without landing up in the H state in the most optimized path through the F states.

主站蜘蛛池模板: 凤城市| 铁岭市| 浦县| 武穴市| 雅安市| 彝良县| 兴仁县| 庆城县| 闻喜县| 凉城县| 石景山区| 武川县| 东乡族自治县| 宜丰县| 凌海市| 桐梓县| 友谊县| 灵丘县| 江油市| 新巴尔虎右旗| 万载县| 德昌县| 仙桃市| 博湖县| 长海县| 临沧市| 乌拉特后旗| 长岛县| 蓝山县| 南京市| 邵阳县| 集贤县| 中牟县| 梓潼县| 宁乡县| 仁化县| 达州市| 青海省| 息烽县| 卢氏县| 涪陵区|