PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

Related simulators

Continue with similar topics in this category — or all 46 in Thermodynamics.

View category →
NewSchool

Brownian Motion

Launch Simulator

Heavy particle with random kicks and friction; trail and running ⟨r²⟩ vs time.

NewSchool

Joule–Thomson Throttling

Launch Simulator

Isenthalpic expansion: ideal gas ΔT = 0; toy μ_JT inversion for real gases.

NewSchool

Open-Channel Flow & Hydraulic Jump

Launch Simulator

Rectangular-channel Froude number, critical depth, conjugate depths, energy loss, and subcritical/supercritical regimes.

School

Phase Diagram

Launch Simulator

Temperature-pressure diagram with phase transitions.

NewSchool

Wolfram Elementary Cellular Automata

Launch Simulator

1D binary CA with Wolfram code R∈[0,255]: space–time raster, periodic or null boundaries, single-cell or random IC, rule-bit strip, and informal class hints for textbook rules (e.g. 30, 90, 110, 184).

NewSchool

Adiabatic Cloud Parcel

Launch Simulator

Lift moist air: dry Γ, LCL, toy moist lapse; RH and cartoon cloud vs height.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Thermodynamics/Hopfield Associative Memory

Hopfield Associative Memory

10×10 binary Hopfield network: Hebbian pattern storage, energy E = −½ Σ w_ij S_i S_j, and random asynchronous updates that flow downhill to fixed-point recall after noisy cues.

Hopfield net

25
0.25

Presets (load into grid)

N = 100 binary neurons; Hebb rule with P ≤ 7 patterns. Click-drag the lattice to paint. Async updates drive E = −½ Σ w_ij S_i S_j downhill (zero-temperature recall).

Shortcuts

  • •Space / Enter — run / pause recall
  • •P — pause / resume
  • •R — reset patterns & spins

Measured values

Energy E0.00
Stored patterns P0
Best overlap m_μ—
Locally stable fraction1.00

About this model

A classical Hopfield network stores binary patterns ξ^μ on N = 100 spins arranged as a 10×10 grid. Symmetric Hebbian weights w_ij = (1/N) Σ_μ ξ_i^μ ξ_j^μ (zero diagonal) define the Lyapunov (energy) function E = −½ Σ_{i,j} w_ij S_i S_j. Asynchronous zero-temperature updates S_i ← sign(Σ_j w_ij S_j) never increase E, so noisy states relax toward stored attractors—the standard cartoon of associative memory and an energy landscape, with caveats about capacity and spurious minima when P grows.

Who it's for: Students in statistical mechanics, neural-networks introductions, or information theory who want a hands-on Hopfield energy picture.

Key terms

  • Hopfield model
  • Hebbian learning
  • Associative memory
  • Energy function
  • Attractor network
  • Asynchronous dynamics

How it works

Small Hopfield associative memory on a 10×10 grid: Hebbian weights, energy landscape, paint states, memorize patterns, add noise, and watch zero-temperature async dynamics retrieve a stored attractor.

Key equations

w_ij = (1/N) Σ_μ ξ_i^μ ξ_j^μ (i ≠ j), E = −½ Σ_{i,j} w_ij S_i S_j, update: pick i at random, set S_i = sign(Σ_j w_ij S_j) (tie keeps S_i).

Frequently asked questions

Why cap at seven patterns?
The classic Hopfield capacity on random unbiased patterns scales like P ~ 0.14 N in this normalization; seven is a conservative teaching cap on N = 100 before overlaps and spurious states dominate.
Does synchronous updating also lower E?
Not guaranteed. The Hopfield Lyapunov argument is standard for random sequential (single-unit) updates; parallel sweeps can increase energy and oscillate.
What does the overlap readout mean?
For each stored pattern μ, m_μ = N⁻¹ Σ_i ξ_i^μ S_i measures alignment of the current state with that memory; the sidebar highlights the largest magnitude among them as a quick “which memory wins” indicator near convergence.