Code Monkey home page Code Monkey logo

cnn_autoencoder's Introduction

CNN_Autoencoder

Two different types of CNN auto encoder, implemented using pytorch. One has only convolutional layers and other consists of convolutional layers, pooling layers, flatter and full connection layers. These two auto encoders were implemented as I wanted to see how pooling layers, flatter and full connection layers can affect the efficiency and the loss of data compression. As such, a normal CNN was also implemented for classification. The dataset MNIST was used because of its simplicity. Similar datasets such as cifar-10 should work in this case as well. If you find interested in this topic, please read the detailed report, as I have captured the process and result of the comparison.

How to run

to run any of the python files, make sure the 'data' folder is in the same directory

cnn.py includes the CNN that classify MNIST. learning_rate, batch_size and num_epochs can be changed to different value at the beginning of the file.

cnn_ae1.py includes Auto encoder 1 to encode and decode MNIST and a CNN that takes the restructured data as input to make classification. learning_rate, batch_size_ae, batch_size, num_epochs_ae, num_epochs can be changed at the beginning of the file, where batch_size_ae and num_epochs_ae are for AE 1 and batch_size and num_epochs are for the CNN. the methods for showing images are currently in comment, so if want the images to be showed, remove the """ in line 94 and 121.

cnn_ae2.py includes Auto encoder 2 to encode and decode MNIST and a CNN that takes the restructured data as input to make classification. learning_rate, batch_size_ae, batch_size, num_epochs_ae, num_epochs can be changed at the beginning of the file, where batch_size_ae and num_epochs_ae are for AE 2 and batch_size and num_epochs are for the CNN. the methods for showing images are currently in comment, so if want the images to be showed, remove the """ in line 91 and 109.

process_diagram

cnn_autoencoder's People

Contributors

isaacchenoc avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

latte193

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.