123456789101112131415161718192021222324252627282930 |
- #!/usr/bin/python3
- # File designed to be launched by user
- print("Start session")
- # Import python libraries
- from scipy.special import expit
- # Import local code to call
- from lab import generator, trainer, benchmark
- # Parameters
- learnRate = 0.05
- activation = expit
- activationDerivative = lambda x : expit(x) * (1 - expit(x))
- epochs = 1
- # Session
- network = generator.generate(activation, activationDerivative, generator.gaussAdaptedDev)
- precisionBefore = benchmark.computePrecision(network)
- network = trainer.train(network, learnRate, epochs)
- precisionAfter = benchmark.computePrecision(network)
- # Display results
- print("Precision before training : ", precisionBefore)
- print("Precision after training : ", precisionAfter)
|