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')
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')
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)
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)