jpterry commited on
Commit
1fd3ca4
·
1 Parent(s): fa086f5
Files changed (1) hide show
  1. model_utils/efficientnet_config.py +14 -15
model_utils/efficientnet_config.py CHANGED
@@ -292,21 +292,7 @@ class EfficientNetConfig(PretrainedConfig):
292
  self.depth_mult=depth_mult
293
 
294
  super().__init__(**kwargs)
295
-
296
-
297
- def _init_weights(self, module):
298
- # initialize weights before loading
299
- # not all will have weights and biases
300
- try:
301
- module.weight.data.normal_(mean=0.0)
302
- except AttributeError:
303
- _ = None
304
- try:
305
- module.bias.data.zero_()
306
- except AttributeError:
307
- _ = None
308
-
309
-
310
 
311
  class EfficientNetPreTrained(PreTrainedModel):
312
 
@@ -328,6 +314,19 @@ class EfficientNetPreTrained(PreTrainedModel):
328
  def forward(self, tensor):
329
  return self.model.forward(tensor)
330
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
 
332
  class EfficientNet(nn.Module):
333
 
 
292
  self.depth_mult=depth_mult
293
 
294
  super().__init__(**kwargs)
295
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
 
297
  class EfficientNetPreTrained(PreTrainedModel):
298
 
 
314
  def forward(self, tensor):
315
  return self.model.forward(tensor)
316
 
317
+
318
+ def _init_weights(self, module):
319
+ # initialize weights before loading
320
+ # not all will have weights and biases
321
+ try:
322
+ module.weight.data.normal_(mean=0.0)
323
+ except AttributeError:
324
+ _ = None
325
+ try:
326
+ module.bias.data.zero_()
327
+ except AttributeError:
328
+ _ = None
329
+
330
 
331
  class EfficientNet(nn.Module):
332