コード例 #1
0
def reconstruct_spec(mlp, spec, outfile):

    fin = open(mlp)
    print 'load mlp..'
    mlp = cPickle.load(fin)
    fin.close()

    warp_spec = open(spec)
    warp_spec = np.fromfile(warp_spec, dtype='<f4')
    assert warp_spec.shape[0] % 2049 == 0
    warp_spec = warp_spec.reshape((warp_spec.shape[0] / 2049, 2049))

    gcn = GCN()
    out = gcn.apply(warp_spec)

    out = out * mlp.fprop(out)

    output_file = open(outfile, 'wb')
    out.tofile(output_file, format='<f4')
コード例 #2
0
ファイル: tmp.py プロジェクト: hycis/Pynet
def reconstruct_spec(mlp, spec, outfile):

    fin = open(mlp)
    print 'load mlp..'
    mlp = cPickle.load(fin)
    fin.close()

    warp_spec = open(spec)
    warp_spec = np.fromfile(warp_spec, dtype='<f4')
    assert warp_spec.shape[0] % 2049 == 0
    warp_spec = warp_spec.reshape((warp_spec.shape[0]/2049, 2049))

    gcn = GCN()
    out = gcn.apply(warp_spec)

    out = out * mlp.fprop(out)

    output_file = open(outfile, 'wb')
    out.tofile(output_file, format='<f4')
コード例 #3
0
ファイル: test.py プロジェクト: hycis/Pynet


import os
os.environ['PYNET_DATA_PATH'] = '/Volumes/Storage/Dropbox/CodingProjects/pynet/data/'

from pynet.datasets.mnist import Mnist
from pynet.datasets.preprocessor import GCN

data = Mnist()
train = data.get_train()
proc = GCN()
out = proc.apply(train.X)
inv = proc.invert(out)
コード例 #4
0
ファイル: test.py プロジェクト: hycis/Pynet
import os
os.environ[
    'PYNET_DATA_PATH'] = '/Volumes/Storage/Dropbox/CodingProjects/pynet/data/'

from pynet.datasets.mnist import Mnist
from pynet.datasets.preprocessor import GCN

data = Mnist()
train = data.get_train()
proc = GCN()
out = proc.apply(train.X)
inv = proc.invert(out)