def trainFullAndSave(): (x, y) = DataModel.loadData("..\\train.csv") (x_train, x_cv, y_train, y_cv) = DataModel.splitData(x, y) s = SimpleNN2.NeuralNetConfig(784, 70, 10) regLambda = 6.84 print("Training neural network on full dataset") #s = Train.trainGradientDescent(s, x_sub, y_sub, 5) th1, th2 = Train.trainSciPy2(s, x_train, y_train, regLambda) #th1, th2 = Train.trainGradientDescent2(s, x_sub, y_sub, 5) print("Training complete, checking accuracy on CV data") acc_cv = accuracy_score(y_cv, [SimpleNN2.predictClass(s, th1, th2, w) for w in x_cv]) print("Accuracy on CV set: {0}".format(acc_cv)) SimpleNN2.saveNetwork(s, th1, th2, "..\\NeuralNetwork.bin")