# patnicolas/geometriclearning architecture

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

- Interactive diagram: https://gitdiagram.com/patnicolas/geometriclearning
- Repository: https://github.com/patnicolas/geometriclearning

## Overview

This project, titled “Geometric Learning,” is a comprehensive framework that integrates advanced concepts in differential geometry, Lie groups, information geometry, fractal analysis, and signal processing with reusable deep learning components. The overall intent is to provide domain-specific tools for geometric data analysis (e.g., understanding manifold structures, Lie group operations) while also offering modular neural network building blocks that leverage these geometric insights.

##### Main Components
- Core Mathematical Modules:
– Geometry: Implements differential geometry concepts (manifolds, tangent spaces, Riemannian metrics) with visualization support.
– Lie: Contains implementations specifically focused on Lie groups (SO(3) and SE(3)), essential for modeling rotations and transformations.
– Information Geometry: Deals with the Fisher Information Metric and the geometric treatment of probability distributions.
– Metric: Provides methods to compute built-in and custom metrics.
- Deep Learning Modules:
– dl: Houses neural blocks (e.g., convolutional blocks, MLP blocks, graph neural blocks), loss functions, models, and training routines. This module also employs a builder (or recursive design) pattern for generating complex neural architectures.
– Model Builders & Neural Blocks: Illustrate the hierarchy and reusability strategies (e.g., MLPBuilder, Conv2dBuilder, GConvBlock, etc.) and the relationship between neural blocks and models.
- Data Handling Components:
– dataset: Provides dataset loaders in both tensor (e.g., MNIST, Caltech101) and graph forms, which are essential for feeding data into learning models.
- Control & Signal Processing:
– control: Contains implementations of filters (e.g., linear and extended Kalman filters) which are used for real-time signal estimation.
- Markov Chain Monte Carlo:
– mcmc: Implements sampling techniques (Metropolis-Hastings, proposal distributions) for statistical applications.
- Utility & Visualization:
– plots: Includes various plotting utilities that render the outputs of models (e.g., GNN visualization, generalized plotting) and aid in analysis.
– util: Contains helper functions for asynchronous operations, IO, profiling, and other cross-cutting concerns.
- Testing Framework:
– tests: Mirrors the project structure to ensure unit tests are in place for each component.

##### Architectural Patterns and Design Principles
- Reusability via Builder and Block Patterns: Within the deep learning branch, highlight the use of the Builder Pattern (i.e., MLPBuilder, Conv2dBuilder) that instantiates neural architectures by reusing configured neural blocks.

##### Relevant Technologies and Frameworks
- Python (Base Language)
- PyTorch (for implementing & training deep learning models)
- Geomstats (used in geometry and Lie modules)
- PyTorch Geometric (for graph neural block implementations)
- Visualization libraries (e.g., Matplotlib; referenced in plots)
- Utilities: Async operations, performance evaluation, etc.

##### Elements
- Clear Labels: Each component or module (e.g., “Geometry Module”, “Neural Blocks”, “Control – Kalman Filter”) must be distinctly labeled.

## Diagram (Mermaid)

```mermaid
flowchart TD 
    %% Geometric Computations
    subgraph "Geometric Computations"
        G("Geometry Module"):::math
        L("Lie Module"):::math
        IG("Information Geometry Module"):::math
        F("Fractal Module"):::math
        M("Metric Module"):::math
    end

    %% Deep Learning Framework
    subgraph "Deep Learning Framework"
        DS("Data Handling (dataset) Module"):::data
        NB("Neural Block Builders"):::dl
        DL("Deep Learning (dl) Module"):::dl
    end

    %% Utilities & Visualization
    subgraph "Utilities & Visualization"
        P("Plots"):::util
        U("Util"):::util
    end

    C("Control & Signal Processing Module"):::control
    MC("MCMC Module"):::mcmc
    T("Testing Framework"):::test

    %% Connections within Deep Learning Framework
    DS -->|"feeds"| DL
    NB -->|"builds"| DL

    %% Foundational contributions from Math Modules
    G -->|"informs"| DL
    L -->|"informs"| DL
    IG -->|"supports"| DL
    F -->|"supports"| DL
    M -->|"supports"| DL

    %% Math Modules contributing to Control
    G -->|"informs"| C
    L -->|"informs"| C

    %% DL output analysis and utility support
    DL -->|"analyzed_by"| P
    DL -->|"supported_by"| U

    %% Testing suite connections (dashed)
    T --- G
    T --- L
    T --- IG
    T --- F
    T --- M
    T --- DS
    T --- NB
    T --- DL
    T --- C
    T --- MC
    T --- P
    T --- U

    %% Click Events
    click G "https://github.com/patnicolas/geometriclearning/tree/main/python/geometry"
    click L "https://github.com/patnicolas/geometriclearning/tree/main/python/Lie"
    click IG "https://github.com/patnicolas/geometriclearning/tree/main/python/informationgeometry"
    click F "https://github.com/patnicolas/geometriclearning/tree/main/python/fractal"
    click M "https://github.com/patnicolas/geometriclearning/tree/main/python/metric"
    click DL "https://github.com/patnicolas/geometriclearning/tree/main/python/dl"
    click DS "https://github.com/patnicolas/geometriclearning/tree/main/python/dataset"
    click C "https://github.com/patnicolas/geometriclearning/tree/main/python/control"
    click MC "https://github.com/patnicolas/geometriclearning/tree/main/python/mcmc"
    click P "https://github.com/patnicolas/geometriclearning/tree/main/python/plots"
    click U "https://github.com/patnicolas/geometriclearning/tree/main/python/util"
    click T "https://github.com/patnicolas/geometriclearning/tree/main/tests"

    %% Styles
    classDef math fill:#FFD700,stroke:#DAA520,stroke-width:2px;
    classDef dl fill:#90EE90,stroke:#006400,stroke-width:2px;
    classDef data fill:#ADD8E6,stroke:#00008B,stroke-width:2px;
    classDef control fill:#FFB6C1,stroke:#FF69B4,stroke-width:2px;
    classDef mcmc fill:#FFA07A,stroke:#FF4500,stroke-width:2px;
    classDef util fill:#DDA0DD,stroke:#800080,stroke-width:2px;
    classDef test fill:#EEE8AA,stroke:#BDB76B,stroke-dasharray:5,5,stroke-width:2px;
```
