Correlogram

Neural Network Hyperparameters

ML model performance correlogram across architecture configurations

Output
Neural Network Hyperparameters
Python
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np

np.random.seed(654)

n = 150
models = np.random.choice(['CNN', 'RNN', 'Transformer'], n)
data = {
    'Accuracy': np.where(models == 'Transformer', np.random.normal(0.92, 0.03, n),
                        np.where(models == 'CNN', np.random.normal(0.88, 0.04, n), np.random.normal(0.85, 0.05, n))),
    'Params (M)': np.where(models == 'Transformer', np.random.normal(125, 30, n),
                          np.where(models == 'CNN', np.random.normal(25, 8, n), np.random.normal(15, 5, n))),
    'Latency (ms)': np.where(models == 'Transformer', np.random.normal(50, 15, n),
                            np.where(models == 'CNN', np.random.normal(20, 5, n), np.random.normal(35, 10, n))),
    'Loss': 1 - np.where(models == 'Transformer', np.random.normal(0.92, 0.03, n),
                        np.where(models == 'CNN', np.random.normal(0.88, 0.04, n), np.random.normal(0.85, 0.05, n))) + np.random.normal(0, 0.02, n),
    'Model': models
}
df = pd.DataFrame(data)

plt.style.use('dark_background')
sns.set_style("darkgrid", {'axes.facecolor': '#0a0a0f', 'figure.facecolor': '#0a0a0f', 'grid.color': '#333333'})

palette = {'CNN': '#27D3F5', 'RNN': '#6CF527', 'Transformer': '#F527B0'}

g = sns.pairplot(
    df,
    hue='Model',
    palette=palette,
    height=2,
    kind='reg',
    diag_kind='kde',
    markers=['o', 's', 'D'],
    plot_kws={'scatter_kws': {'alpha': 0.65, 's': 50, 'edgecolor': 'white', 'linewidths': 0.4}, 'line_kws': {'linewidth': 2}},
    diag_kws={'alpha': 0.5, 'linewidth': 2.5}
)

g.fig.set_facecolor('#0a0a0f')
for ax in g.axes.flat:
    if ax:
        ax.set_facecolor('#0a0a0f')
        for spine in ax.spines.values():
            spine.set_color('#333333')
        ax.tick_params(colors='#888888')
        ax.xaxis.label.set_color('white')
        ax.yaxis.label.set_color('white')

g.fig.suptitle('Deep Learning Architecture Comparison', fontsize=14, fontweight='bold', color='white', y=1.02)
plt.setp(g._legend.get_title(), color='white')
plt.setp(g._legend.get_texts(), color='white')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Statistical

Did this help you?

Support PyLucid to keep it free & growing

Support