BREAKING CHANGES: - Removed orphaned dqn.rs monolithic trainer (4,975 lines) - Removed orphaned dqn_ensemble.rs module (816 lines) - Removed orphaned tft.rs and tft_complete_int8_integration_test.rs - TFT trainer split into modular directory structure DQN Module Refactoring: - Split trainers/dqn.rs into modular structure (config.rs, statistics.rs, trainer.rs) - Fixed hyperopt 39D search space (continuous params only) - Boolean flags (use_dueling, use_double_dqn, use_per, use_noisy_nets) are now FIXED architectural decisions - use_distributional defaults to false (Candle BUG #36 - scatter_add gradient issues) Clean Module Structure: - ml/src/trainers/dqn/ directory with proper mod.rs exports - ml/src/trainers/tft/ directory with config.rs, types.rs, model.rs, trainer.rs, tests.rs - All P0 features validated: TD-error clamping, batch diversity, LR scheduler, priority staleness Documentation: - Added comprehensive docs in docs/codebase-cleanup/ - ADR-001 for DQN refactoring decisions - Rainbow DQN component matrix and quick reference guides Build Status: Compiles with zero errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.7 KiB
Rust
52 lines
1.7 KiB
Rust
//! Temporal Fusion Transformer (TFT) Trainer Module
|
|
//!
|
|
//! This module provides a comprehensive implementation of the Temporal Fusion Transformer
|
|
//! for time-series forecasting tasks. The module is organized into the following submodules:
|
|
//!
|
|
//! - [`config`]: Configuration structures for TFT training
|
|
//! - [`types`]: Type definitions for metrics, statistics, and training progress
|
|
//! - [`model`]: TFT model architecture implementation
|
|
//! - [`trainer`]: Training logic and optimization routines
|
|
//! - [`tests`]: Unit and integration tests
|
|
//!
|
|
//! # Architecture
|
|
//!
|
|
//! The TFT trainer is structured to separate concerns:
|
|
//! - Configuration (`TFTTrainerConfig`) defines hyperparameters and training settings
|
|
//! - Types module provides shared data structures for metrics and statistics
|
|
//! - Model module implements the neural network architecture
|
|
//! - Trainer module orchestrates the training loop and optimization
|
|
//!
|
|
//! # Usage
|
|
//!
|
|
//! ```rust,ignore
|
|
//! use crate::trainers::tft::{TFTTrainer, TFTTrainerConfig};
|
|
//!
|
|
//! let config = TFTTrainerConfig::default();
|
|
//! let trainer = TFTTrainer::new(config)?;
|
|
//! // Training logic here
|
|
//! ```
|
|
//!
|
|
//! # Backward Compatibility
|
|
//!
|
|
//! All public types are re-exported at the module root to maintain compatibility
|
|
//! with existing code that imports from `crate::trainers::tft`.
|
|
|
|
// Module declarations
|
|
pub mod config;
|
|
pub mod model;
|
|
pub mod trainer;
|
|
pub mod types;
|
|
|
|
#[cfg(test)]
|
|
mod tests;
|
|
|
|
// Re-exports for backward compatibility
|
|
pub use config::TFTTrainerConfig;
|
|
pub use model::TFTModel;
|
|
pub use trainer::TFTTrainer;
|
|
pub use types::{
|
|
LayerQuantizationMetrics, ObserverRangeStatistics, QATMetrics, ResourceUsage,
|
|
ScaleStatistics, TrainingMetrics, TrainingProgress, ZeroPointStatistics,
|
|
};
|