예제 #1
0
 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')
예제 #2
0
 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
예제 #3
0
 def __init__(self, model: Model, patience: int):
     super().__init__(model=model, optimizer=optim.Adam(lr=1.0, params=model.parameters()))
     self.patience = patience
예제 #4
0
 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