1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#![deny(missing_docs, missing_crate_level_docs)]

//! CoSyNE crate for optimizing fixed topology neural network using co-evolution
//! as described in the original paper (see resources/CoSyNE.pdf)

#[macro_use]
extern crate log;
extern crate pretty_env_logger;

mod activation;
mod config;
mod cosyne;
mod layer;
mod network;
mod permutation_prob_f;
#[cfg(feature = "plot")]
mod plot;
mod population;

pub use crate::cosyne::Cosyne;
pub use activation::Activation;
pub use config::Config;
pub use network::ANN;
pub use permutation_prob_f::PermutationProbF;

pub(crate) use layer::Layer;
pub(crate) use population::Population;

#[cfg(feature = "plot")]
pub(crate) use plot::plot_values;

/// Environment to test the neural network in
pub trait Environment {
    /// Return the fitness of a given neural network in the environment.
    /// Higher values indicate a more fit candidate
    fn evaluate(&self, nn: &mut ANN) -> f64;
}