vae.autoencoder

Classes

KLDivergenceLayer

Custom layer to compute and add KL divergence to the model's loss.

VAE

VAE represents a Deep Convolutional variational autoencoder architecture

Functions

sample_point_from_normal_distribution(args)

Sampling function using the reparameterization trick.

Module Contents

vae.autoencoder.sample_point_from_normal_distribution(args)

Sampling function using the reparameterization trick.

class vae.autoencoder.KLDivergenceLayer

Bases: tensorflow.keras.layers.Layer

Custom layer to compute and add KL divergence to the model’s loss.

call(inputs)
class vae.autoencoder.VAE(input_shape, conv_filters, conv_kernels, conv_strides, latent_space_dim)

VAE represents a Deep Convolutional variational autoencoder architecture with mirrored encoder and decoder components.

input_shape
conv_filters
conv_kernels
conv_strides
latent_space_dim
reconstruction_loss_weight = 10000
encoder = None
decoder = None
model = None
_num_conv_layers
_shape_before_bottleneck = None
_model_input = None
summary()
compile(learning_rate=0.0001)
train(x_train, batch_size, num_epochs)
save(save_folder='.')
load_weights(weights_path)
reconstruct(images)
classmethod load(save_folder='.')
_calculate_combined_loss(y_target, y_predicted)
_calculate_reconstruction_loss(y_target, y_predicted)
_create_folder_if_it_doesnt_exist(folder)
_save_parameters(save_folder)
_save_weights(save_folder)
_build()
_build_autoencoder()
_build_decoder()
_add_decoder_input()
_add_dense_layer(decoder_input)
_add_reshape_layer(dense_layer)
_add_conv_transpose_layers(x)
_add_conv_transpose_layer(layer_index, x)
_add_decoder_output(x)
_build_encoder()
_add_encoder_input()
_add_conv_layers(encoder_input)
_add_conv_layer(layer_index, x)
_add_bottleneck(x)