@ptrblck Thanks for your analysis.

I think the Keras codes called the residual_block twice and it should be something like:

x -> conv -> out -> relu -> bn -> conv -> bn -> relu -> conv -> bn -> conv -> bn -> relu -> conv -> bn ->x
x += out


For my PyTorch implementation, actually I didn’t get my head around how to do the x = x + residual, which you denoted as ‘out’ here because it is not as intuitive as the original paper described that x and out are with difference sizes. So the correct things we should do is something like:

x -> conv -> out -> conv -> bn -> relu -> conv -> bn -> relu -> conv -> bn -> relu -> conv -> bn ->x
x += out

The first conv is just to make sure out can be added to the final x. Then followed by three conv -> bn -> relu with the fourth one without relu. Am I right?

If my understanding is correct, I am not so sure how to implement the first part x -> conv -> out, should I run the out = self.dconv_down11(conv1) first?

Any suggestions would be really appreciated.