Skip to content

Wrong teacher normalizer input size in StudentTeacherRecurrent #115

@tianzong-cheng

Description

@tianzong-cheng

The teacher normalizer is initialized with rnn_hidden_dim, which I believe is incorrect according to evaluate()

# teacher
if self.teacher_recurrent:
self.memory_t = Memory(
num_teacher_obs, type=rnn_type, num_layers=rnn_num_layers, hidden_size=rnn_hidden_dim
)
num_teacher_obs = rnn_hidden_dim
self.teacher = MLP(num_teacher_obs, num_actions, teacher_hidden_dims, activation)
# teacher observation normalization
self.teacher_obs_normalization = teacher_obs_normalization
if teacher_obs_normalization:
self.teacher_obs_normalizer = EmpiricalNormalization(num_teacher_obs)
else:
self.teacher_obs_normalizer = torch.nn.Identity()

def evaluate(self, obs):
obs = self.get_teacher_obs(obs)
obs = self.teacher_obs_normalizer(obs)
with torch.no_grad():
if self.teacher_recurrent:
self.memory_t.eval()
obs = self.memory_t(obs).squeeze(0)
return self.teacher(obs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions