浏览代码

changed path to torch bc module

/develop/add-fire/bc
Andrew Cohen 4 年前
当前提交
22a0cabc
共有 5 个文件被更改,包括 4 次插入8 次删除
  1. 8
      ml-agents/mlagents/trainers/optimizer/torch_optimizer.py
  2. 4
      ml-agents/mlagents/trainers/torch/components/bc/module.py
  3. 0
      ml-agents/mlagents/trainers/torch/components/bc/__init__.py
  4. 0
      /ml-agents/mlagents/trainers/torch/components/bc/module.py

8
ml-agents/mlagents/trainers/optimizer/torch_optimizer.py


from mlagents_envs.base_env import DecisionSteps
from mlagents.trainers.buffer import AgentBuffer
from mlagents.trainers.components.bc.module_torch import TorchBCModule
from mlagents.trainers.torch.components.bc.module import BCModule
from mlagents.trainers.components.reward_signals.extrinsic.signal import (
ExtrinsicRewardSignal,
)

self.memory_out: torch.Tensor = None
self.m_size: int = 0
self.global_step = torch.tensor(0)
self.bc_module: Optional[TorchBCModule] = None
self.bc_module: Optional[BCModule] = None
self.bc_module = TorchBCModule(
self.bc_module = BCModule(
default_batch_size=trainer_settings.hyperparameters.batch_size,
default_num_epoch=3,
)
def update(self, batch: AgentBuffer, num_sequences: int) -> Dict[str, float]:

4
ml-agents/mlagents/trainers/torch/components/bc/module.py


from mlagents.trainers.torch.utils import ModelUtils
class TorchBCModule:
class BCModule:
default_batch_size: int,
default_num_epoch: int,
):
"""
A BC trainer that can be used inline with RL.

0
ml-agents/mlagents/trainers/torch/components/bc/__init__.py

/ml-agents/mlagents/trainers/components/bc/module_torch.py → /ml-agents/mlagents/trainers/torch/components/bc/module.py

正在加载...
取消
保存