def test_logistic_sgd():
    logistic_sgd.sgd_optimization_mnist(n_epochs=10)
Beispiel #2
0
def test_logistic_sgd():
    logistic_sgd.sgd_optimization_mnist(n_epochs=10)
Beispiel #3
0
def test_logistic_sgd():
    t0 = time.time()
    logistic_sgd.sgd_optimization_mnist(n_epochs=10)
    print >> sys.stderr, "test_logistic_sgd took %.3fs expected 15.2s in our buildbot" % (
        time.time() - t0)
Beispiel #4
0
def test_logistic_sgd():
    t0=time.time()
    logistic_sgd.sgd_optimization_mnist(n_epochs=10)
    print >> sys.stderr, "test_logistic_sgd took %.3fs expected 15.2s in our buildbot"%(time.time()-t0)
Beispiel #5
0
    return logistic_labels


def print_digit(digit, cols=28):
    for y in range(len(digit) / cols):
        for x in range(cols):
            sys.stdout.write('X' if digit[x + y*cols] else ' ')
        sys.stdout.write('\n')


if __name__ == '__main__':
    arguments = docopt.docopt(__doc__)
    epochs = int(arguments['--epochs'])
    training, validation, testing = load_data(arguments['<mnist_training>'], arguments['<mnist_labels>'])

    sgd_classifier = sgd_optimization_mnist(training[0], training[1], validation[0], validation[1], testing[0], testing[1], n_epochs=epochs)
    mlp_classifier = test_mlp(training[0], training[1], validation[0], validation[1], testing[0], testing[1], n_epochs=epochs)
    lenet_classifier = evaluate_lenet5(training[0], training[1], validation[0], validation[1], testing[0], testing[1], n_epochs=epochs, nkerns=[4,10])

    with open('sgd_classifier.pkl', 'w') as f:
        cPickle.dump(sgd_classifier, f)
    with open('mlp_classifier.pkl', 'w') as f:
        cPickle.dump(mlp_classifier, f)
    with open('lenet_classifier.pkl', 'w') as f:
        cPickle.dump(lenet_classifier, f)

    digits = load_mnist_data(arguments['<mnist_training>'])
    random.shuffle(digits)
    for digit in digits:
        sgd_label = sgd_classifier([digit])
        mlp_label = mlp_classifier([digit])
import mlp
import mlp_dropOut
import mlp_dropConnect

import convolutional_mlp
import con_mlp_dropConnect
import con_mlp_dropOut

c100 = 'cifar-100-python.tar.gz'

sys.stdout = open('results/cifar-100_results/lcg.out', 'w')
logistic_cg.cg_optimization_mnist(mnist_pkl_gz=c100)

sys.stdout = open('results/cifar-100_results/lsgd.out', 'w')
logistic_sgd.sgd_optimization_mnist(dataset=c100)

sys.stdout = open('results/cifar-100_results/lsgd_gau.out', 'w')
logistic_sgd_gaussian.sgd_optimization_mnist(dataset=c100)

sys.stdout = open('results/cifar-100_results/lsgd_bin.out', 'w')
logistic_sgd_binomial.sgd_optimization_mnist(dataset=c100)

sys.stdout = open('results/cifar-100_results/mlp.out', 'w')
mlp.test_mlp(dataset=c100)

sys.stdout = open('results/cifar-100_results/mlpO.out', 'w')
# mlp_dropOut.test_mlp(p=0.8, n_hidden = 100)
mlp_dropOut.test_mlp(dataset=c100)

sys.stdout = open('results/cifar-100_results/mlpC.out', 'w')