IBM/aihwkit

Missing resnet layer in example 18

Closed this issue · 1 comments

Description

Resnet34 has 4 intermediate layers which consist of (3,4,6,3) blocks per each layer. However, last layer with 3 blocks does not exist.

How to reproduce

`
def create_model():

block_per_layers = (3, 4, 6, 3)
base_channel = 16
channel = (base_channel, 2*base_channel, 4*base_channel)

l0 = nn.Sequential(
    nn.Conv2d(3, channel[0], kernel_size=3, stride=1, padding=1),
    nn.BatchNorm2d(channel[0]),
    nn.ReLU()
)

l1 = nn.Sequential(*concatenate_layer_blocks(channel[0], channel[0], block_per_layers[0],
                                             first_layer=True))
l2 = nn.Sequential(*concatenate_layer_blocks(channel[0], channel[1], block_per_layers[1]))
l3 = nn.Sequential(*concatenate_layer_blocks(channel[1], channel[2], block_per_layers[2]))
l4 = nn.Sequential(
    nn.AdaptiveAvgPool2d((1, 1)),
    nn.Flatten(),
    nn.Linear(channel[2], N_CLASSES)
)

return nn.Sequential(l0, l1, l2, l3, l4)

`

Expected behavior

Wrong resnet structure is implemented.

Other information

examples/18_cifar10_on_resnet.py create_model() 106-133 line

  • Pytorch version:
  • Package version:
  • OS:
  • Python version:
  • Conda version (or N/A):

Thanks @bus6479. You are correct, it is not resnet34 but rather a resnet-inspired example, as also indicated in the citation.