Crates.io | cge |
lib.rs | cge |
version | 0.1.1 |
source | src |
created_at | 2022-05-13 00:01:11.177294 |
updated_at | 2022-06-02 23:27:36.680218 |
description | An implementation of the Common Genetic Encoding (CGE) for directly-encoded neural networks. |
homepage | |
repository | https://github.com/pengowen123/cge |
max_upload_size | |
id | 585548 |
size | 164,824 |
A Rust 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.
Requires Rust 1.43 or later.
cge
is intended to be a complete solution for interacting with CGE neural networks in the direct encoding case only. It currently provides these features:
Add this to your Cargo.toml:
[dependencies]
cge = "0.1"
Then, 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());
For more information, see the documentation and examples.
Contributions are welcome! You can contribute by reporting any bugs or issues you have with the library, adding documentation, fixing bugs, or adding features.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.
Licensed under either of
Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.