This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Autoencoder(chainer.Chain): | |
def __init__(self): | |
super(Autoencoder, self).__init__( | |
encoder = L.Linear(784, 64), | |
decoder = L.Linear(64, 784)) | |
def __call__(self, x, hidden=False): | |
h = F.relu(self.encoder(x)) | |
if hidden: | |
return h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def unpickle(file): | |
fp = open(file, 'rb') | |
if sys.version_info.major == 2: | |
data = pickle.load(fp) | |
elif sys.version_info.major == 3: | |
data = pickle.load(fp, encoding='latin-1') | |
fp.close() | |
return data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip install gym |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy, sys | |
import numpy as np | |
from collections import deque | |
import chainer | |
import chainer.links as L | |
import chainer.functions as F | |
from chainer import Chain, optimizers, Variable, serializers | |
class Neuralnet(Chain): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd [whlファイルがあるディレクトリ] | |
pip install numpy-1.11.1+mkl-cp27-cp27m-win_amd64.whl |