- Reinforcement Learning with TensorFlow
- Sayon Dutta
- 178字
- 2021-08-27 18:52:00
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
-------------------
SFFF
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.
- Circos Data Visualization How-to
- 軟件架構設計
- 手把手教你玩轉RPA:基于UiPath和Blue Prism
- 計算機控制技術
- 2018西門子工業專家會議論文集(上)
- 樂高創意機器人教程(中級 下冊 10~16歲) (青少年iCAN+創新創意實踐指導叢書)
- INSTANT Varnish Cache How-to
- PostgreSQL Administration Essentials
- Linux:Powerful Server Administration
- Unity Multiplayer Games
- Excel 2010函數與公式速查手冊
- Apache源代碼全景分析(第1卷):體系結構與核心模塊
- 中文版AutoCAD 2013高手速成
- 大數據素質讀本
- Kubernetes on AWS