Skip to content

Commit 3242c05

Browse files
authored
Merge pull request #121 from ayasyrev:models_yaresnet
yaresnet26
2 parents e166cd9 + d95d9dc commit 3242c05

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/model_constructor/model_constructor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333

3434

35-
nnModule = Union[Type[nn.Module], Callable[[], nn.Module]]
35+
nnModule = Union[Type[nn.Module], Callable[[Any], nn.Module]]
3636

3737

3838
class ModelCfg(Cfg, arbitrary_types_allowed=True, extra="forbid"):

src/model_constructor/xresnet.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class XResNet34(XResNet):
5050
layers: List[int] = [3, 4, 6, 3]
5151

5252

53-
class XResNet50(XResNet34):
53+
class XResNet26(XResNet):
5454
block: Type[nn.Module] = BottleneckBlock
5555
block_sizes: List[int] = [256, 512, 1024, 2048]
56+
expansion: int = 4
57+
58+
59+
class XResNet50(XResNet26):
60+
layers: List[int] = [3, 4, 6, 3]

src/model_constructor/yaresnet.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ class YaResNet34(YaResNet):
216216
layers: List[int] = [3, 4, 6, 3]
217217

218218

219-
class YaResNet50(YaResNet34):
219+
class YaResNet26(YaResNet):
220220
block: Type[nn.Module] = YaBottleneckBlock
221221
block_sizes: List[int] = [256, 512, 1024, 2048]
222+
expansion: int = 4
223+
224+
225+
class YaResNet50(YaResNet26):
226+
layers: List[int] = [3, 4, 6, 3]

0 commit comments

Comments
 (0)