コード例 #1
0
def make_conv1():
    latent_dim = 16
    x_shape = (128, 54)
    huzz = HuzzerSource()
    data_pipeline = OneHotVecotorizer(TokenDatasource(huzz), x_shape[1],
                                      x_shape[0])

    decoder_input = tf.placeholder(tf.float32,
                                   shape=(1, latent_dim),
                                   name='decoder_input')
    with conv_arg_scope():
        encoder_input = tf.placeholder(tf.float32,
                                       shape=(1, *x_shape),
                                       name='encoder_input')
        encoder_output, _ = build_conv1_encoder(encoder_input, latent_dim)

        decoder_output = build_conv1_decoder(decoder_input, x_shape)
        decoder_output = tf.reshape(decoder_output, x_shape)

    return data_pipeline, encoder_input, encoder_output, decoder_input, decoder_output
コード例 #2
0
def make_special_conv():
    latent_dim = 64
    x_shape = (128, 54)
    huzz = HuzzerSource()
    data_pipeline = OneHotVecotorizer(TokenDatasource(huzz), x_shape[1],
                                      x_shape[0])

    decoder_input = tf.placeholder(tf.float32,
                                   shape=(1, latent_dim),
                                   name='decoder_input')
    encoder_input = tf.placeholder(tf.float32,
                                   shape=(1, *x_shape),
                                   name='encoder_input')
    with conv_arg_scope():
        encoder_output, _ = build_special_conv_encoder(encoder_input,
                                                       latent_dim)
        decoder_output = build_special_conv_decoder(decoder_input, x_shape)
        decoder_output = tf.nn.softmax(decoder_output, dim=-1)
        decoder_output = tf.squeeze(decoder_output, 0)

    return data_pipeline, encoder_input, encoder_output, decoder_input, decoder_output