Skip to content

Commit 0b1887b

Browse files
author
ayasyrev
committed
v 0.0.3 Fixed Blocks, models, rearranged modules
1 parent 37468ed commit 0b1887b

22 files changed

+6279
-1119
lines changed

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ model = resnet50(num_classes=10)
9191

9292
# Predefined Xresnet from fastai 1.
9393

94-
This ie simplified version from fastai v1. I did refactoring for better understand and experime with models. For example, change activation funtions, different stems, batchnorm and activation order etc. In v2 much powerfull realisation.
94+
This ie simplified version from fastai v1. I did refactoring for better understand and experiment with models. For example, it's very simple to change activation funtions, different stems, batchnorm and activation order etc. In v2 much powerfull realisation.
9595
<div class="codecell" markdown="1">
9696
<div class="input_area" markdown="1">
9797

@@ -113,7 +113,7 @@ model = xresnet50()
113113

114114
</div>
115115

116-
# Some examples
116+
# Some examples.
117117

118118
We can experiment with models by changing some parts of model. Here only base functionality, but it can be easily extanded.
119119

@@ -248,8 +248,8 @@ model.stem
248248
sizes: [3, 64]
249249
(conv0): ConvLayer(
250250
(conv): Conv2d(3, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
251-
(bn): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
252251
(act_fn): ReLU(inplace=True)
252+
(bn): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
253253
)
254254
(pool): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
255255
)
@@ -266,7 +266,7 @@ model.stem
266266
<div class="input_area" markdown="1">
267267

268268
```python
269-
act_fn = nn.LeakyReLU(inplace=True)
269+
new_act_fn = nn.LeakyReLU(inplace=True)
270270
```
271271

272272
</div>
@@ -276,7 +276,7 @@ act_fn = nn.LeakyReLU(inplace=True)
276276
<div class="input_area" markdown="1">
277277

278278
```python
279-
model = Net(act_fn=act_fn)
279+
model = Net(act_fn=new_act_fn)
280280
```
281281

282282
</div>
@@ -314,7 +314,7 @@ model.stem
314314
<div class="input_area" markdown="1">
315315

316316
```python
317-
model.body.layer_0.block_0.conv.conv_0
317+
model.body.layer_0.block_0
318318
```
319319

320320
</div>
@@ -323,10 +323,20 @@ model.body.layer_0.block_0.conv.conv_0
323323

324324

325325

326-
ConvLayer(
327-
(conv): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
328-
(act_fn): LeakyReLU(negative_slope=0.01, inplace=True)
329-
(bn): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
326+
BasicBlock(
327+
(conv): Sequential(
328+
(conv_0): ConvLayer(
329+
(conv): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
330+
(bn): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
331+
(act_fn): LeakyReLU(negative_slope=0.01, inplace=True)
332+
)
333+
(conv_1): ConvLayer(
334+
(conv): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
335+
(bn): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
336+
)
337+
)
338+
(merge): Noop()
339+
(act_conn): LeakyReLU(negative_slope=0.01, inplace=True)
330340
)
331341

332342

docs/_data/sidebars/home_sidebar.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ entries:
2121
- output: web,pdf
2222
title: xresnet
2323
url: /xresnet
24+
- output: web,pdf
25+
title: Layers_tests
26+
url: /test_layers
2427
output: web
2528
title: model_constructor
2629
output: web

0 commit comments

Comments
 (0)