-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added neural network cmaes algorithm
- Loading branch information
Showing
7 changed files
with
109 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use neuroevolution::neural_network::*; | ||
use neuroevolution::benchmarks::*; | ||
use neuroevolution::neuroevolution_algorithm::Algorithm; | ||
use neuroevolution::neuroevolution_algorithm::NeuroevolutionAlgorithm; | ||
|
||
fn main() { | ||
let network = NeuralNetwork::new( | ||
vec![1, 2], | ||
vec![5], | ||
Some(3), | ||
vec![ | ||
Neuron::new(4, vec![NeuronInput::new(1, None), NeuronInput::new(2, None), NeuronInput::new(3, None)], SIGMOID), | ||
Neuron::new(5, vec![NeuronInput::new(4, None), NeuronInput::new(3, None), NeuronInput::new(2, None), NeuronInput::new(3, None)], SIGMOID), | ||
] | ||
); | ||
|
||
let problem = Benchmark::new(Problem::Xor); | ||
let mut alg = Algorithm::NeuralNetworek(network); | ||
alg.optimize_cmaes(&problem); | ||
println!("Fitness: {:.2}", problem.evaluate(&alg)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,5 +31,5 @@ pub enum AlgorithmType { | |
Oneplusonena, | ||
Bna, | ||
Neat, | ||
NeuralNetwork, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters