sgnlp.models.ufd.eval.test_ufd¶
-
test_ufd
(test_data: List, adaptor_global: sgnlp.models.ufd.modeling.UFDAdaptorGlobalModel, adaptor_domain: sgnlp.models.ufd.modeling.UFDAdaptorDomainModel, maper: sgnlp.models.ufd.modeling.UFDCombineFeaturesMapModel, model: sgnlp.models.ufd.modeling.UFDClassifierModel, criterion: torch.nn.modules.loss.CrossEntropyLoss, cfg: sgnlp.models.ufd.data_class.UFDArguments) → float[source]¶ Test step method for UFD evaluation
- Parameters
test_data (List) – test dataset embeddings
adaptor_global (UFDAdaptorGlobalModel) – adaptor global model
adaptor_domain (UFDAdaptorDomainModel) – adaptor domain model
maper (UFDCombineFeaturesMapModel) – combine features map model
model (UFDClassifierModel) – classifier model
criterion (torch.nn.CrossEntropyLoss) – cross entropy loss criterion
cfg (UFDArguments) – UFDArguments config load from configuration file
- Returns
loss calculated for the test step
- Return type
float