Created
July 28, 2021 19:53
-
-
Save a-agmon/7417d1e1c5cc70a5d15b5204aef05882 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoder model | |
inputs = Input(shape=input_shape, name='encoder_input') | |
x = Dense(intermediate_dim, activation='relu')(inputs) | |
z_mean = Dense(latent_dim, name='z_mean')(x) | |
z_log_var = Dense(latent_dim, name='z_log_var')(x) | |
# use the reparameterization trick and get the output from the sample() function | |
z = Lambda(sample, output_shape=(latent_dim,), name='z')([z_mean, z_log_var]) | |
encoder = Model(inputs, z, name='encoder') | |
encoder.summary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment