Exemplo n.º 1
0
 def create_model(cls, **kwargs) -> nn.Module:
     sensors = cls.get_sensors()
     return BabyAIRecurrentACModel(
         action_space=gym.spaces.Discrete(
             len(BabyAITask.class_action_names())),
         observation_space=SensorSuite(sensors).observation_spaces,
         use_instr=cls.USE_INSTR,
         use_memory=True,
         arch=cls.ARCH,
     )
Exemplo n.º 2
0
    def get_sensors(cls) -> Sequence[Sensor]:
        assert cls.USE_INSTR is not None

        return ([
            EgocentricMiniGridSensor(agent_view_size=cls.AGENT_VIEW_SIZE,
                                     view_channels=3),
        ] + ([MiniGridMissionSensor(instr_len=cls.INSTR_LEN)]  # type:ignore
             if cls.USE_INSTR else []) + ([
                 ExpertActionSensor(  # type: ignore
                     nactions=len(BabyAITask.class_action_names()))
             ] if cls.USE_EXPERT else []))
Exemplo n.º 3
0
 def create_model(cls, **kwargs) -> nn.Module:
     sensors = cls.get_sensors()
     return BabyAIRecurrentACModel(
         action_space=gym.spaces.Discrete(
             len(BabyAITask.class_action_names())),
         observation_space=SensorSuite(sensors).observation_spaces,
         use_instr=cls.USE_INSTR,
         use_memory=True,
         arch=cls.ARCH,
         instr_dim=256,
         lang_model="attgru",
         memory_dim=2048,
         include_auxiliary_head=cls.INCLUDE_AUXILIARY_HEAD,
     )