MCPcopy Create free account
hub / github.com/InternRobotics/EmbodiedScan / __call__

Method __call__

embodiedscan/models/losses/match_cost.py:82–92  ·  view source on GitHub ↗

Compute match cost. Args: pred_logits (Tensor): Shape [num_query, C]. gt_logits (Tensor): Shape [num_gt, C]. Returns: Tensor: Match Cost matrix of shape (num_preds, num_gts).

(self, pred_logits: Tensor, gt_logits: Tensor)

Source from the content-addressed store, hash-verified

80 """TokenPredictionCost."""
81
82 def __call__(self, pred_logits: Tensor, gt_logits: Tensor) -> Tensor:
83 """Compute match cost.
84
85 Args:
86 pred_logits (Tensor): Shape [num_query, C].
87 gt_logits (Tensor): Shape [num_gt, C].
88 Returns:
89 Tensor: Match Cost matrix of shape (num_preds, num_gts).
90 """
91 token_map_cost = torch.matmul(pred_logits, gt_logits.transpose(0, 1))
92 return token_map_cost * self.weight
93
94
95@TASK_UTILS.register_module()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected