Crates.io | neuroforge |
lib.rs | neuroforge |
version | 0.1.2 |
source | src |
created_at | 2024-07-21 23:00:34.240298 |
updated_at | 2024-07-21 23:11:49.228883 |
description | A neural network library with advanced features including quantum-inspired neurons, adaptive architecture, and neuro-symbolic integration. |
homepage | |
repository | https://github.com/xStFtx/neuroforge |
max_upload_size | |
id | 1310625 |
size | 24,421 |
Neuroforge is a Rust library for creating and training neural networks with an integrated neuro-symbolic processing layer.
Here's a basic example of how to use the neuroforge
library:
use neuroforge::{NeuroForge, neuro_symbolic::NeuroSymbolicLayer};
fn main() {
// Create a new neural network with 5 input neurons, 10 hidden neurons, and 3 output neurons
let mut network = NeuroForge::new(&[5, 10, 3]);
let mut symbolic_layer = NeuroSymbolicLayer::new();
// Add a neuro-symbolic rule
symbolic_layer.add_rule("high_activation", Box::new(|output: &[f64]| {
if output.iter().any(|&x| x > 0.8) { 1.0 } else { 0.0 }
}));
// Train the network
let inputs = vec![vec![0.1, 0.2, 0.3, 0.4, 0.5]];
let targets = vec![vec![0.9, 0.1, 0.5]];
network.train(&inputs, &targets, 1000);
// Make a prediction
let input = vec![0.2, 0.3, 0.4, 0.5, 0.6];
let mut output = network.forward(&input);
// Apply neuro-symbolic processing
output = symbolic_layer.process(output);
println!("Output: {:?}", output);
println!("Explanations: {:?}", symbolic_layer.explain());
}
Add neuroforge
to your Cargo.toml
:
[dependencies]
neuroforge = "*"
Or command:
cargo add neuroforge
This project is licensed under the MIT License.