July 2019
Intermediate to advanced
512 pages
19h 39m
English
Define the sampling operation with a reparameterization trick that samples the latent vector from the encoder's distribution:
def sampling(args): z_mean, z_log_var = args epsilon = K.random_normal(shape=(K.shape(z_mean)[0], latent_dim), mean=0., stddev=epsilon_std) return z_mean + K.exp(z_log_var / 2) * epsilon
Sample the latent vector z from the mean and variance:
z = Lambda(sampling, output_shape=(latent_dim,))([z_mean, z_log_var])
Read now
Unlock full access