from scae_destin.convnet import SigmoidConvLayer from scae_destin.model import ConvAutoEncoder from scae_destin.convnet import MaxPoolingSameSize, MaxPooling from scae_destin.convnet import Flattener from scae_destin.model import FeedForward from scae_destin.optimize import gd_updates from scae_destin.cost import mean_square_cost from scae_destin.cost import categorical_cross_entropy_cost from scae_destin.cost import L2_regularization start_time = time.time() n_epochs = 100 batch_size = 100 nkerns = 100 Xtr, Ytr, Xte, Yte = ds.load_CIFAR10("../cifar-10-batches-py/") Xtr = np.mean(Xtr, 3) Xte = np.mean(Xte, 3) Xtrain = Xtr.reshape(Xtr.shape[0], Xtr.shape[1] * Xtr.shape[2]) / 255.0 Xtest = Xte.reshape(Xte.shape[0], Xte.shape[1] * Xte.shape[2]) / 255.0 train_set_x, train_set_y = ds.shared_dataset((Xtrain, Ytr)) test_set_x, test_set_y = ds.shared_dataset((Xtest, Yte)) n_train_batches = train_set_x.get_value(borrow=True).shape[0] / batch_size n_test_batches = test_set_x.get_value(borrow=True).shape[0] / batch_size print "[MESSAGE] The data is loaded" ################################## FIRST LAYER #######################################
import numpy as np; import sys import theano; import theano.tensor as T; sys.path.append("..") import scae_destin.datasets as ds; from scae_destin.convnet import ReLUConvLayer; from scae_destin.convnet import LCNLayer n_epochs=1; batch_size=100; Xtr, Ytr, Xte, Yte=ds.load_CIFAR10("/home/tejas/Desktop/cifar-10-batches-py"); Xtr=np.mean(Xtr, 3); Xte=np.mean(Xte, 3); Xtrain=Xtr.reshape(Xtr.shape[0], Xtr.shape[1]*Xtr.shape[2]) Xtest=Xte.reshape(Xte.shape[0], Xte.shape[1]*Xte.shape[2]) train_set_x, train_set_y=ds.shared_dataset((Xtrain, Ytr)); test_set_x, test_set_y=ds.shared_dataset((Xtest, Yte)); n_train_batches=train_set_x.get_value(borrow=True).shape[0]/batch_size; n_test_batches=test_set_x.get_value(borrow=True).shape[0]/batch_size; print "[MESSAGE] The data is loaded" X=T.matrix("data");
from scae_destin.model import ConvAutoEncoder from scae_destin.convnet import MaxPooling from scae_destin.convnet import Flattener from scae_destin.model import FeedForward from scae_destin.optimize import gd_updates from scae_destin.cost import mean_square_cost from scae_destin.cost import categorical_cross_entropy_cost from scae_destin.cost import L2_regularization #def conv(): n_epochs=1 batch_size=100 nkerns=100 Xtr, Ytr, Xte, Yte=ds.load_CIFAR10("../cifar-10-batches-py/") Xtr=np.mean(Xtr, 3) Xte=np.mean(Xte, 3) Xtrain=Xtr.reshape(Xtr.shape[0], Xtr.shape[1]*Xtr.shape[2])/255.0 Xtest=Xte.reshape(Xte.shape[0], Xte.shape[1]*Xte.shape[2])/255.0 train_set_x, train_set_y=ds.shared_dataset((Xtrain, Ytr)) test_set_x, test_set_y=ds.shared_dataset((Xtest, Yte)) n_train_batches=train_set_x.get_value(borrow=True).shape[0]/batch_size n_test_batches=test_set_x.get_value(borrow=True).shape[0]/batch_size print "[MESSAGE] The data is loaded" ################################## FIRST LAYER #######################################
import numpy as np; import sys import theano; import theano.tensor as T; sys.path.append("..") import scae_destin.datasets as ds; from scae_destin.convnet import ReLUConvLayer; from scae_destin.convnet import LCNLayer n_epochs=1; batch_size=100; Xtr, Ytr, Xte, Yte=ds.load_CIFAR10("/home/icog/convAE+destin/cifar-10-batches-py"); Xtr=np.mean(Xtr, 3); Xte=np.mean(Xte, 3); Xtrain=Xtr.reshape(Xtr.shape[0], Xtr.shape[1]*Xtr.shape[2]) Xtest=Xte.reshape(Xte.shape[0], Xte.shape[1]*Xte.shape[2]) train_set_x, train_set_y=ds.shared_dataset((Xtrain, Ytr)); test_set_x, test_set_y=ds.shared_dataset((Xtest, Yte)); n_train_batches=train_set_x.get_value(borrow=True).shape[0]/batch_size; n_test_batches=test_set_x.get_value(borrow=True).shape[0]/batch_size; print "[MESSAGE] The data is loaded" X=T.matrix("data");