def main(): trainX, trainY, testX, testY = load_mnist() print "Shapes: ", trainX.shape, trainY.shape, testX.shape, testY.shape print "\nDigit sample" print_digit(trainX[1], trainY[1]) train_dense.train(trainX, trainY) labels = train_dense.test(testX) accuracy = np.mean((labels == testY)) * 100.0 print "\nDNN Test accuracy: %lf%%" % accuracy
def main(): print("\n\n\nNOTE") print("***First change the Backend from Tesorflow to Theano****") print( "IF ANY ERRORS OCCUR PLEASE ENSURE THAT THE VERSION OF KERAS USED IS 1.2.2\n\n\n" ) trainX, trainY, testX, testY = load_mnist() print "Shapes: ", trainX.shape, trainY.shape, testX.shape, testY.shape print "\nDigit sample" print_digit(trainX[1], trainY[1]) # train_dense.train(trainX, trainY) labels = train_dense.test(testX) accuracy = np.mean((labels == testY)) * 100.0 print "\nDNN Test accuracy: %lf%%" % accuracy '''# train_cnn.train(trainX, trainY)
def main(): trainX, trainY, testX, testY = load_mnist() print "Shapes: ", trainX.shape, trainY.shape, testX.shape, testY.shape print "\nDigit sample" print_digit(trainX[1], trainY[1]) print 'Cloning from github' git_repo = 'https://github.com/tushargupta14/weights.git' call(['git', 'clone', git_repo]) #train_dense.train(trainX,trainY) labels = train_dense.test(testX) accuracy = np.mean((labels == testY)) * 100.0 print "\nDNN Test accuracy: %lf%%" % accuracy #train_cnn.train(trainX, trainY) labels = train_cnn.test(testX) accuracy = np.mean((labels == testY)) * 100.0 print "\nCNN Test accuracy: %lf%%" % accuracy