Hey all, I saw it recommended to reserve Sequential for only the most trivial networks, but I’m a big fan of the readability/simplicity and I’m trying to keep as much of my network in nn.Sequential as possible.
Is there a simple way to use MaxUnpool2d layers in one Sequential block with respect to the indices from MaxPool2d layers in a previous block?
there isn’t at the moment
Thanks. Are there plans to add more of that kind of support for working in Sequential?
no, we dont plan to make Sequential work on complex networks, it was provided as a one-off convenience container for really simple networks
def forward(self, x):
for layers in self.front_process:
if isinstance(layers, nn.MaxPool2d):
for layers in self.back_process:
if isinstance(layers, nn.MaxUnpool2d):
You can try this to extract maxpool and maxunpool, but I don’t know whether it will influence the speed or not, since I’m quite new to pytorch.