GithubHelp home page GithubHelp logo

cae's Introduction

Tensorflow Convolutional Auto-Encoder

This is an implementation of Stacked What-Where Auto Encoder in Tensorflow.

Adjusting Layers

Layer format is like the following: (16)5c-(32)3c-2p, in which (16)5c denotes convolution layer with 16 feature maps while kernel size being set to 5. 2p denotes 2 × 2 pooling layer.

Auto-Encoder

Encoder is formed using the given layer structure. Decoder is formed using the inverse of given structure. Note that pooling layers are converted to max_unpooling using the argmax of the pooling layer in the encoder. If pooling layer is not available in an encoding layer, decoder does not unpool. After unpooling -if exists- a new convolution layer is applied in the decoder -not deconvolution-.

L2 losses between corresponding layers of encoder and decoder is called middle error. Recosntruction and these errors are added to get the total loss. Gradient descent is used for backpropogation.

train_classifier.py trains a Linear SVM and saves the embeddings of the previously trained Autoencoder. To train the Autoencoder you should use train_autoencoder.py. Output directory in train_classifier is the output directory where your Autoencoder is saved (Naming could have been better). Therefore, this model do not include the softmax layer in the network as discussed in the reference so the -fc parameter given while traning is not connected to a classifier but it is a bottleneck between encoder and decoder.

I have managed to obtain good reconstructions with this code. Classification (SVM) works well on MNIST and Fashion MNIST but not that well on CIFAR-10 dataset.

For details see the reference.

Reference: https://arxiv.org/pdf/1506.02351.pdf

cae's People

Contributors

ceteke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cae's Issues

Error when run train_classifier.py

I Run train_classifier.py with following command on my PC successfully:

PS F:\PycharmProjects\cae> python .\train_classifier.py -b 128 -o "./out/" -l "(64)5c-2p-(64)3c-2p-(64)3c-2p" -fc 10 -ds "mnist"

However it crashed on the first training step:
image

Could you have a look at it? Thanks in advance!

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.