| Crates.io | cognition |
| lib.rs | cognition |
| version | 0.0.1 |
| created_at | 2025-06-29 02:03:23.241286+00 |
| updated_at | 2025-06-29 02:03:23.241286+00 |
| description | A cognitive computing library for Rust |
| homepage | https://github.com/CireSnave/cognition |
| repository | https://github.com/CireSnave/cognition |
| max_upload_size | |
| id | 1730251 |
| size | 20,068 |
A cognitive computing library for Rust providing foundational structures and algorithms for intelligent systems.
Currently, don't. This crate is barely functional and not ready for production use. It will evolve quickly and be ready for use beyond me soon. However, if you must use this crate, here's how:
Add this to your Cargo.toml:
[dependencies]
cognition = "0.0.1"
use cognition::{Neuron, utils};
// Create a neuron with a threshold of 0.5
let neuron = Neuron::new(0.5);
// Activate the neuron with inputs
let output = neuron.activate(&[0.3, 0.4]); // Returns 1.0 (activated)
// Use activation functions
let sigmoid_result = utils::sigmoid(1.0);
let relu_result = utils::relu(-0.5);
use cognition::Neuron;
// Create multiple neurons for a simple network
let input_layer = vec![
Neuron::new(0.3),
Neuron::new(0.7),
];
let hidden_layer = vec![
Neuron::new(0.5),
];
// Process inputs through the network
let inputs = vec![0.8, 0.2];
let hidden_inputs: Vec<f64> = input_layer
.iter()
.map(|neuron| neuron.activate(&inputs))
.collect();
let output = hidden_layer[0].activate(&hidden_inputs);
println!("Network output: {}", output);
cargo build
cargo test
cargo doc --open
This crate is ready for publishing to crates.io. Make sure to:
Cargo.tomlcargo publish --dry-run to verify everything is readycargo publishContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under either of
at your option.