# sdatkinson/neuralampmodelercore architecture

> Architecture diagram of the GitHub repository sdatkinson/neuralampmodelercore, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sdatkinson/neuralampmodelercore
- Repository: https://github.com/sdatkinson/neuralampmodelercore

## Overview

##### Main Components

a) Core Processing Components:
- DSP Module (dsp.h/cpp)
- Neural Network Models:
- WaveNet Implementation (wavenet.h/cpp)
- LSTM Implementation (lstm.h/cpp)
- ConvNet Implementation (convnet.h/cpp)
- Activation Functions Module (activations.h/cpp)

b) Utility Components:
- Utility Functions (util.h/cpp)
- Model Loading/Management (get_dsp.h/cpp)

c) Dependencies:
- Eigen Library (for linear algebra)
- nlohmann/json (for model configuration)

**┌─────────────────────────────────────────────┐**
- External Dependencies         │
- (Eigen Linear Algebra, nlohmann/json)     │
- ┤
- Core DSP Layer               │
- (Signal Processing Foundation)       │
- ┤
- Neural Network Models            │
- (WaveNet, LSTM, ConvNet variants)     │
- ┤
- Utility Services               │
- (Model Loading, Activation Functions)    │
- ┘

##### Component Relationships

- Data flow between DSP components and neural networks
- Model loading flow from disk to runtime
- Dependency injection paths
- Signal processing chain

##### Implementation Details to Highlight

- Relationship between different neural network architectures
- Where activation functions are applied
- Model loading and initialization points
- Test integration points

**┌─────────────────────────────────────────────────────┐**
- Model Storage                      │
- (.nam files, model configs)              │
- ┬───────────────────────────────┘
- ↓
**┌─────────────────────────────────────────────────────┐**
- Model Loading                      │
- (get_dsp.h/cpp utility)               │
- ┬───────────────────────────────┘
- ↓
**┌─────────────────────────────────────────────────────┐**
- Neural Network Core                   │
- (WaveNet, LSTM, ConvNet processors)         │
- ┬───────────────────────────────┘
- ↓
**┌─────────────────────────────────────────────────────┐**
- DSP Pipeline                       │
- (Audio signal processing)                │
- ┘

##### Additional Notes

- A testing framework section showing how the components are validated
- Benchmark points for performance monitoring
- Where the library interfaces with external plugins
- Configuration points for different model types

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef core fill:#000000,color:#FF0000,stroke:#FF0000
    classDef neural fill:#000000,color:#FF0000,stroke:#FF0000
    classDef utility fill:#000000,color:#FF0000,stroke:#FF0000
    classDef external fill:#000000,color:#FF0000,stroke:#FF0000
    classDef storage fill:#000000,color:#FF0000,stroke:#FF0000
    classDef testing fill:#000000,color:#FF0000,stroke:#FF0000

    %% External Dependencies Section
    subgraph Dependencies
        Eigen["💀 Eigen Linear Algebra"]:::external
        JSON["💀 nlohmann/json"]:::external
    end

    %% Model Storage Section
    subgraph ModelStorage
        Models["🔥 Model Files (.nam)"]:::storage
        WaveNetModel["🔥 WaveNet Model"]:::storage
        LSTMModel["🔥 LSTM Model"]:::storage
        Models --> WaveNetModel
        Models --> LSTMModel
    end

    %% Utility Layer
    subgraph UtilityLayer
        Utils["⚡ Utility Functions"]:::utility
        ModelLoader["⚡ Model Loading/Management"]:::utility
        ActivationFuncs["⚡ Activation Functions"]:::utility
    end

    %% Neural Network Core
    subgraph NeuralCore
        WaveNet["🤘 WaveNet Implementation"]:::neural
        LSTM["🤘 LSTM Implementation"]:::neural
        ConvNet["🤘 ConvNet Implementation"]:::neural
    end

    %% DSP Layer
    subgraph DSPLayer
        DSP["🎸 DSP Module"]:::core
    end

    %% Testing Framework
    subgraph Testing
        TestFramework["☠️ Testing Framework"]:::testing
        Benchmark["☠️ Benchmark Tools"]:::testing
    end

    %% Relationships
    Models --> ModelLoader
    ModelLoader --> WaveNet
    ModelLoader --> LSTM
    ModelLoader --> ConvNet
    
    WaveNet --> DSP
    LSTM --> DSP
    ConvNet --> DSP
    
    ActivationFuncs --> WaveNet
    ActivationFuncs --> LSTM
    ActivationFuncs --> ConvNet
    
    Utils --> ModelLoader
    Utils --> DSP
    
    Eigen --> DSP
    JSON --> ModelLoader

    TestFramework --> DSP
    TestFramework --> WaveNet
    TestFramework --> LSTM
    TestFramework --> ConvNet
    Benchmark --> DSP

    %% Click events for component mapping
    click DSP "https://github.com/sdatkinson/neuralampmodelercore/blob/main/NAM/dsp.h"
    click WaveNet "https://github.com/sdatkinson/neuralampmodelercore/blob/main/NAM/wavenet.h"
    click LSTM "https://github.com/sdatkinson/neuralampmodelercore/blob/main/NAM/lstm.h"
    click ConvNet "https://github.com/sdatkinson/neuralampmodelercore/blob/main/NAM/convnet.h"
    click ActivationFuncs "https://github.com/sdatkinson/neuralampmodelercore/blob/main/NAM/activations.h"
    click ModelLoader "https://github.com/sdatkinson/neuralampmodelercore/blob/main/NAM/get_dsp.h"
    click Utils "https://github.com/sdatkinson/neuralampmodelercore/blob/main/NAM/util.h"
    click Eigen "https://github.com/sdatkinson/neuralampmodelercore/tree/main/Dependencies/eigen"
    click JSON "https://github.com/sdatkinson/neuralampmodelercore/blob/main/Dependencies/nlohmann/json.hpp"
    click TestFramework "https://github.com/sdatkinson/neuralampmodelercore/tree/main/tools/test/"
    click Benchmark "https://github.com/sdatkinson/neuralampmodelercore/blob/main/tools/benchmodel.cpp"
    click WaveNetModel "https://github.com/sdatkinson/neuralampmodelercore/blob/main/example_models/wavenet.nam"
    click LSTMModel "https://github.com/sdatkinson/neuralampmodelercore/blob/main/example_models/lstm.nam"
    click Models "https://github.com/sdatkinson/neuralampmodelercore/tree/main/example_models/"

    %% Legend
    subgraph Legend
        L1["🎸 Core Components"]:::core
        L2["🤘 Neural Network Components"]:::neural
        L3["⚡ Utility Components"]:::utility
        L4["💀 External Dependencies"]:::external
        L5["🔥 Storage Components"]:::storage
        L6["☠️ Testing Components"]:::testing
    end
```
