# dikashmashree/pytorch-googlenet-implementation architecture

> Architecture diagram of the GitHub repository dikashmashree/pytorch-googlenet-implementation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dikashmashree/pytorch-googlenet-implementation
- Repository: https://github.com/dikashmashree/pytorch-googlenet-implementation

## Overview

##### Project Type and Purpose
- This is a self-contained, educational PyTorch implementation of the GoogLeNet (Inception-v1) convolutional neural network.
- It’s intended as an open-source reference for understanding, experimenting with, and extending the Inception architecture from scratch.

##### File Structure
Top-level files and folders:
- Pytorch-InceptionNet.py – contains the definition of the Inception modules and the overall GoogLeNet class.
- main.py – the orchestration script: data loading, hyperparameter setup, training/validation loops, and result reporting.
- .keras / .lightning_studio / .idea / .vscode – IDE and environment config; not directly part of the runtime architecture but indicate integration with Keras compatibility and Lightning Studio for launch scripts.
No separate “data” or “utils” folders, so all functionality is currently in these two main scripts.

##### README for Additional Insights
- Pure PyTorch with no external pre-trained models.
- Modular code: Inception modules are broken out into reusable classes.
- Customizability: users can swap hyperparameters or inject new layers.
- Focus is on clarity and extension, not production-grade deployment pipelines.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        DS["Dataset\n(Torchvision/custom)"]:::data
        TF["Transforms\n(preprocessing)"]:::data
        DL["DataLoader"]:::data
        DS -->|images| TF -->|tensors| DL
    end

    %% Model Layer
    subgraph "Model Layer"
        MD["Model Definition\n(Pytorch-InceptionNet.py)"]:::model
        subgraph "InceptionModule"
            C1["Conv1×1"]:::model
            C3["Conv3×3"]:::model
            C5["Conv5×5"]:::model
            PP["Pool + 1×1"]:::model
            MO["Module Output\n(Tensor)"]:::model
            C1 --> MO
            C3 --> MO
            C5 --> MO
            PP --> MO
        end
        GN["GoogLeNet"]:::model
        MD --> InceptionModule
        InceptionModule --> GN
        DL --> GN
    end

    %% Training Layer
    subgraph "Training Layer"
        TE["Training Engine\n(main.py)"]:::train
        HM["Hyperparameter Manager"]:::train
        OS["Optimizer & Scheduler"]:::train
        TL["Training Loop"]:::train
        VL["Validation Loop"]:::train
        CL["Checkpointing & Logging"]:::train
        TE --> HM
        TE --> OS
        TE --> TL
        TE --> VL
        TE --> CL
        GN --> TE
        DL --> TL
    end

    %% Configuration & Environment
    subgraph "Configuration & Env"
        KJ[".keras/keras.json"]:::config
        RC[".lightning_studio/.studiorc"]:::config
        OSH[".lightning_studio/on_start.sh"]:::config
        OSP[".lightning_studio/on_stop.sh"]:::config
        KJ --> DL
        RC --> TE
        OSH --> TE
        OSP --> TE
    end

    %% External Libraries
    subgraph "External Libraries"
        PT["PyTorch\n(torch, torchvision)"]:::ext
        KL["Keras JSON Config"]:::ext
        LS["Lightning Studio Runtime"]:::ext
        TE --> PT
        DL --> PT
        KJ --> KL
        TE --> LS
    end

    %% IDE & Editor Config
    subgraph "IDE & Editor Config"
        ID[".idea/"]:::ide
        VS[".vscode/"]:::ide
    end

    %% Documentation
    DOC["README.md"]:::doc

    %% Click Events
    click MD "https://github.com/dikashmashree/pytorch-googlenet-implementation/blob/main/Pytorch-InceptionNet.py"
    click TE "https://github.com/dikashmashree/pytorch-googlenet-implementation/blob/main/main.py"
    click KJ "https://github.com/dikashmashree/pytorch-googlenet-implementation/blob/main/.keras/keras.json"
    click RC "https://github.com/dikashmashree/pytorch-googlenet-implementation/blob/main/.lightning_studio/.studiorc"
    click OSH "https://github.com/dikashmashree/pytorch-googlenet-implementation/blob/main/.lightning_studio/on_start.sh"
    click OSP "https://github.com/dikashmashree/pytorch-googlenet-implementation/blob/main/.lightning_studio/on_stop.sh"
    click ID "https://github.com/dikashmashree/pytorch-googlenet-implementation/tree/main/.idea/"
    click VS "https://github.com/dikashmashree/pytorch-googlenet-implementation/tree/main/.vscode/"
    click DOC "https://github.com/dikashmashree/pytorch-googlenet-implementation/blob/main/README.md"

    %% Styles
    classDef data fill:#D0E6FF,stroke:#0366d6,color:#0366d6;
    classDef model fill:#DFFFE0,stroke:#28a745,color:#28a745;
    classDef train fill:#FFD8A8,stroke:#d15704,color:#d15704;
    classDef config fill:#F3E6FF,stroke:#6f42c1,color:#6f42c1;
    classDef ext fill:#E2E3E5,stroke:#586069,color:#586069;
    classDef ide fill:#F0F0F0,stroke:#666666,color:#666666;
    classDef doc fill:#FFF5B1,stroke:#735C0F,color:#735C0F
```
