(code, name='')
| 134 | return features |
| 135 | |
| 136 | def create_decoder(code, name=''): |
| 137 | Nin = args.NFEAT + args.code_nfts |
| 138 | Nout = args.NFEAT |
| 139 | bn = True |
| 140 | N0 = int(args.tarch[0]) |
| 141 | nlevels = len(args.tarch) |
| 142 | with tf.variable_scope('decoder_%s'%(name), reuse=tf.AUTO_REUSE): |
| 143 | level0 = mlp(code, [256, 64, args.NFEAT * N0], args.phase, bn=True) |
| 144 | level0 = tf.tanh(level0, name='tanh_0') |
| 145 | level0 = tf.reshape(level0, [-1, N0, args.NFEAT]) |
| 146 | outs = [level0, ] |
| 147 | for i in range(1, nlevels): |
| 148 | if i == nlevels - 1: |
| 149 | Nout = 3 |
| 150 | bn = False |
| 151 | inp = outs[-1] |
| 152 | y = tf.expand_dims(code, 1) |
| 153 | y = tf.tile(y, [1, tf.shape(inp)[1], 1]) |
| 154 | y = tf.concat([inp, y], 2) |
| 155 | outs.append(tf.tanh(create_level(i, Nin, Nout, y, bn), name='tanh_%d' % (i))) |
| 156 | |
| 157 | return outs[-1] |
nothing calls this directly
no test coverage detected