(l, n_out, stride, activation=tf.identity)
| 122 | |
| 123 | |
| 124 | def resnet_shortcut(l, n_out, stride, activation=tf.identity): |
| 125 | n_in = l.shape[1] |
| 126 | if n_in != n_out: # change dimension when channel is not the same |
| 127 | # TF's SAME mode output ceil(x/stride), which is NOT what we want when x is odd and stride is 2 |
| 128 | # In FPN mode, the images are pre-padded already. |
| 129 | if not cfg.MODE_FPN and stride == 2: |
| 130 | l = l[:, :, :-1, :-1] |
| 131 | return Conv2D('convshortcut', l, n_out, 1, |
| 132 | strides=stride, activation=activation) |
| 133 | else: |
| 134 | return l |
| 135 | |
| 136 | |
| 137 | def resnet_bottleneck(l, ch_out, stride): |
no test coverage detected
searching dependent graphs…