Skip to main content

Module diffusion

Module diffusion 

Source

Functions§

anneal_accept
Simulated-annealing acceptance: accept a move with energy change delta at temperature with probability 1 if improving (delta <= 0), else exp(-delta/T). rand01 ∈ [0,1).
cool
Geometric cooling schedule T_{k+1} = T_k · cooling_rate (cooling_rate ∈ (0,1)).
diffuse_step
One CPU step of gradient-based belief diffusion (discrete graph Laplacian): each node’s belief moves toward its neighbours’ average by rate ∈ [0,1]. edges are undirected (i,j) index pairs. Writes the updated beliefs into out. Zero-heap (caller buffers, no allocation).
execute_diffusion_pass
inject_energy
Dynamic energy injection: boost a (dormant) node’s activation by energy, clamped to [0,1] — re-activates a subgraph that diffusion can then spread.
trigger_diffusion
Trigger a diffusion pass for the named graph. Returns true if enqueued, false if the graph_id is empty (no-op). The actual GPU pass runs async via execute_diffusion_pass; this function is a synchronous CLI entry-point.