(name, l, block_func, features, count, stride)
| 53 | |
| 54 | |
| 55 | def preact_group(name, l, block_func, features, count, stride): |
| 56 | with tf.variable_scope(name): |
| 57 | for i in range(0, count): |
| 58 | with tf.variable_scope('block{}'.format(i)): |
| 59 | # first block doesn't need activation |
| 60 | l = block_func(l, features, |
| 61 | stride if i == 0 else 1, |
| 62 | 'no_preact' if i == 0 else 'bnrelu') |
| 63 | # end of each group need an extra activation |
| 64 | l = BNReLU('bnlast', l) |
| 65 | return l |
| 66 | # ----------------- pre-activation resnet ---------------------- |
| 67 | |
| 68 |