- 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.
- OpenStack for Architects
- Mastering Salesforce CRM Administration
- 返璞歸真:UNIX技術(shù)內(nèi)幕
- Google App Inventor
- 群體智能與數(shù)據(jù)挖掘
- PyTorch深度學(xué)習(xí)實(shí)戰(zhàn)
- 基于32位ColdFire構(gòu)建嵌入式系統(tǒng)
- 單片機(jī)技術(shù)一學(xué)就會(huì)
- Visual FoxPro程序設(shè)計(jì)
- INSTANT VMware vCloud Starter
- 筆記本電腦使用與維護(hù)
- 貫通Java Web輕量級(jí)應(yīng)用開發(fā)
- 運(yùn)動(dòng)控制系統(tǒng)
- 工業(yè)機(jī)器人應(yīng)用系統(tǒng)三維建模
- 巧學(xué)活用Photoshop