@@ -60,6 +60,21 @@ class TRHashDetectorConfig:
6060 quality_loss_weight : float = 1.0
6161 box_l1_weight : float = 0.25
6262 box_iou_weight : float = 1.0
63+ level_adapters_enabled : bool = False
64+ level_adapter_ratio : float = 0.25
65+ class_level_hash_gate_enabled : bool = False
66+ class_level_gate_temperature : float = 1.0
67+ object_weighting_enabled : bool = False
68+ object_weighting_beta : float = 0.999
69+ object_weighting_max : float = 4.0
70+ level_aux_loss_weight : float = 0.0
71+ gate_calibration_loss_weight : float = 0.0
72+ object_contrastive_loss_weight : float = 0.0
73+ object_contrastive_temperature : float = 0.1
74+ object_contrastive_dim : int = 64
75+ video_motion_enabled : bool = False
76+ video_motion_hidden_size : int = 64
77+ video_motion_scale_init : float = 0.1
6378 dropout : float = 0.0
6479 layer_norm_eps : float = 1e-6
6580
@@ -128,6 +143,30 @@ def __post_init__(self) -> None:
128143 raise ValueError ("progressive_box_start must be in (0, 1]" )
129144 if self .progressive_quality_start < 1.0 :
130145 raise ValueError ("progressive_quality_start must be at least 1" )
146+ if not 0.0 < self .level_adapter_ratio <= 1.0 :
147+ raise ValueError ("level_adapter_ratio must be in (0, 1]" )
148+ if self .class_level_gate_temperature <= 0.0 :
149+ raise ValueError ("class_level_gate_temperature must be positive" )
150+ if not 0.0 <= self .object_weighting_beta < 1.0 :
151+ raise ValueError ("object_weighting_beta must be in [0, 1)" )
152+ if self .object_weighting_max < 1.0 :
153+ raise ValueError ("object_weighting_max must be at least 1" )
154+ if min (
155+ self .level_aux_loss_weight ,
156+ self .gate_calibration_loss_weight ,
157+ self .object_contrastive_loss_weight ,
158+ ) < 0.0 :
159+ raise ValueError ("auxiliary loss weights must be non-negative" )
160+ if self .gate_calibration_loss_weight and not self .class_level_hash_gate_enabled :
161+ raise ValueError ("gate calibration requires class_level_hash_gate_enabled" )
162+ if self .object_contrastive_temperature <= 0.0 :
163+ raise ValueError ("object_contrastive_temperature must be positive" )
164+ if self .object_contrastive_dim <= 0 :
165+ raise ValueError ("object_contrastive_dim must be positive" )
166+ if self .video_motion_hidden_size <= 0 :
167+ raise ValueError ("video_motion_hidden_size must be positive" )
168+ if self .video_motion_scale_init < 0.0 :
169+ raise ValueError ("video_motion_scale_init must be non-negative" )
131170
132171 @property
133172 def grid_size (self ) -> int :
0 commit comments