Update modeling_diffusiondet.py
Browse files- modeling_diffusiondet.py +4 -4
modeling_diffusiondet.py
CHANGED
@@ -128,12 +128,12 @@ class DiffusionDet(PreTrainedModel):
|
|
128 |
|
129 |
def _init_weights(self, module):
|
130 |
if isinstance(module, nn.Linear) or isinstance(module, nn.Conv2d):
|
131 |
-
init.kaiming_normal_(m.weight, mode='fan_in', nonlinearity='relu')
|
132 |
if module.bias is not None:
|
133 |
-
init.constant_(module.bias, 0)
|
134 |
elif isinstance(module, nn.BatchNorm2d):
|
135 |
-
init.constant_(module.weight, 1)
|
136 |
-
init.constant_(module.bias, 0)
|
137 |
|
138 |
def predict_noise_from_start(self, x_t, t, x0):
|
139 |
return (
|
|
|
128 |
|
129 |
def _init_weights(self, module):
|
130 |
if isinstance(module, nn.Linear) or isinstance(module, nn.Conv2d):
|
131 |
+
torch.nn.init.kaiming_normal_(m.weight, mode='fan_in', nonlinearity='relu')
|
132 |
if module.bias is not None:
|
133 |
+
torch.nn.init.constant_(module.bias, 0)
|
134 |
elif isinstance(module, nn.BatchNorm2d):
|
135 |
+
torch.nn.init.constant_(module.weight, 1)
|
136 |
+
torch.nn.init.constant_(module.bias, 0)
|
137 |
|
138 |
def predict_noise_from_start(self, x_t, t, x0):
|
139 |
return (
|