How lin956/sttns works
Main Components
• Data Input & Preprocessing:
• The PEMSD7 folder contains the dataset (including CSV files like V_25.csv and W_25.csv) and data description.
• One_hot_encoder.py is likely used to transform categorical or discrete data features into a machine-readable format.
• Model Components:
• GCN_models.py defines graph convolutional modules that capture spatial relationships in traffic data.
• STTNS.py is the core module implementing the Spatial-Temporal Transformer Networks for forecasting.
• layers.py contains reusable neural network layers and components that build up the network architecture.
• Entry Point & Training:
• main.py serves as the central pipeline for loading data, setting up the model, training, and evaluation.
• Additional Utility Components:
• Any other utility modules embedded in the codebase help glue the components together (though not separate directories, the file separation itself indicates modular design).
Interactions & Flow
• Data then flows to the network components where spatial dependencies (captured by GCN models) and temporal features (handled by transformer layers in STTNS) are processed.
• The layers defined in layers.py support both the GCN and transformer modules.
• main.py orchestrates the entire process, managing data flow, model instantiation, training loops, and evaluation.
• There’s clear data dependency: raw data → preprocessing → feature extraction → model inference/training → forecasting output.
Architectural Patterns & Design Principles
• Modularity: Each key function (data preprocessing, spatial modeling, temporal modeling) is encapsulated in its own module.
• Separation of Concerns: Data handling, model definition, and training processes are clearly separated into different files.
• Deep Learning Pipeline Structure: The data flows sequentially from ingestion to preprocessing to model evaluation.
Relevant Technologies/Frameworks
• Graph Neural Networks (GCN) and Transformer architectures are important aspects that should be highlighted.