Skip to main content

Crate neuro_divergent_models

Crate neuro_divergent_models 

Source
Expand description

§Neuro-Divergent Models

A comprehensive neural forecasting library built on top of ruv-FANN, providing state-of-the-art time series forecasting models for production use.

This library implements 27+ neural forecasting models inspired by NeuralForecast, optimized for Rust’s performance and safety guarantees.

§Features

  • Recurrent Models: RNN, LSTM, GRU with temporal state management
  • Transformer Models: Multi-head attention, TFT, and advanced architectures
  • Linear Models: DLinear, NLinear with decomposition
  • Specialized Models: NBEATS, TimesNet, and domain-specific architectures
  • Production Ready: Type-safe, memory-efficient, and scalable

§Quick Start

use neuro_divergent_models::{NeuralForecast, models::LSTM, LSTMConfig};
use neuro_divergent_models::data::TimeSeriesDataFrame;

// Create LSTM model
let lstm_config = LSTMConfig::default_with_horizon(24)
    .with_architecture(128, 2, 0.1)
    .with_training(1000, 0.001);

let lstm = LSTM::new(lstm_config)?;

// Create forecasting pipeline
let mut nf = NeuralForecast::new()
    .with_model(Box::new(lstm))
    .build()?;

// Train and forecast
nf.fit(train_data)?;
let forecasts = nf.predict()?;

Re-exports§

pub use errors::NeuroDivergentError;
pub use errors::NeuroDivergentResult;
pub use foundation::BaseModel;
pub use foundation::NetworkAdapter;
pub use foundation::ModelConfig;
pub use foundation::TimeSeriesInput;
pub use foundation::ForecastOutput;
pub use foundation::ValidationConfig;
pub use data::TimeSeriesDataFrame;
pub use data::ForecastDataFrame;
pub use data::TimeSeriesSchema;
pub use forecasting::NeuralForecast;
pub use config::LSTMConfig;
pub use config::RNNConfig;
pub use config::GRUConfig;
pub use config::TrainingConfig;
pub use config::PredictionConfig;
pub use config::CrossValidationConfig;

Modules§

activations
Activation functions for neural networks
config
Configuration structures for neural forecasting models
data
Data structures for time series handling
errors
Error types for neuro-divergent models
forecasting
Main forecasting interface for neuro-divergent models
foundation
Core foundation traits and structures for neural forecasting models
layers
Neural network layers for forecasting models
models
Neural forecasting model implementations
recurrent
Recurrent Neural Network Models
utils
Utility functions for neural forecasting models

Structs§

Layer
Represents a layer of neurons in the neural network
Network
A feedforward neural network
Neuron
Represents a single neuron in the neural network

Enums§

ActivationFunction
Activation functions available for neurons

Traits§

Float
Generic trait for floating point numbers