GithubHelp home page GithubHelp logo

grseb9s / tensorflow-convolutional-autoencoder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seratna/tensorflow-convolutional-autoencoder

0.0 1.0 0.0 17.08 MB

This is an implementation of Convolutional AutoEncoder using only TensorFlow

Python 100.00%

tensorflow-convolutional-autoencoder's Introduction

TensorFlow Convolutional AutoEncoder

This project provides utilities to build a deep Convolutional AutoEncoder (CAE) in just a few lines of code.

This project is based only on TensorFlow.

Experiments

convolutional_autoencoder.py shows an example of a CAE for the MNIST dataset.

The structure of this conv autoencoder is shown below:

autoencoder structure

The encoding part has 2 convolution layers (each followed by a max-pooling layer) and a fully connected layer. This part would encode an input image into a 20-dimension vector (representation). And then the decoding part, which has 1 fully connected layer and 2 convolution layers, would decode the representation back to a 28x28 image (reconstruction).

Training was done using GTX1070 GPU, batch size 100, 100000 passes.

Trained weights (saved in the saver directory) of the 1st convolutional layer are shown below: conv_1_weights

And here's some of the reconstruction results: reconstructions

Implementation

Un-pooling

Since the max-pooling operation is not injective, and TensorFlow does not have a built-in unpooling method, we have to implement our own approximation. But it is actually easy to do so using TensorFlow's tf.nn.conv2d_transpose() method.

The idea was to replace each entry in the pooled map with an NxM kernel with the original entry in the upper left, where N and M are the shape of the pooling kernel.

un-pooling

This is equivalent to doing transpose of conv2d on the input map with a kernel that has 1 on the upper left and 0 elsewhere. Therefore we could do this trick with tf.nn.conv2d_transpose() method.

tensorflow-convolutional-autoencoder's People

Contributors

seratna avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.