相关资料:
Ubuntu22.04系统安装DeepMind Lab
======================================================
关于DeepMind Lab的安装见前文:
Ubuntu22.04系统安装DeepMind Lab
DeepMind Lab的python文档:
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
===========================================