def autoencoder_sampler():
     xsamples = n_choice(xtest, 10)
     xrep = np.repeat(xsamples, 9, axis=0)
     xgen = dim_ordering_unfix(autoencoder.predict(xrep)).reshape((10, 9, 3, 32, 32))
     xsamples = dim_ordering_unfix(xsamples).reshape((10, 1, 3, 32, 32))
     samples = np.concatenate((xsamples, xgen), axis=1)
     samples = samples.transpose((0, 1, 3, 4, 2))
     return samples
Exemplo n.º 2
0
 def autoencoder_sampler():
     xsamples = n_choice(xtest, 10)
     xrep = np.repeat(xsamples, 9, axis=0)
     xgen = dim_ordering_unfix(autoencoder.predict(xrep)).reshape(
         (10, 9, 3, 32, 32))
     xsamples = dim_ordering_unfix(xsamples).reshape((10, 1, 3, 32, 32))
     samples = np.concatenate((xsamples, xgen), axis=1)
     samples = samples.transpose((0, 1, 3, 4, 2))
     return samples
Exemplo n.º 3
0
 def fun():
     state = np.random.get_state()
     np.random.seed(0)
     zsamples = np.random.normal(size=(10 * 10, latent_dim))
     np.random.set_state(state)
     images = dim_ordering_unfix(generator.predict(zsamples)).transpose((0, 2, 3, 1))
     return images.reshape((10, 10, 28, 28))
Exemplo n.º 4
0
def generator_skampler(latent_dim, generator):
    zsamples = np.random.normal(size=(10 * 10, latent_dim))
    gen = dim_ordering_unfix(generator.predict(zsamples))
    return gen.reshape((10, 10, 92, 92))
 def generator_sampler():
     xpred = dim_ordering_unfix(generator.predict(zsamples)).transpose((0, 2, 3, 1))
     return xpred.reshape((10, 10) + xpred.shape[1:])
Exemplo n.º 6
0
 def fun():
     zsamples = np.random.normal(size=(10 * 10, latent_dim))
     xpred = dim_ordering_unfix(generator.predict(zsamples)).transpose(
         (0, 2, 3, 1))
     return xpred.reshape((10, 10) + xpred.shape[1:])
Exemplo n.º 7
0
 def fun():
     zsamples = np.random.normal(size=(10 * 10, latent_dim))
     gen = dim_ordering_unfix(generator.predict(zsamples))
     return gen.reshape((10, 10, 28, 28))
Exemplo n.º 8
0
 def generator_sampler():
     xpred = generator.predict(zsamples)
     xpred = dim_ordering_unfix(xpred.transpose((0, 2, 3, 1)))
     return xpred.reshape((10, 10) + xpred.shape[1:])
Exemplo n.º 9
0
 def generator_sampler():
     zsamples = np.random.normal(size=(10 * 10, latent_dim))
     return dim_ordering_unfix(generator.predict(zsamples)).transpose(
         (0, 2, 3, 1)).reshape((10, 10, 32, 32, 3))
 def generator_sampler():
     zsamples = np.random.normal(size=(10 * 10, latent_dim))
     return dim_ordering_unfix(generator.predict(zsamples)).transpose((0, 2, 3, 1)).reshape((10, 10, 32, 32, 3))
Exemplo n.º 11
0
 def generator_sampler():
     images = dim_ordering_unfix(generator.predict(zsamples)).transpose(
         (0, 2, 3, 1))
     images = scale_value(
         images, [0.0, 1.0])  #rescale tanh output to [0, 1] for display
     return images.reshape((10, 10, 28, 28))
Exemplo n.º 12
0
 def fun():
     zsamples = np.random.normal(size=(10 * 10, latent_dim))
     gen = dim_ordering_unfix(generator.predict(zsamples))
     return gen.reshape((10, 10, 28, 28))
Exemplo n.º 13
0
 def generator_sampler():
     xpred = dim_ordering_unfix(generator.predict(zsamples)).transpose((0, 2, 3, 1))
     xpred = scale_value(xpred, [0.0, 1.0])
     return xpred.reshape((10, 10) + xpred.shape[1:])