Exemplo n.º 1
0
 def _concat(z, z_, _a):
     feats = [z]
     if z_ is not None:
         feats.append(z_)
     if _a is not None:
         _a = tf.reshape(_a, [-1, 1, 1, tl.shape(_a)[-1]])
         _a = tf.tile(_a, [1, tl.shape(z)[1], tl.shape(z)[2], 1])
         feats.append(_a)
     return tf.concat(feats, axis=3)
Exemplo n.º 2
0
    def _concat(x, a):
        images = x
        atts = a
        feats = [images]
        atts = tf.reshape(atts, [tl.shape(atts)[-1], 1, 1, -1])
        atts = tf.tile(atts, [1, tl.shape(images)[1], tl.shape(images)[2], 1])
        feats.append(atts)

        return tf.concat(feats, axis=3)
Exemplo n.º 3
0
    def _concat(encoded_input, next_input, labels):
        features = [encoded_input]
        if next_input is not None:
            features.append(next_input)
        if labels is not None:
            labels = tf.reshape(labels, [-1, 1, 1, tl.shape(labels)[-1]])
            labels = tf.tile(
                labels,
                [1,
                 tl.shape(encoded_input)[1],
                 tl.shape(encoded_input)[2], 1])

            # append to list
            features.append(labels)

            # concat the feature on the last channel
        return tf.concat(features, axis=3)