Crate cge

source · []
Expand description

A library for creating, using, and modifying artificial neural networks using the Common Genetic Encoding (CGE). See const_cge for a similar library geared towards embedded environments and performance-critical use cases. For the creation of CGE-compatible neural networks, see the eant2 library.

Quick Start

To load and use an existing neural network from a file:

use cge::{Network, WithRecurrentState};

// `extra` is any user-defined data stored alongside the network
let (mut network, metadata, extra) =
    Network::<f64>::load_file::<(), _>("network.cge", WithRecurrentState(true)).unwrap();

println!("description: {:?}", metadata.description);
println!("num inputs, outputs: {}, {}", network.num_inputs(), network.num_outputs());
println!("{:?}", network.evaluate(&[1.0, 2.0]).unwrap());

network.clear_state();

println!("{:?}", network.evaluate(&[2.0, 0.0]).unwrap());

See Network for full documentation.

Re-exports

pub use self::activation::Activation;
pub use self::encoding::WithRecurrentState;
pub use self::network::Network;

Modules

Handling of neuron activation functions.

A portable encoding for cge Networks. See PortableCGE.

Different types of genes that can be used in a Network genome.

The main neural network type. See Network for full documentation.