• DeepMind Lab的一些python例子—————(Ubuntu22.04系统安装DeepMind Lab)后续


    相关资料:

    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

    ===========================================

  • 相关阅读:
    es6常用语法(持续更新中)
    发送请求时params和data的区别
    js引擎查询 LHS RHS(消化ing)
    Linux常用命令(持续更新)
    Https理解
    MVVM理解
    原生js与jquery区别
    Cookie如何防范XXS攻击
    基于python的appium环境搭建
    pycharm安装步骤
  • 原文地址:https://www.cnblogs.com/devilmaycry812839668/p/16758120.html
Copyright © 2020-2023  润新知