How decisionintelligence/pathformer works
Main Components
• Data Input & Preprocessing:
• “data_provider” directory which includes modules (data_factory.py, data_loader.py) responsible for loading and preparing datasets.
• That the README mentions placing pre-processed datasets under a ./dataset folder (even though it isn’t in the file tree, it is an essential external component).
• Model Architecture & Core Layers:
• The “layers” directory includes key modules (AMS, Embedding, Layer, RevIN) that make up various components of the multi-scale transformer blocks.
• The “models” directory hosts the implementation of the primary model (PathFormer). This sits atop the layered components and constitutes the core computation engine.
• Experimentation:
• The “exp” folder holds experiment scripts (exp_basic.py, exp_main.py) which define how the model is trained, evaluated, and experimented with.
• The “scripts” directory (with its multivariate bash scripts) shows how different experiment configurations are run, each targeting specific datasets (e.g., ETTh, traffic, weather).
• Utility Functions & Tools:
• The “utils” directory includes functions for decomposition, masking, metrics, time features, and other tools to support the main processing pipeline.
• Entry Point & Configuration:
• “run.py” serves as the starting point to launch the application or experiments, and “requirements.txt” lists the external Python dependencies needed by the system.
• Experiment Results & Visuals:
Relationships and Data Flow
• Data flows from external sources (datasets placed under ./dataset) to the Data Provider modules which load and pre-process the input.
• Pre-processed data is then passed into the model—where the “layers” modules implement the transformer’s multi-scale characteristics—and processed by the “models” implementation (PathFormer).
• The output from the model is utilized by the experiment scripts in “exp” or triggered via “run.py” for training/inference.
• Utility modules support every stage, providing essential functions for data transformation, metrics calculation, and evaluation.
• Bash scripts in “scripts/multivariate” automate experiments on different datasets, thereby interfacing with “run.py” and configuration files.
Key Architectural Patterns and Technologies
• Modular Design: Each functional part (layers, models, utils) is organized into its own directory ensuring easy extensibility and isolated development.