Created
March 16, 2019 07:09
-
-
Save AFAgarap/1456f9984131d2cf0fe9eb34adf788fe to your computer and use it in GitHub Desktop.
TensorFlow 2.0 implementation of a vanilla autoencoder model.
This file contains 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
class Autoencoder(tf.keras.Model): | |
def __init__(self, intermediate_dim, original_dim): | |
super(Autoencoder, self).__init__() | |
self.encoder = Encoder(intermediate_dim=intermediate_dim) | |
self.decoder = Decoder(intermediate_dim=intermediate_dim, original_dim=original_dim) | |
def call(self, input_features): | |
code = self.encoder(input_features) | |
reconstructed = self.decoder(code) | |
return reconstructed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment