|
@@ -1,7 +1,7 @@
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
# File designed to be launched by user
|
|
|
-print("Start session")
|
|
|
+print("Start script")
|
|
|
|
|
|
# Import python libraries
|
|
|
from scipy.special import expit
|
|
@@ -26,14 +26,21 @@ activation = expit
|
|
|
activationDerivative = lambda x : expit(x) * (1 - expit(x))
|
|
|
|
|
|
# Session
|
|
|
+print("Start session")
|
|
|
+print("... generating neural network ...")
|
|
|
network = generator.generate(activation, activationDerivative, generator.gaussAdaptedDev)
|
|
|
|
|
|
+print("... compute precision before training ... ")
|
|
|
precisionBefore = benchmark.computePrecision(network)
|
|
|
|
|
|
+print("... train the network (can take a while) ... ")
|
|
|
network = trainer.train(network, args.learnRate, args.epochs)
|
|
|
|
|
|
+print("... compute precision after training ... ")
|
|
|
precisionAfter = benchmark.computePrecision(network)
|
|
|
|
|
|
+print("End of session")
|
|
|
+
|
|
|
# Display results
|
|
|
print("Precision before training : ", precisionBefore)
|
|
|
print("Precision after training : ", precisionAfter)
|