def block(x, in_dim, out_dim, i):
                with tf.variable_scope('block_{}'.format(i)):
                    z = nn.build_residual_block(x, in_dim)
                    tmp = nn.build_fc_layer(z, lrelu, in_dim, out_dim)
                    with tf.variable_scope('residual_block'):
                        self.embedding_ops.append(z)
                    with tf.variable_scope('fc_block'):
                        self.embedding_ops.append(tmp)

                    return tf.nn.dropout(tmp, self.keep_prob)
Exemple #2
0
            def build_block(x, _in, _out):
                z = x

                for i in range(self.res_depth):
                    with tf.variable_scope('fc_layer_{}'.format(i)):
                        f = tf.nn.dropout(
                            nn.build_fc_layer(
                                z, lrelu, _in, _in, self.reg_param
                            ),
                            self.keep_prob
                        )

                        z = f + z

                return tf.nn.dropout(
                    nn.build_fc_layer(
                        z, lrelu, _in, _out, self.reg_param
                    ),
                    self.keep_prob
                )
Exemple #3
0
        def block(x, in_dim, out_dim, i):
            with tf.variable_scope('block_{}'.format(i)):
                z = x
                for j in range(2):
                    with tf.variable_scope('res_block_{}'.format(j)):
                        z = nn.build_residual_block(z, lrelu, in_dim)
                        z = tf.nn.dropout(z, keep_prob)

                z = nn.build_fc_layer(z, lrelu, in_dim, out_dim)

                return tf.nn.dropout(z, keep_prob)
Exemple #4
0
            def block(x, in_dim, out_dim, i):
                with tf.variable_scope('block_{}'.format(i)):
                    z = x
                    for j in range(self.res_depth):
                        with tf.variable_scope('res_block_{}'.format(j)):
                            z = nn.build_residual_block(
                                z, lrelu, in_dim, self.reg_param
                            )
                            with tf.variable_scope('residual_block'):
                                self.embedding_ops.append(z)
                            z = tf.nn.dropout(z, self.keep_prob)

                    z = nn.build_fc_layer(
                        z, lrelu, in_dim, out_dim, self.reg_param
                    )

                    with tf.variable_scope('fc_block'):
                        self.embedding_ops.append(z)

                    if i < len(sizes) - 2:
                        z = tf.nn.dropout(z, self.keep_prob)

                    return z
 def block(x, in_dim, out_dim, i):
     with tf.variable_scope('block_{}'.format(i)):
         z = nn.build_residual_block(x, in_dim)
         return nn.build_fc_layer(z, lrelu, in_dim, out_dim)