# anand-lab-172/sotam architecture

> Architecture diagram of the GitHub repository anand-lab-172/sotam, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anand-lab-172/sotam
- Repository: https://github.com/anand-lab-172/sotam

## Overview

##### Project Type & Purpose
- The project is a machine learning / deep learning library focusing on time-series prediction.
- It is designed to streamline the workflow—from automated data preprocessing to model training, evaluation, prediction, and forecasting—using a customizable LSTM architecture.
- Key features include dynamic hardware utilization (GPU/CPU selection via MirroredStrategy), training optimizations (callbacks like EarlyStopping and ModelCheckpoint), comprehensive evaluation metrics, and interactive visualizations.

##### Analyzing the File Structure
- The file tree is minimalistic. The primary files include:
- README.md: Provides comprehensive documentation.
- sotam.py: Likely contains the main implementation of the VLSTM model and its methods.
- VLSTM_Code.pdf and VLSTM_Use_Cases.pdf: Supplementary materials detailing design aspects and use cases.
- The absence of separate “src”, “backend”, or “frontend” directories indicates the project is written as a self-contained Python module focused on a core ML library.

##### Identifying the Main Components
- Data Ingestion & Preprocessing:
- Input Data: Represented by CSV files (for example, INTC.csv) or any Pandas DataFrame.
- Data Preprocessing Module: Handles automated scaling (MinMaxScaler) and preparation of features and target variables.
- Model Architecture and Configuration:
- VLSTM Model: Illustrate the primary components of the network:
▪ LSTM layer 1 (customizable units)
▪ LSTM layer 2 (captures complex dependencies)
▪ Dense (fully connected) layer
▪ Dropout layer for regularization
▪ Output layer (with customizable activation for regression)
- How the architecture differs from a traditional LSTM.
- Training Pipeline:
- Training Procedure: Represent the training flow that includes preparing data, applying callbacks (EarlyStopping, ModelCheckpoint), and using dynamic resource selection (MirroredStrategy for multi-GPU support).
- Optimization Module: Incorporate training optimization mechanisms that improve efficiency and reduce overfitting.
- Evaluation & Prediction:
- Evaluation Component: Display how the model’s performance is assessed using metrics (MAE, RMSE, MAPE, MAD).
- Prediction Module: Illustrate the component that handles making predictions on new data and performs forecasting.
- Result Visualization:
- Visualization Module: Include components for interactive visuals—training loss plots, prediction comparison plots, and forecast visualizations (leveraging Plotly).
- External and Supporting Artifacts:
- Optional Hardware/Resource Component: Illustrate the dynamic hardware selection (GPU vs. CPU) that influences training performance.

##### Final Inclusions
- All major building blocks: Data Ingestion, Preprocessing, Model Layers, Callbacks, Training Module, Evaluation, and Visualization.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Ingestion & Preprocessing
    subgraph "Data Ingestion & Preprocessing"
        DataInput["Data Input (CSV)"]:::data
        Preprocessing["Data Preprocessing"]:::module
    end

    %% Model Architecture and Configuration
    subgraph "Model Architecture and Configuration"
        VLSTM["VLSTM Model Architecture"]:::module
    end

    %% Training Pipeline
    subgraph "Training Pipeline"
        Training["Training Procedure & Resource Management"]:::training
    end

    %% Evaluation & Prediction
    subgraph "Evaluation & Prediction"
        Evaluation["Evaluation Metrics & Prediction"]:::evaluation
    end

    %% Result Visualization
    subgraph "Result Visualization"
        Visualization["Result Visualization"]:::visualization
    end

    %% External and Supporting Artifacts
    subgraph "External & Supporting Artifacts"
        README["README.md"]:::external
        CodePdf["VLSTM_Code.pdf"]:::external
        UseCases["VLSTM_Use_Cases.pdf"]:::external
        Diagram["vlstm_arch.drawio"]:::external
    end

    %% Data Flow Connections
    DataInput -->|"scaled_data"| Preprocessing
    Preprocessing -->|"prepared_data"| VLSTM
    VLSTM -->|"trained_model"| Training
    Training -->|"model_weights"| Evaluation
    Evaluation -->|"predictions"| Visualization

    %% External Documentation Reference
    README ---|"documentation"| VLSTM

    %% Click Events
    click DataInput "https://github.com/anand-lab-172/sotam/blob/main/INTC.csv"
    click Preprocessing "https://github.com/anand-lab-172/sotam/blob/main/sotam.py"
    click VLSTM "https://github.com/anand-lab-172/sotam/blob/main/sotam.py"
    click Training "https://github.com/anand-lab-172/sotam/blob/main/sotam.py"
    click Evaluation "https://github.com/anand-lab-172/sotam/blob/main/sotam.py"
    click Visualization "https://github.com/anand-lab-172/sotam/blob/main/sotam.py"
    click README "https://github.com/anand-lab-172/sotam/blob/main/README.md"
    click CodePdf "https://github.com/anand-lab-172/sotam/blob/main/VLSTM_Code.pdf"
    click UseCases "https://github.com/anand-lab-172/sotam/blob/main/VLSTM_Use_Cases.pdf"
    click Diagram "https://github.com/anand-lab-172/sotam/blob/main/vlstm_arch.drawio"

    %% Styles
    classDef data fill:#f9c,stroke:#333,stroke-width:2px;
    classDef module fill:#cff,stroke:#333,stroke-width:2px;
    classDef training fill:#cfc,stroke:#333,stroke-width:2px;
    classDef evaluation fill:#fc9,stroke:#333,stroke-width:2px;
    classDef visualization fill:#9cf,stroke:#333,stroke-width:2px;
    classDef external fill:#ffd,stroke:#333,stroke-width:2px;
```
