Built a PyTorch optimizer based on Continuous Thermodynamics

3moorebbb1 pts0 comments

GitHub - 3moorebbb-sketch/MEP-Unified-Architecture: An empirical demonstration of a minimal continuous dynamical system capable of elementary Boolean logic, serving as a unit cell for a theoretical, thermodynamically entangled AI architecture. · GitHub

/" data-turbo-transient="true" />

Skip to content

Search/

Sign in<br>Sign upAppearance settings

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

3moorebbb-sketch

MEP-Unified-Architecture

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>119 Commits<br>119 Commits

docs

docs

research

research

software

software

LICENSE

LICENSE

MEP_Unified_Whitepaper V5.0

MEP_Unified_Whitepaper V5.0

README.md

README.md

epilogue_v5_0.md

epilogue_v5_0.md

index.html

index.html

mep_master_document_v5_0

mep_master_document_v5_0

setup.py

setup.py

View all files

Repository files navigation

The MEP Architecture Suite (V5.0)Mandelbrot-Euler-Planck: Bridging Thermodynamic Physics and Deep LearningThe MEP Suite is a collection of open-source PyTorch modules that replace standard digital heuristics with continuous-space, physics-based algorithms.Instead of treating a neural network as a rigid spreadsheet of discrete weights, the MEP Architecture treats it as a physical topology subject to heat, mass, Riemannian curvature, and elastic surface tension.Installationpip install mep-architecture-suite<br>Module 1: The Riemannian Thermodynamic OptimizerStandard optimizers like Adam navigate high-dimensional spaces using mathematical gradients, often becoming trapped in local minima or saddle points. The MEP RiemannianOptimizer treats the loss landscape as a physical environment:Local Heat Capacity: Calculates spatial curvature (a diagonal Riemannian metric) to scale step size.Physical Mass: Applies underdamped physical momentum to roll through shallow traps.Langevin Thermal Noise: Injects scaled thermal shock to physically bounce the state out of deep saddle points.Empirical Benchmark: On a 100-D non-convex Rastrigin landscape (50 seeds), the MEP Thermodynamic Engine successfully out-navigated the PyTorch AdamW baseline to find a lower global minimum.Usage:import torch<br>import torch.nn as nn<br>from mep_suite import RiemannianOptimizer

model = nn.Sequential(nn.Linear(10, 64), nn.ReLU(), nn.Linear(64, 1))

Drop-in replacement for torch.optim.Adam

optimizer = RiemannianOptimizer(<br>model.parameters(),<br>lr=0.05,<br>base_temp=0.1, # Langevin thermal noise intensity<br>annealing_rate=0.99, # Simulated annealing cooldown<br>mass=0.90 # Underdamped physical momentum

Standard training loop...

Module 2: Topological Jacobian Memory (The $\mathcal{P}$ Operator)Catastrophic Forgetting is the primary bottleneck in continual learning. Standard regularization attempts to "freeze" internal weights, which shatters the network's manifold.The MEP V5.0 Architecture introduces the Jacobian Topological Tether. It abandons the internal coordinates entirely and instead protects the functional surface geometry of the network. Using Hutchinson's Jacobian-Vector Product (JVP) trace estimator, it tells the network: "Learn Task B however you want, but if your internal changes cause the topological surface of Task A to deform, you will be penalized."Empirical Benchmark: On the Split-MNIST continual learning benchmark, the industry-standard Elastic Weight Consolidation (EWC) retained 4.65% of prior knowledge. The MEP Jacobian Tether achieved 91.49% retention, successfully proving the existence of the "lossy geometric scar."Usage:from mep_suite import MEPTopologicalNetwork, compute_topological_tether

1. Anchor your previously trained network

model_old = MEPTopologicalNetwork()<br>model_old.load_state_dict(torch.load('task_a_weights.pth'))

2. Train the current model on new data

model_current = MEPTopologicalNetwork()<br>model_current.load_state_dict(model_old.state_dict())

During your training loop for Task B:

for data_B, target_B in task_B_loader:<br>optimizer.zero_grad()

# Standard Loss for new task<br>loss_B = criterion(model_current(data_B), target_B)

# MEP Topological Tether (Requires sample inputs from Task A)<br>tether_penalty = compute_topological_tether(model_current, model_old, x_anchors_A)

# Backpropagate through the Jacobian vector product!<br>total_loss = loss_B + (LAMBDA * tether_penalty)<br>total_loss.backward()<br>optimizer.step()

DocumentationFor the full theoretical background, mathematical proofs, and formal preregistration crucible results, please see the HTML documentation in the repository or read the formal Unified Whitepaper.Author: 3MOORE. BBBLicense: MIT

About<br>An empirical demonstration of a minimal continuous dynamical...

architecture standard network physical jacobian task

Related Articles