浏览代码

fix test tf policy

/develop/actionmodel-csharp
Andrew Cohen 4 年前
当前提交
85b18389
共有 2 个文件被更改,包括 2 次插入3 次删除
  1. 3
      ml-agents/mlagents/trainers/policy/tf_policy.py
  2. 2
      ml-agents/mlagents/trainers/tests/tensorflow/test_tf_policy.py

3
ml-agents/mlagents/trainers/policy/tf_policy.py


from mlagents.tf_utils import tf
from mlagents import tf_utils
from mlagents_envs.exception import UnityException
from mlagents_envs.base_env import BehaviorSpec
from mlagents_envs.logging_util import get_logger
from mlagents.trainers.policy import Policy
from mlagents.trainers.action_info import ActionInfo

from mlagents_envs.base_env import DecisionSteps, ActionTuple
from mlagents_envs.base_env import DecisionSteps, ActionTuple, BehaviorSpec
from mlagents.trainers.tf.models import ModelUtils
from mlagents.trainers.settings import TrainerSettings, EncoderType
from mlagents.trainers import __version__

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


behavior_spec = basic_behavior_spec()
policy = FakePolicy(test_seed, behavior_spec, TrainerSettings(), "output")
policy_eval_out = {
"action": {"continuous_action": np.array([1.0], dtype=np.float32)},
"action": np.array([[1.0]], dtype=np.float32),
"memory_out": np.array([[2.5]], dtype=np.float32),
"value": np.array([1.1], dtype=np.float32),
}

正在加载...
取消
保存