|
|
|
|
|
|
expert_actions: torch.Tensor, |
|
|
|
) -> torch.Tensor: |
|
|
|
bc_loss = 0 |
|
|
|
if self.policy.action_spec.continuous_size > 0: |
|
|
|
if self.policy.behavior_spec.action_spec.continuous_size > 0: |
|
|
|
if self.policy.action_spec.discrete_size > 0: |
|
|
|
if self.policy.behavior_spec.action_spec.discrete_size > 0: |
|
|
|
self.policy.action_spec.discrete_branches, |
|
|
|
self.policy.behavior_spec.action_spec.discrete_branches, |
|
|
|
) |
|
|
|
|
|
|
|
log_prob_branches = ModelUtils.break_into_branches( |
|
|
|
|
|
|
vec_obs = [ModelUtils.list_to_tensor(mini_batch_demo["vector_obs"])] |
|
|
|
act_masks = None |
|
|
|
expert_actions = AgentAction.from_dict(mini_batch_demo) |
|
|
|
if self.policy.action_spec.discrete_size > 0: |
|
|
|
if self.policy.behavior_spec.action_spec.discrete_size > 0: |
|
|
|
act_masks = ModelUtils.list_to_tensor( |
|
|
|
np.ones( |
|
|
|
( |
|
|
|