DeepMind Lab的一些python例子—————(Ubuntu22.04系统安装DeepMind Lab)后续
相关资料:
Ubuntu22.04系统安装DeepMind Lab
======================================================
关于DeepMind Lab的安装见前文:
Ubuntu22.04系统安装DeepMind Lab
import deepmind_lab import numpy as np # Create a new environment object. lab = deepmind_lab.Lab("demos/extra_entities", ['RGB_INTERLEAVED'], {'fps': '30', 'width': '80', 'height': '60'}) lab.reset(seed=1) # Execute 100 walk-forward steps and sum the returned rewards from each step. print(sum([lab.step(np.array([0,0,0,1,0,0,0], dtype=np.intc)) for i in range(0, 100)]))
import deepmind_lab import numpy as np # Construct and start the environment. env = deepmind_lab.Lab('seekavoid_arena_01', ['RGB_INTERLEAVED']) env.reset() # Create all-zeros vector for actions. action = np.zeros([7], dtype=np.intc) # Advance the environment 4 frames while executing the all-zeros action. reward = env.step(action, num_steps=4) # Retrieve the observations of the environment in its new state. obs = env.observations() # dict of Numpy arrays rgb_i = obs['RGB_INTERLEAVED'] assert rgb_i.shape == (240, 320, 3)
import deepmind_lab import pprint env = deepmind_lab.Lab('seekavoid_arena_01', []) observation_spec = env.observation_spec() pprint.pprint(observation_spec)
===========================================================
Actions的说明:
https://github.com/deepmind/lab/blob/master/docs/users/actions.md
Look left/right and up/down values are in the units 'pixels' and are the number of pixels the mouse would move running at 640x480 at 60 frames per second. (With default mouse speed etc.) (A value of about 57 will rotate the player 360 degrees in one second of game time.)
===========================================
Observations说明:
https://github.com/deepmind/lab/blob/master/docs/users/observations.md
===========================================
posted on 2022-10-06 17:56 Angry_Panda 阅读(79) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· 因为Apifox不支持离线,我果断选择了Apipost!