SDMGRModuleLoss¶
- class mmocr.models.kie.SDMGRModuleLoss(weight_node=1.0, weight_edge=1.0, ignore_idx=- 100)[source]¶
The implementation the loss of key information extraction proposed in the paper: Spatial Dual-Modality Graph Reasoning for Key Information Extraction.
- Parameters
- Return type
- forward(preds, data_samples)[source]¶
Forward function.
- Parameters
preds (tuple(Tensor, Tensor)) –
data_samples (list[KIEDataSample]) – A list of datasamples containing
gt_instances.labelsandgt_instances.edge_labels.
- Returns
Loss dict, containing
loss_node,loss_edge,acc_nodeandacc_edge.- Return type