def build_model(network_type, **kwargs): if network_type == 'resnet18': model = nets.ResNet18FilmAction( kwargs['action_space_dim'], fusion_place=kwargs['fusion_place'], action_hidden_size=kwargs['action_hidden_size'], action_layers=kwargs['action_layers']) elif network_type == 'simple': model = nets.SimpleNetWithAction(kwargs['action_space_dim']) else: raise ValueError('Unknown network type: %s' % network_type) return model
def _build_model(self, network_type, action_space_dim, action_hidden_size): if network_type == 'resnet18': model = nets.ResNet18FilmAction( action_size=action_space_dim, action_hidden_size=action_hidden_size) # Our model elif network_type == 'resnet18_qa': model = nets.ResNet18PhysicalQA( action_size=action_space_dim, action_hidden_size=action_hidden_size) else: raise ValueError('Unknown network type: %s' % network_type) return model