FastUnifiedInstanceLoss#
- class FastUnifiedInstanceLoss(cost_mask: float = 1.0, cost_dice: float = 1.0, cost_class: float = 0.0, num_points: int = 0, ignore_index: int = -1, loss_weight_focal: float = 1.0, loss_weight_dice: float = 1.0, cls_weight_matched: float = 2.0, cls_weight_noobj: float = 0.1, focal_alpha: float = 0.25, focal_gamma: float = 2.0, truth_label: str = 'instance', segment_key: str = 'segment', aux_loss_weight: float = 1.0, *, query_heads, overlap: bool = False, membership_key: str = 'inst_pe', valid_key: str = 'ring_valid', mask_pe_thresh: float = 0.0, noobj_mask_loss_weight: float = 0.0)[source]#
Bases:
ModuleCombine instance mask/class losses with configured query-head losses.
Non-overlap mode builds masks from per-point instance ids and aggregates each matched instance’s point targets for its query heads. Overlap mode uses the configured multi-hot membership matrix, validity mask, and per-instance head targets.
aux_outputsprovide deep supervision and are scaled byaux_loss_weight.query_headsis a list of named mappings. Continuous heads use a regression criterion; categorical heads use cross-entropy. Each mapping selects its prediction key, target key, target aggregation, and loss weight.