Skip to content

Teacher MLP Input Dimension Mismatch When Teacher is Non-Recurrent #133

@Passutte

Description

@Passutte

In StudentTeacherRecurrent.init, when teacher_recurrent=False, the teacher MLP is initialized with the wrong input dimension. This bug was introduced in #116.

if self.teacher_recurrent:
    self.memory_t = Memory(
        num_teacher_obs, type=rnn_type, num_layers=rnn_num_layers, hidden_size=rnn_hidden_dim
    )
self.teacher = MLP(rnn_hidden_dim, num_actions, teacher_hidden_dims, activation)

Proposed fix:

# 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
    )
    teacher_input_dim = rnn_hidden_dim
else:
    teacher_input_dim = num_teacher_obs
self.teacher = MLP(teacher_input_dim, num_actions, teacher_hidden

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions