Skip to main content

feagi_npu_neural/
lib.rs

1// Copyright 2025 Neuraville Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4/*
5 * Copyright 2025 Neuraville Inc.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 */
10
11//! # FEAGI Neural Computation (Platform-Agnostic)
12//!
13//! ALL neural computation in one place:
14//! - **Types**: Core type definitions (NeuronId, SynapseType, NeuralValue, etc.)
15//! - **Synapse**: Synaptic contribution algorithms
16//! - **Dynamics**: Membrane potential updates
17//! - **Models**: Neuron models (LIF, Izhikevich, etc.)
18//!
19//! Merged from:
20//! - feagi-types (Phase 2c)
21//! - feagi-synapse (Phase 2a)
22//! - feagi-burst-engine/neuron_models (Phase 2b)
23//!
24//! ## Target Platforms
25//! - ✅ Desktop (Linux, macOS, Windows)
26//! - ✅ Embedded (ESP32, ARM Cortex-M)
27//! - ✅ RTOS (FreeRTOS, Zephyr)
28//! - ✅ WASM (browser, Node.js)
29//! - ✅ GPU (CUDA, WebGPU)
30
31// Note: This module is part of a no_std crate
32
33/// Crate version from Cargo.toml
34pub const VERSION: &str = env!("CARGO_PKG_VERSION");
35
36#[cfg(feature = "std")]
37extern crate std;
38
39// Core type definitions (merged from feagi-types)
40pub mod types;
41
42// Neural dynamics algorithms
43pub mod dynamics;
44pub mod firing;
45pub mod utils;
46
47// Synaptic algorithms (merged from feagi-synapse)
48pub mod synapse;
49
50// Neuron models (moved from feagi-burst-engine)
51pub mod models;
52
53// Re-export everything for convenience
54pub use dynamics::*;
55pub use firing::*;
56pub use utils::*;
57
58// Re-export types
59pub use types::{
60    Error,
61    // Dimensions moved to feagi_structures::genomic::cortical_area::CorticalAreaDimensions
62    FeagiError,
63    FireCandidateList,
64    // CorticalArea, BrainRegion, RegionType, BrainRegionHierarchy moved to feagi_data_structures
65    FireQueue,
66    INT8LeakCoefficient,
67    INT8Value,
68    NeuralValue,
69    NeuronId,
70    Position,
71    Precision,
72    QuantizationSpec,
73    Result,
74    Synapse,
75    SynapseId,
76    SynapticContribution,
77    SynapticPsp,
78    SynapticWeight,
79};
80
81// Re-export synapse module
82pub use synapse::{
83    compute_synaptic_contribution, compute_synaptic_contributions_batch, SynapseType,
84};
85
86// Re-export neuron models
87pub use models::{LIFModel, LIFParameters, ModelParameters, NeuronModel};