SciRS2 Scientific Computing and AI/ML Infrastructure

repository·master·Indexed 43 days ago

https://github.com/cool-japan/scirs

A production-ready, pure Rust scientific computing and AI/ML ecosystem providing SciPy-compatible APIs. Version v0.6.5 features SIMD optimizations, zero external system dependencies, and a modular architecture including linear algebra (scirs2-linalg), automatic differentiation (scirs2-autograd), and neural networks (scirs2-neural). It supports GPU acceleration via CUDA and wgpu, and includes a native Computer Algebra System (CAS) in scirs2-symbolic.

Tokens
535.8K
Snippets
1.5K
Records
2K
Agent score
55%

What's inside SciRS2

  1. Overview of scirs2-optimize

    master
    The scirs2-optimize library is a Rust implementation of SciPy's optimization functionality. It provides a comprehensive suite of algorithms including unconstrained, constrained, stochastic, least squares, multi-objective, global, and root-finding optimization. It is designed for ergonomics, speed (with optional parallelization), and robustness.
  2. Overview of scirs2-graph application areas

    master

    The scirs2-graph library is designed for a wide range of graph processing tasks, spanning from academic research to production-scale workloads. Key application areas include:

    Core Applications

    • Social Network Analysis: Implementing centrality measures and community detection.
    • Route Finding: Calculating shortest paths, A* search, and alternative routes.
    • Machine Learning: Extracting graph features and generating graph embeddings.
    • Bioinformatics: Analyzing protein networks and functional modules.
    • Operations Research: Solving network flow and supply chain optimization problems.
    • Visualization: Utilizing layout algorithms and exporting graph data.

    Advanced Scenarios

    • Temporal Graphs: Analyzing time-respecting paths and temporal motifs.
    • Hypergraphs: Performing document analysis and identifying overlapping communities.
    • Graph Comparison: Using edit distance and kernel methods.
    • Multi-layer Networks: Conducting cross-platform analysis.
    • Advanced Pathfinding: Implementing constrained and multi-objective optimization.

    Production Patterns

    • Database Integration: Efficiently loading graph data from SQL databases.
    • Pipeline Processing: Building configurable analysis workflows.
    • Monitoring & Logging: Integrating performance tracking and observability.
    • Configuration Management: Managing flexible algorithm parameters.
    • Testing & Validation: Using property-based and integration testing.
    • Deployment Patterns: Implementing caching, cancellation, and health checks.
  3. Overview of scirs2-ndimage capabilities

    master

    The scirs2-ndimage crate provides N-dimensional image processing tools modeled after SciPy's ndimage module. Key functional areas include:

    • Filtering: Gaussian, median, rank, bilateral, edge detection (Sobel, Prewitt, etc.), and custom generic filters.
    • Morphology: Binary (erosion, dilation, opening, closing) and grayscale operations, distance transforms, and connected component labeling.
    • Measurements: Region statistics (mean, variance), moments (Hu moments), and geometric properties (area, centroid, bounding box).
    • Segmentation: Thresholding (Otsu, adaptive), watershed, active contours, and level set methods.
    • Feature Detection: Canny edges, Harris/FAST corners, SIFT descriptors, and HOG.
    • Geometric Interpolation: Coordinate mapping, affine transforms, rotation, zooming, and shifting.
    • Specialized Analysis: 3D volumetric analysis, medical imaging (Frangi vesselness, bone enhancement), and hyperspectral processing.
  4. Overview of scirs2-series

    master

    scirs2-series is a comprehensive time series analysis library for Rust, part of the SciRS2 scientific computing ecosystem. It provides a unified, type-safe API for a wide spectrum of time series tasks, ranging from classical econometrics to deep learning.

    Key capabilities include:

    • Forecasting: Classical models (ARIMA, ETS), Neural architectures (TFT, N-BEATS, N-HiTS, DeepAR), and streaming/online algorithms.
    • Modeling: State-space models, Kalman filtering, Volatility/GARCH models, Long-memory processes, and Vector Autoregressive (VAR) models.
    • Advanced Analysis: Causality, Cointegration, Functional Data Analysis (FDA), and hierarchical reconciliation.
    • Uncertainty Quantification: Confidence/prediction intervals for classical models, probabilistic outputs for neural models (DeepAR), and coverage/Winkler-score diagnostics.

    Design principles:

    • Ecosystem Coherence: Built on scirs2-core abstractions with no C or Fortran dependencies.
    • Performance: Leverages SIMD-accelerated operations via the scirs2-core simd feature. It avoids rayon dependencies, instead using std::thread directly within the out_of_core module for its worker pool.
  5. Overview of SciRS2 features

    master

    SciRS2 is a comprehensive scientific computing and AI/ML infrastructure written in Pure Rust. It provides SciPy-compatible APIs designed for high performance and safety.

    Key Characteristics:

    • Pure Rust: Uses OxiBLAS for BLAS/LAPACK and OxiFFT for FFT, ensuring zero C/C++/Fortran dependencies.
    • Performance: Leverages SIMD optimizations for 10-100x performance gains.
    • Safety: Utilizes Rust's ownership system to prevent memory leaks and data races.
    • Portability: Identical behavior across Linux, macOS, Windows, and WebAssembly.
    • Scope: Includes linear algebra, statistics, ML, FFT, signal processing, and computer vision.
  6. Overview of SciRS2 modules and capabilities

    master

    SciRS2 is a modular ecosystem organized into several functional areas. You can use the main scirs2 crate for all-in-one access or import specific crates to reduce overhead and dependencies.

    Scientific Computing Core

    • scirs2-linalg: Linear algebra (Matrix operations, solvers, tensor decompositions).
    • scirs2-stats: Statistics (Distributions, Bayesian methods, Gaussian processes).
    • scirs2-optimize: Optimization (MIP/SDP/SOCP, Bayesian, stochastic, and convex optimization).
    • scirs2-integrate: Numerical integration (ODE/BVP/DAE, PDE, SDE solvers).
    • scirs2-interpolate: Interpolation (RBF, B-spline, Kriging).
    • scirs2-special: Special mathematical functions (Mathieu, Jacobi theta, etc.).
    • scirs2-signal: Signal processing (Kalman filtering, compressed sensing, adaptive filtering).
    • scirs2-sparse: Sparse matrix operations (Eigensolvers, AMG, block preconditioners).
    • scirs2-spatial: Spatial algorithms (R*-Tree, Voronoi, geodata projections).

    Advanced Modules

    • scirs2-cluster: Clustering (GMM, HDBSCAN, topological clustering).
    • scirs2-ndimage: N-dimensional image processing (Segmentation, optical flow).
    • scirs2-fft: FFT and spectral methods (Sparse FFT, Wavelets, DCT/DST).
    • scirs2-io: I/O utilities (Protobuf, Parquet, HDF5-lite, Arrow).
    • scirs2-datasets: Sample datasets and loaders.
    • scirs2-validation: Distribution validation utilities.

    AI and Machine Learning

    • scirs2-autograd: Automatic differentiation (Gradients, JVP/VJP, Hessian).
    • scirs2-neural: Neural networks (Transformers, GNNs, Diffusion, RL).
    • scirs2-graph: Graph processing (Community detection, Max flow, Embeddings).
    • scirs2-transform: Data transformation (UMAP, t-SNE, Optimal transport).
    • scirs2-metrics: ML evaluation metrics (IoU, mAP, FID, fairness).
    • scirs2-text: Text processing (Tokenizers, NER, Topic modeling).
    • scirs2-vision: Computer vision (SLAM, 3D reconstruction, Segmentation).
    • scirs2-series: Time series analysis (Deep learning forecasting, Volatility models).
  7. Overview of scirs2-optimize capabilities

    master

    scirs2-optimize is a production-ready, pure-Rust optimization library that provides a wide range of classical numerical methods and state-of-the-art algorithms. It is designed for scientific computing tasks such as model fitting, engineering design, neural network training, and logistics scheduling.

    Key categories of optimization supported include:

    • Continuous: Unconstrained, constrained (equality, inequality, bounds), and conic optimization.
    • Discrete & Combinatorial: Mixed-integer programming (MIP), branch-and-bound, and dynamic programming.
    • Global: Bayesian optimization, DIRECT, differential evolution, and metaheuristics.
    • Multi-objective: NSGA-II, NSGA-III, and scalarization methods.
    • Stochastic & Online: SGD variants (Adam, AdamW, etc.) and variance reduction (SVRG, SARAH).
    • Structured: Game theory, bilevel optimization, minimax, and robust optimization.
  8. Overview of scirs2-neural capabilities

    master

    The scirs2-neural crate provides a comprehensive suite of tools for deep learning in Rust, ranging from basic layers to advanced research architectures.

    Core Components

    • Layers & Activations: Dense/Linear, Convolutional (1D, 2D, 3D), Recurrent (LSTM, GRU), Normalization (Batch/Layer Norm), and Dropout.
    • Architectures: Transformers (BERT, GPT, ViT), CNNs (ResNet, EfficientNet, ConvNeXt, MobileNet), and Seq2Seq models.
    • Training & Optimization: Automatic differentiation, advanced optimizers (Adam, AdamW), learning rate scheduling, gradient clipping, and mixed precision training.
    • Specialized Applications: Computer Vision (Object Detection, Segmentation), NLP (Text Classification, Sentiment Analysis), and Generative Models (VAE, GAN).

    Advanced Features

    • Hardware Acceleration: SIMD optimizations and CUDA-based GPU acceleration.
    • Production Readiness: Model serialization/deserialization, ONNX export, and quantization.
    • Visualization: Real-time training progress, model architecture diagrams, attention maps, and confusion matrices.
  9. Overview of Enhanced Memory Management with Metrics Collection

    master
    The enhanced memory management system in scirs2-core provides detailed metrics collection and reporting for scientific computing workloads. It is designed to help developers identify memory-intensive operations, track peak memory usage, and detect allocation bottlenecks by monitoring memory usage patterns and allocation frequencies.
  10. Overview of the scirs2-io module

    master

    The scirs2-io module provides comprehensive input/output functionality for scientific computing in Rust, modeled after SciPy's IO facilities. It supports scientific data formats (MATLAB, ARFF), general-purpose formats (CSV, JSON, images, audio), data serialization, compression, and data validation.

    Architecture

    The module is organized into the following submodules:

    • arff: ARFF file format support
    • compression: Data compression utilities
    • csv: CSV and delimited text file utilities
    • error: Common error types and handling
    • image: Image file support
    • matlab: MATLAB .mat file support
    • serialize: Data serialization utilities
    • validation: Data validation and verification
    • wavfile: WAV audio file support
  11. Overview of scirs2-stats capabilities

    master
    scirs2-stats is a comprehensive statistical computing library for Rust, serving as the statistical backbone of the SciRS2 ecosystem. It provides a production-ready, pure-Rust implementation of a wide range of statistical methods, ranging from classical descriptive statistics to advanced Bayesian inference and causal modeling. The API is designed to mirror SciPy's stats module where appropriate, making it intuitive for users transitioning from Python.
  12. Overview of SciRS2 Datasets Tutorial Modules

    master

    The scirs2-datasets module is organized into several specialized learning areas:

    • Getting Started: Fundamentals of loading toy datasets (Iris, Boston, Digits), exploring dataset structures, and error handling.
    • Data Generation: Creating synthetic datasets including classification, regression, clustering (blobs, hierarchical), non-linear patterns (spirals, moons, swiss roll), and time series with trends/seasonality.
    • Cross-Validation: Implementing K-Fold, Stratified K-Fold, Time-series (temporal order aware), Group-based, Leave-One-Out, and Nested cross-validation.
    • Dataset Utilities: Preprocessing pipelines including scaling (Standard, Min-Max, Robust), imputation, feature engineering, and sampling (Random, Stratified, Bootstrap, SMOTE).
    • Custom Datasets: Loading external data from CSV, JSON, ARFF, and LIBSVM, as well as database integration (SQL/NoSQL) and streaming for large datasets.
    • Performance Optimization: Advanced techniques including SIMD, GPU acceleration (CUDA), parallel processing, and memory-efficient streaming.