浏览代码

add docstrings

/develop/action-spec-gym
Andrew Cohen 4 年前
当前提交
dca09bd9
共有 2 个文件被更改,包括 22 次插入1 次删除
  1. 21
      ml-agents-envs/mlagents_envs/base_env.py
  2. 2
      ml-agents/mlagents/trainers/tests/tensorflow/test_simple_rl.py

21
ml-agents-envs/mlagents_envs/base_env.py


@property
def discrete_branches(self) -> Tuple[int, ...]:
"""
Returns a Tuple of int corresponding to the number of possible actions
for each branch (only for discrete actions). Will return None in
for continuous actions.
"""
"""
Returns a an int corresponding to the number of discrete branches.
"""
"""
Returns a an int corresponding to the number of continuous actions.
"""
"""
Generates a numpy array corresponding to an empty action (all zeros)
for a number of agents.
:param n_agents: The number of agents that will have actions generated
"""
"""
Generates a numpy array corresponding to a random action (either discrete
or continuous) for a number of agents.
:param n_agents: The number of agents that will have actions generated
"""
if self.is_continuous():
action = np.random.uniform(
low=-1.0, high=1.0, size=(n_agents, self.continuous_size)

2
ml-agents/mlagents/trainers/tests/tensorflow/test_simple_rl.py


PPO_TF_CONFIG,
hyperparameters=new_hyperparams,
network_settings=new_networksettings,
max_steps=500,
max_steps=450,
summary_freq=100,
framework=FrameworkType.TENSORFLOW,
)

正在加载...
取消
保存