Skip to content

Instantly share code, notes, and snippets.

View nutszebra's full-sized avatar

ikki kishida nutszebra

  • CodeNext
  • Tokyo, Japan
View GitHub Profile
@ktnyt
ktnyt / chainer_mnist_autoencoder.py
Last active March 15, 2016 18:56
Chainer implementation of MNIST classification with Denoising Autoencoders. `utils` from here: https://gist.github.com/kiyukuta/6170759. You may need to change line 32 from utils.py to `image.astype(numpy.uint8).`
import argparse
import numpy as np
from sklearn.datasets import fetch_mldata
from chainer import Variable, FunctionSet, optimizers, cuda
import chainer.functions as F
#import utils
parser = argparse.ArgumentParser(description='Chainer example: MNIST')
parser.add_argument('--gpu', '-g', default=-1, type=int,
help='GPU ID (negative value indicates CPU)')
import math
from chainer import cuda
from chainer import function
from chainer.functions import Sigmoid
from chainer.utils import type_check
import numpy
def _as_mat(x):