- 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.
- Apache Hive Essentials
- 城市道路交通主動(dòng)控制技術(shù)
- 21天學(xué)通C#
- Data Wrangling with Python
- STM32嵌入式微控制器快速上手
- 電腦主板現(xiàn)場(chǎng)維修實(shí)錄
- 人工智能趣味入門(mén):光環(huán)板程序設(shè)計(jì)
- 基于神經(jīng)網(wǎng)絡(luò)的監(jiān)督和半監(jiān)督學(xué)習(xí)方法與遙感圖像智能解譯
- 液壓機(jī)智能故障診斷方法集成技術(shù)
- 電氣控制與PLC原理及應(yīng)用(歐姆龍機(jī)型)
- Mastering Ansible(Second Edition)
- 智能制造系統(tǒng)及關(guān)鍵使能技術(shù)
- 樂(lè)高創(chuàng)意機(jī)器人教程(中級(jí) 上冊(cè) 10~16歲) (青少年iCAN+創(chuàng)新創(chuàng)意實(shí)踐指導(dǎo)叢書(shū))
- 軟件測(cè)試設(shè)計(jì)
- Eclipse全程指南