Skip to content

Commit

Permalink
style: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabgit committed Jun 5, 2023
1 parent ee62295 commit 832b508
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions ivy_models/efficientnet/efficientnetv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def _build(self, *args, **kwargs) -> bool:
)
self.v1 = ivy.BatchNorm2D(self.output_channels)
self.silu = ivy.SiLU()


def _forward(self, x):
return self.silu(self.v1(self.v0(x)))
Expand Down Expand Up @@ -137,23 +136,25 @@ def __init__(
def _build(self, *args, **kwrgs):
self.block = []
if self.expand:
self.block.append(CNNBlock(
self.input_channels,
self.hidden_dim,
kernel_size=1,
stride=1,
padding=self.padding,
training=self.training,
))
self.block.append(
CNNBlock(
self.input_channels,
self.hidden_dim,
kernel_size=1,
stride=1,
padding=self.padding,
training=self.training,
)
)

self.block += [
ivy.DepthwiseConv2D(
self.hidden_dim,
[self.kernel_size, self.kernel_size],
self.stride,
self.padding,
with_bias=False,
),
self.hidden_dim,
[self.kernel_size, self.kernel_size],
self.stride,
self.padding,
with_bias=False,
),
ivy.BatchNorm2D(self.hidden_dim),
ivy.SiLU(),
SqueezeExcitation(self.hidden_dim, self.reduced_dim),
Expand All @@ -164,7 +165,7 @@ def _build(self, *args, **kwrgs):
stride=1,
padding=self.padding,
training=self.training,
)
),
]

def stochastic_depth(self, x):
Expand Down Expand Up @@ -240,9 +241,11 @@ def _build(self, *args, **kwrgs):
in_channels = channels

for args in self.base_model:
out_channels = self.se_reduction_ratio * int(ivy.ceil(
int(args["channels"] * self.width_factor) / self.se_reduction_ratio
).item())
out_channels = self.se_reduction_ratio * int(
ivy.ceil(
int(args["channels"] * self.width_factor) / self.se_reduction_ratio
).item()
)
layers_repeats = int(ivy.ceil(args["repeats"] * self.depth_factor).item())

for layer in range(layers_repeats):
Expand Down

0 comments on commit 832b508

Please sign in to comment.