Upload modeling_diffusiondet.py
Browse files- modeling_diffusiondet.py +3 -0
modeling_diffusiondet.py
CHANGED
@@ -126,6 +126,9 @@ class DiffusionDet(PreTrainedModel):
|
|
126 |
|
127 |
self.criterion = CriterionDynamicK(config, num_classes=self.num_classes, weight_dict=weight_dict)
|
128 |
|
|
|
|
|
|
|
129 |
def predict_noise_from_start(self, x_t, t, x0):
|
130 |
return (
|
131 |
(extract(self.sqrt_recip_alphas_cumprod, t, x_t.shape) * x_t - x0) /
|
|
|
126 |
|
127 |
self.criterion = CriterionDynamicK(config, num_classes=self.num_classes, weight_dict=weight_dict)
|
128 |
|
129 |
+
def _init_weights(self, module):
|
130 |
+
torch.nn.init.xavier_uniform(module.weight)
|
131 |
+
|
132 |
def predict_noise_from_start(self, x_t, t, x0):
|
133 |
return (
|
134 |
(extract(self.sqrt_recip_alphas_cumprod, t, x_t.shape) * x_t - x0) /
|