MamaPearl commited on
Commit
39f47a1
·
verified ·
1 Parent(s): d0057f2

Update modeling_nula.py

Browse files
Files changed (1) hide show
  1. modeling_nula.py +4 -4
modeling_nula.py CHANGED
@@ -55,7 +55,7 @@ class SEBlock(nn.Module):
55
  return x * z
56
 
57
 
58
- class NULAConvBlock(nn.Module):
59
  def __init__(self, in_ch, out_ch, downsample=False, use_se=False, se_reduction=16):
60
  super().__init__()
61
  stride = 1
@@ -122,9 +122,9 @@ class NulaForImageClassification(PreTrainedModel):
122
  self.stem_bn = nn.BatchNorm2d(c1)
123
  self.stem_act = nn.SiLU(inplace=True)
124
 
125
- self.s1 = NULAConvBlock(c1, c1, False, config.use_se, config.se_reduction)
126
- self.s2 = NULAConvBlock(c1, c2, True, config.use_se, config.se_reduction)
127
- self.s3 = NULAConvBlock(c2, c3, True, config.use_se, config.se_reduction)
128
  self.global_pool = nn.AdaptiveAvgPool2d((1,1))
129
  self.head = nn.Sequential(
130
  nn.Linear(c3, config.classifier_hidden_dim),
 
55
  return x * z
56
 
57
 
58
+ class NulaConvBlock(nn.Module):
59
  def __init__(self, in_ch, out_ch, downsample=False, use_se=False, se_reduction=16):
60
  super().__init__()
61
  stride = 1
 
122
  self.stem_bn = nn.BatchNorm2d(c1)
123
  self.stem_act = nn.SiLU(inplace=True)
124
 
125
+ self.s1 = NulaConvBlock(c1, c1, False, config.use_se, config.se_reduction)
126
+ self.s2 = NulaConvBlock(c1, c2, True, config.use_se, config.se_reduction)
127
+ self.s3 = NulaConvBlock(c2, c3, True, config.use_se, config.se_reduction)
128
  self.global_pool = nn.AdaptiveAvgPool2d((1,1))
129
  self.head = nn.Sequential(
130
  nn.Linear(c3, config.classifier_hidden_dim),