Expand description
§GhostFlow - Complete Machine Learning Framework in Rust
GhostFlow is a production-ready machine learning framework built entirely in Rust, designed to rival PyTorch and TensorFlow in both performance and ease of use.
§Features
- Tensor Operations: Multi-dimensional arrays with SIMD optimization
- Automatic Differentiation: Full autograd engine with computational graph
- Neural Networks: CNN, RNN, LSTM, GRU, Transformer, Attention
- 50+ ML Algorithms: Decision trees, random forests, SVM, clustering, and more
- GPU Acceleration: Hand-optimized CUDA kernels (optional)
- Production Ready: Zero warnings, comprehensive tests, full documentation
§Quick Start
use ghostflow::prelude::*;
// Create tensors
let x = Tensor::randn(&[32, 784]);
let y = Tensor::randn(&[32, 10]);
// Tensor operations
let z = x.matmul(&y.transpose(0, 1).unwrap()).unwrap();§Installation
Add to your Cargo.toml:
[dependencies]
ghostflow = "0.1"With GPU support:
[dependencies]
ghostflow = { version = "0.1", features = ["cuda"] }§Modules
Re-exports§
pub use ghostflow_core as core;pub use ghostflow_nn as nn;pub use ghostflow_ml as ml;pub use ghostflow_autograd as autograd;pub use ghostflow_optim as optim;pub use ghostflow_data as data;
Modules§
- device
- Device abstraction for CPU/GPU execution
- dtype
- Data types supported by GhostFlow tensors
- error
- Error types for GhostFlow
- fusion
- Operation Fusion Engine
- jit
- JIT Compiler for GPU Kernels
- layout
- Memory Layout Optimizer
- ops
- Tensor operations
- prelude
- Prelude module for convenient imports
- serialize
- Model serialization and deserialization
- shape
- Shape and stride handling for tensors
- storage
- Storage backend for tensor data
- tensor
- Core Tensor type - the foundation of GhostFlow
- tensor_
ops - Tensor operations trait extensions
Structs§
- Compiled
Kernel - JIT-compiled kernel
- Compute
Graph - Compute graph for operation fusion
- Cpu
- CPU device - default compute device
- Device
Info - Device capabilities
- Fusion
Engine - Operation fusion engine
- JitCompiler
- JIT compiler that generates and caches optimized kernels
- Layout
Optimizer - Layout optimizer
- Shape
- Shape of a tensor - dimensions along each axis
- Storage
- Raw storage for tensor data Separate from Tensor to enable zero-copy views
- Strides
- Strides for memory layout - bytes to skip for each dimension
- Tensor
- The core Tensor type
Enums§
- DType
- Supported data types for tensor elements
- Fusion
Pattern - Fusion patterns that can be optimized
- Ghost
Error - Main error type for GhostFlow operations
- Memory
Layout - Memory layout formats
Traits§
- Device
- Trait for compute devices (CPU, CUDA, etc.)
- Serializable
- Trait for models that can be serialized
Functions§
- load_
state_ dict - Load a state dictionary from a file
- save_
state_ dict - Save a state dictionary to a file