Skip to content

Instantly share code, notes, and snippets.

@dansbecker
dansbecker / autoencoder.py
Created April 14, 2016 23:22
Non-functioning autoencoder, with an error that surprises me.
import numpy as np
from keras.models import Model
from keras.layers import Input, Dense
input_size = 1000
n_obs = 200
encoding_size = 50
x = Input(shape=(input_size,))
z = Dense(encoding_size, activation='sigmoid', name='z')(x)
'''Train a simple deep CNN on the CIFAR10 small images dataset.
GPU run command:
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python cifar10_cnn.py
It gets down to 0.65 test logloss in 25 epochs, and down to 0.55 after 50 epochs.
(it's still underfitting at that point, though).
Note: the data was pickled with Python 2, and some encoding issues might prevent you
from loading it in Python 3. You might have to load it in Python 2,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.