def test_abstract(self): """Test that classes are checked as abstract properly.""" self.assertTrue(Model._is_abstract()) self.assertTrue(EntityEmbeddingModel._is_abstract()) self.assertTrue(EntityRelationEmbeddingModel._is_abstract()) for model_cls in _MODELS: if issubclass(model_cls, MultimodalModel): continue self.assertFalse(model_cls._is_abstract(), msg=f'{model_cls.__name__} should not be abstract')
def __init__(self, model: Model, patience: int, automatic_memory_optimization: bool = False): super().__init__( model=model, optimizer=optim.Adam(lr=1.0, params=model.parameters()), automatic_memory_optimization=automatic_memory_optimization, ) self.patience = patience
def __init__(self, model: Model, patience: int): super().__init__(model=model, optimizer=optim.Adam(lr=1.0, params=model.parameters())) self.patience = patience
def __init__(self, model: Model, sub_batch_size: int): super().__init__(model=model, optimizer=optim.Adam(lr=1.0, params=model.parameters())) self.sub_batch_size = sub_batch_size