Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jmmanley/conv-autoencoder
a convolutional autoencoder in python and keras.
https://github.com/jmmanley/conv-autoencoder
autoencoder computer-vision convolutional-autoencoder convolutional-neural-networks keras python
Last synced: 3 months ago
JSON representation
a convolutional autoencoder in python and keras.
- Host: GitHub
- URL: https://github.com/jmmanley/conv-autoencoder
- Owner: jmmanley
- License: gpl-3.0
- Created: 2018-10-16T22:15:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T14:59:24.000Z (over 4 years ago)
- Last Synced: 2024-04-26T21:47:49.596Z (10 months ago)
- Topics: autoencoder, computer-vision, convolutional-autoencoder, convolutional-neural-networks, keras, python
- Language: Jupyter Notebook
- Size: 75.2 KB
- Stars: 5
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Convolutional Autoencoder (CAE) in Python
An implementation of a convolutional autoencoder in python and keras.
## Installation
`pip install cae`
## Usage
```
from cae import cae
import numpy as np# create a fake dataset, here: 1000 random 224x224 RGB images
images = np.random.normal(size=(1000, 224, 224, 3))latent_dim = 8 # desired latent dimensionality
model = cae(images.shape[1:], latent_dim) # there are a number of **kwargs
# parameters that are likely
# worth tuning!!!# TRAIN THE NETWORK
model.fit(images)# SAVE THE WEIGHTS FOR EASY RELOADING LATER WITH model.load_weights(path)
model.save_weights('PATH/TO/SAVE/')
```## Final words
`cae.py` contains the implementation, which is tested on the MNIST dataset in `mnist_test.ipynb`.
In general, auto-encoders map an input x to a latent representation y (generally in a much smaller dimensional space), using deterministic functions of the type y = sigma(Wx+b). In order to encode images, it is useful to implement a convolutional architecture. Here, we utilize convolutional layers and max-pooling layers (which allow translation-invariant representations), followed by a flattening and dense layer to encode the images in a reduced-dimensional space. For decoding, you essentially need to perform the inverse operation. For more information on CAEs, consult e.g. http://people.idsia.ch/~ciresan/data/icann2011.pdf.