How to Train Your Resistive Network: Generalized Equilibrium Propagation and Analytical Learning J. Lin, A. Desai, F. Barrows, F. Caravelli Abstract Machine learning is a powerful method of extracting meaning from data; unfortunately, current digital hardware is extremely energy-intensive. There is interest in an alternative analog computing implementation that could match the performance of traditional machine learning while being significantly more energy-efficient. However, it remains unclear how to train such analog computing systems while adhering to locality constraints imposed by the physical (as opposed to digital) nature of these systems. Local learning algorithms such as Equilibrium Propagation and Coupled Learning have been proposed to address this issue. In this paper, we develop an algorithm to exactly calculate gradients using a graph theoretic and analytical framework for Kirchhoff’s laws. We also introduce Generalized Equilibrium Propagation, a framework encompassing a broad class of Hebbian learning algorithms, including Coupled Learning and Equilibrium Propagation, and show how our algorithm compares. We demonstrate our algorithm using numerical simulations and show that we can train resistor networks without the need for a replica or control over all edges. I Introduction Modern machine learning achieves impressive accuracy, but its energy cost is increasingly dominated by data movement rather than arithmetic, motivating interest in physical substrates that perform inference in situ by relaxing to steady states 6 ; 27 ; 19 ; 20 . Resistive and in-memory electrical networks are especially appealing in this context because they naturally implement low-power linear operations 32 ; 38 ; 40 ; 4 ; 11 . A central obstacle to training physical systems are locality constraints: hardware exposes only local voltages and currents, whereas standard gradient-based learning assumes access to global error signals. Two-phase learning rules, most prominently Equilibrium Propagation (EP) 31 ; 21 , address this mismatch by running two nearby steady-state experiments under the same inputs in both a free phase and a nudged (weakly clamped) phase. A local update is then formed from differences between the two equilibria, which in resistive circuits often reduces to a “difference-of-squares” rule. Related approaches, including Coupled Learning (CL) 35 ; 34 ; 15 ; 14 , implement the second phase by directly clamping the outputs rather than explicitly modifying the energy 39 ; 24 . While attractive, these schemes require controlled nudging hardware and suffer from systematic estimation bias due to finite nudges 23 . Some implementations further rely on replica (“twin”) networks for contrastive readout 29 ; 18 . In this letter we focus on the simplest setting of linear, memoryless (but tunable) resistor networks: a clean testbed for theory and co-design. Because the circuit admits a closed-form linear response, we show how to bypass nudging entirely and compute exact gradients with respect to edge resistances, in a form implementable using local measurements and a small number of voltage- and current-mode circuit evaluations. To place this exact “projector-based” update in context, we also introduce Generalized Equilibrium Propagation (GEP), a perturbative viewpoint that unifies EP and CL by the order of their nudging perturbation, enabling a direct comparison between two-phase estimators and the analytical circuit gradient. Our protocols use a single physical network (no replica is required) and naturally accommodate partial actuation, sensing, and tunability across programmable-impedance platforms 12 ; 28 ; 37 ; 36 . In particular, they align with emerging “learning machines” viewpoints where hardware, dynamics, and learning rules are co-designed rather than abstracted away. Section II.1 gives a minimal physical derivation of GEP via linear response theory. We then specialize to resistor networks, introduce the response operator formulation, and present both contrastive two-phase and projector-based analytical-gradient training rules. Section II discusses standard two-phase learning in electrical circuits and introduces the analytical (projector-based) gradient method, which is the main result of this manuscript. Section III applies these learning algorithms to both the classification and regression settings, demonstrating the difference between the analytical method and a representative two phase method. Conclusions follow. II Learning Rules for Physical Systems II.1 Two-phase from linear response Let us begin with a definition of two-phase learning . In this context, we mean any learning protocol that estimates a parameter update by comparing two nearby steady states of the same (or a replicated) physical system under the same inputs using: (i) a free phase, in which the system relaxes naturally, and (ii) a weakly nudged (or clamped ) phase, in which a small external “training field” is applied to encode the target. In this sense, as we show here, two-phase rules are concrete realizations of linear-response ideas from nonequilibrium statistical mechanics: the parameter update is inferred from how the steady state shifts under a weak perturbation 7 ; 22 ; 30 . These two-phase learning rules can be understood through the analytical framework provided by GEP. The full derivation of GEP is provided in Appendices IV.1 and IV.2 , and we provide a brief overview here. We consider an input-clamped physical system with state y\in\mathbb{R}^{n} and energy (or free energy at finite temperature) E_{\theta}(y) depending on tunable parameters \theta . A broad class of dissipative dynamics can be written as a gradient flow \dot{y}=-\Gamma\nabla_{y}E_{\theta}(y),\qquad\Gamma\succ 0, (1) so relaxation decreases E_{\theta} and converges to a stable equilibrium y^{0}(\theta) with \nabla_{y}E_{\theta}(y^{0})=0 (see, e.g., standard references on gradient flows 1 ). This free phase is simply the steady state reached under the imposed inputs. To incorporate targets, we apply a small training field (a weak clamp on outputs) to induce a nudged energy: \displaystyle F(\beta,\theta,y) \displaystyle= \displaystyle E_{\theta}(y)+\beta C(\theta,y) (2) for an effective cost function C . We let y^{\beta}(\theta) be the resulting nudged/clamped phase equilibrium, \nabla_{y}F(\beta,\theta,y^{\beta})=0 . In the linear-response regime \beta\to 0 , the shift y^{\beta}-y^{0} is O(\beta) and encodes the susceptibility of the steady state to the applied field 22 ; 7 . Defining the objective function as J(\theta):=C(y^{0}(\theta)) , one obtains the Equilibrium Propagation identity 31 \partial_{\theta}J(\theta)=\lim_{\beta\to 0}\frac{1}{\beta}\Big[\partial_{\theta}F(\beta,\theta,y^{\beta})-\partial_{\theta}F(0,\theta,y^{0})\Big]. (3) Equation ( 3 ) makes explicit why two-phase learning is “physical”: the gradient is recovered by comparing two relaxation experiments, free evolution to y^{0} and weakly clamped evolution to y^{\beta} , and forming a local difference of energy derivatives evaluated at the two steady states 31 . Equilibrium Propagation (EP) and Coupled Learning (CL) are both two-phase methods: they compare a free steady state to a nearby nudged steady state and extract an update from their difference 31 ; 35 ; 33 . Mathematically, both EP and CL have nudged energies of the form \displaystyle F(\beta,\theta,y)=E_{\theta}(y)+n(\beta,\theta,y) (4) The primary difference between the two learning rules is that EP uses an explicit linear energy nudge, while CL nudges by output clamping (a state shift inside the same energy). In other words, the key distinction is the perturbative order of the nudging perturbation at the free equilibrium point y^{0} : \displaystyle n_{EP}(\beta,\theta,y^{0}) \displaystyle= \displaystyle\beta\,C(\theta,y^{0})=O(\beta) (5) \displaystyle n_{CL}(\beta,\theta,y^{0}) \displaystyle= \displaystyle E_{\theta}\!\big(y^{0}+\epsilon\big)-E_{\theta}(y^{0})=O(\beta^{2}) (6) where \epsilon is an O(\beta) error vector (see Appendix IV.3 for details). In EP, the nudged energy differs from the free energy by an O(\beta) term at y^{0} . In CL the leading change is O(\beta^{2}) . 35 ; 33 . We can capture both cases within a single perturbative framework by assuming that that n(\beta,\theta,y)=O(\beta^{k}) to leading order for some integer k\geq 1 . Similarly, we assume that the free and nudged equilibria y^{0}(\theta) and y^{\beta}(\theta) satisfy \|y^{\beta}-y^{0}\|=O(\beta^{k}) . If we have a generalized objective function of the form \displaystyle\ell(\theta)=\frac{1}{k!}\partial_{\beta}^{k}n(0,\theta,y^{0}), (7) the GEP identity states that the leading-order two-phase finite difference in parameter derivatives is proportional to \partial_{\theta}\ell(\theta) : \lim_{\beta\to 0}\frac{1}{\beta^{k}}\Big[\partial_{\theta}F(\beta,\theta,y^{\beta})-\partial_{\theta}F(0,\theta,y^{0})\Big]=\partial_{\theta}\ell(\theta), (8) This identity is rigorously derived in Appendix IV.2 . Note that EP emerges in the case when k=1 (linear nudge) 31 while CL corresponds to k=2 (quadratic nudge) 35 ; 33 , placing their two-phase estimators on a common footing for comparison with the exact resistor-network gradients developed next. II.2 Learning with Electrical Circuits We now specialize to passive linear resistor networks , where the steady state admits an explicit linear input-output map 17 ; 13 ; 41 ; 26 . For full generality, we assume the circuit to be associated with a connected graph \mathcal{G}=(\mathcal{V},\mathcal{E}) with \mathrm{N}=|\mathcal{V}| nodes and \mathrm{E}=|\mathcal{E}| edges ( \mathrm{E_{i}} input edges and \mathrm{E_{o}} output edges); each edge e contains an ideal voltage source s_{e} in series with a resistor of resistance r_{e}>0 (conductance g_{e}=r_{e}^{-1} ). We collect edgewise quantities into vectors \bm{s},\bm{i},\bm{v}\in\mathbb{R}^{\mathrm{E}} , where \bm{s} are imposed source voltages, \bm{i} are steady-state edge currents, and \bm{v} are Ohmic voltage drops across resistors (so v_{e}=r_{e}i_{e} ). Let G=\diag(g_{e})\succ 0,\qquad R=\diag(r_{e})=G^{-1}. (9) To obtain a closed-form circuit response, we use a standard cycle-space formulation of Kirchhoff constraints 17 ; 13 ; 9 ; 8 ; Barrows2024 and fix a circuit orientation. Let A\in\mathbb{R}^{\mathrm{\mathrm{C}}\times\mathrm{E}} be a cycle matrix spanning the \mathrm{C}=\mathrm{E}-\mathrm{N}+1 fundamental cycles. Solving Kirchhoff constraints together with dissipation minimization (Thomson/Dirichlet principles 16 ; 5 ) yields a linear edge-space map (derivation in Appendix IV.4 ) \bm{v}=-\Omega_{A/R}\bm{s},\qquad\Omega_{A/R}:=R\,A^{\top}(ARA^{\top})^{-1}A, (10) which can be interpreted as a (weighted) cycle-space projector written in edge variables 10 ; 41 ; 26 . We identify the R -weighted cycle-space projector \Omega_{A/R} as the central learning operator in passive resistor networks and derive an exact, physically interpretable gradient for training edge conductances. Currents follow from Ohm’s law, \bm{i}=R^{-1}\bm{v}=-R^{-1}\Omega_{A/R}\bm{s}. (11) Operationally, a voltage-mode experiment implements \bm{s}\mapsto\bm{v} (i.e., left multiplication by -\Omega_{A/R} ), while reciprocal/current-mode manipulations provide access to \Omega_{A/R}^{\top} via standard reciprocity properties of passive linear networks 17 ; 41 . This transpose-access primitive is the key ingredient exploited by the projector-based learning rule below, connecting circuit measurements to two-phase gradient estimators in energy-based learning. Figure 1: A schematic comparison between (a) two-phase gradient estimation and (b) projector-based gradient estimation. The two-phase estimate uses purely voltage-mode biasing and measurement to obtain a gradient proxy, while the projector-based estimator mixes voltage- and current-mode manipulations. In two-phase learning, both input and error signals are encoded as voltage sources; in projector-based learning, error signals are encoded via current sources to access an adjoint projector action. II.3 Two learning paradigms: contrastive two-phase vs. projector gradients Vanilla two-phase learning. We now consider our vanilla two-phase learning algorithm (EP-style). Let P_{o}\in\{0,1\}^{\mathrm{E}\times\mathrm{E_{o}}} be a linear operator selecting the \mathrm{E_{o}} output edges and define \bm{y}\in\mathbb{R}^{\mathrm{E_{o}}} to be the desired target readout. Equilibrium Propagation introduces a weak output clamp by augmenting the (dissipation) energy with \frac{\beta}{2}\|P_{o}^{\top}\bm{v}-\bm{y}\|^{2} and compares a free equilibrium to a nudged equilibrium. The resulting local two-phase update is a difference of squares; in resistance form, \frac{\partial J}{\partial\bm{r}}=\lim_{\beta\to 0}\frac{1}{2\beta}\Big[\bm{i}_{C}^{\odot 2}-\bm{i}_{F}^{\odot 2}\Big], (12) where \bm{i}_{F} and \bm{i}_{C} are the free- and clamped-phase steady-state currents. \Omega -based (projector) learning. Because the circuit is linear, we can instead differentiate the closed-form map ( 10 )–( 11 ) and obtain an analytical gradient with respect to \bm{r} . Crucially, the resulting expressions can be implemented physically using a small number of voltage- and current-mode experiments that realize \Omega_{A/R} and \Omega_{A/R}^{\top} . This avoids finite- \beta bias and does not require engineering a nudged energy, in contrast to vanilla two-phase learning. We view \bm{v}(\bm{r};\bm{s})=-\Omega_{A/R}\bm{s} as a function of \bm{r} with \bm{s} held fixed. Differentiating \bm{v}(\bm{r};\bm{s})=-RA^{\top}(ARA^{\top})^{-1}A\bm{s} yields the Jacobian \displaystyle J_{\bm{v}}(\bm{r}):=\frac{\partial\bm{v}}{\partial\bm{r}} \displaystyle=\diag(\bm{i})\;-\;\Omega_{A/R}\,\diag(\bm{i}) \displaystyle=(I-\Omega_{A/R})\,\diag(\bm{i}), (13) where \bm{i} is the steady-state current vector ( 11 ). For the least-squares loss \mathcal{L}(\bm{v},\bm{y})=\frac{1}{2}\|P_{o}\bm{v}-\bm{y}\|^{2} , the chain rule gives \nabla_{\bm{r}}\mathcal{L}=J_{\bm{v}}(\bm{r})^{\top}P_{o}^{\top}(\bm{v}-\bm{y})=\diag(\bm{i})\,(I-\Omega_{A/R}^{\top})\,P_{o}^{\top}(P_{o}\bm{v}-\bm{y}). (14) (Analogous expressions hold for other losses, e.g. hinge-style objectives; we return to classification variants in Section III.1 .) With J_{v}(r)=(I-\Omega_{A/R})\,\mathrm{diag}(i) : (i) the circuit implements the linear map v=-\Omega_{A/R}s and i=-R^{-1}\Omega_{A/R}s ; (ii) a key structural fact is that \Omega_{A/R} is an oblique projector: \Omega_{A/R}^{2}=\Omega_{A/R} ; (iii) for least squares, the local first-order condition is \mathrm{diag}(i)\,(I-\Omega_{A/R}^{\top})(v-v_{T})=0 ; (iv) the input–output voltages satisfy \displaystyle\|v_{\mathrm{(output)}}\|\leq\|s_{\mathrm{(input)}}\|_{2}\sqrt{R_{\max}/R_{\min}}, (15) where R_{\max} and R_{\min} denote the largest and smallest diagonal entries of R , respectively. For proof, see Appendices IV.4 - IV.5 . In the linear-response limit, the two-phase “difference-of-squares” update converges to \displaystyle\lim_{\beta\to 0}\frac{1}{2\beta}\bigl(\bm{i}_{C}^{\odot 2}-\bm{i}_{F}^{\odot 2}\bigr)=\diag(\bm{i}_{F})R^{-1}\Omega_{A/R}P_{o}^{\top}(\bm{y}-P_{o}\bm{v}_{F}) (16) See Appendix IV.6 for the full proof. Algorithm 1 Two-phase gradient estimation 1: S_{F}(\bm{x})\leftarrow\gamma P_{i}\bm{x} . 2: With voltage-mode biasing, compute \bm{v}=-\Omega_{A/R}S_{F}(\bm{x}) . 3: Measure the “free" edgewise currents, \bm{i}_{F} . 4: Measure output edges to compute \hat{\bm{y}}=P_{o}^{\top}\bm{v} . 5: Compute the error vector \epsilon=\beta(\hat{\bm{y}}-\bm{y}) . 6: S_{C}(\bm{x},\epsilon)\leftarrow S_{F}(\bm{x})+P_{o}\epsilon . 7: Apply S_{C} : Measure the “nudge" currents, \bm{i}_{C} . 8: Apply ( estimated ) gradient \Delta r=\bm{i}_{F}^{\odot 2}-\bm{i}_{C}^{\odot 2} . Algorithm 2 \Omega -gradient estimation 1: S_{F}(\bm{x})\leftarrow\gamma P_{i}\bm{x} . 2: With voltage-mode biasing, compute \bm{v}=-\Omega_{A/R}S_{F}(\bm{x}) . 3: Store the “free" edgewise currents, \bm{i}_{F} . 4: Measure output edges to compute \hat{\bm{y}}=P_{o}\bm{v} . 5: Compute the error vector \epsilon=\eta(\hat{\bm{y}}-\bm{y}) . 6: Compute \bm{i}_{\epsilon}=-\Omega_{A/R}^{\top}\epsilon via current-mode bias. 7: Compute \Delta=\epsilon+\bm{i}_{\epsilon} . 8: Apply ( analytical ) gradient \nabla_{r}\mathcal{L}(\hat{\bm{y}},\bm{y})=\bm{i}_{F}\odot\,\Delta . Figure 2: The two gradient estimation schemes discussed in this work used to modify the resistive states. Both methods train the mapping \hat{\bm{y}}=-P_{o}\Omega_{A/R}S_{F}(\bm{x}) as computed by a given resistive mesh. On the left algorithm, multiple measurements are required to compute the estimated gradient. In the \Omega gradient approach developed in this manuscript, only the output measurement is required. II.4 Circuits as tunable input–output maps To define inference and training experiments, we choose i input edges to actuate and o output edges to read out. Let P_{i}\in\{0,1\}^{\mathrm{E}\times\mathrm{E_{i}}} and P_{o}\in\{0,1\}^{\mathrm{E}\times\mathrm{E_{o}}} be the corresponding selector matrices. In a free (voltage-mode) inference step, an input \bm{x}\in\mathbb{R}^{\mathrm{E_{i}}} is encoded as an edge-source pattern \bm{s}_{F}(\bm{x})=\gamma P_{i}^{\top}\bm{x}, (17) yielding the steady-state ohmic drops and readout \bm{v}_{F}=-\Omega_{A/R}\bm{s}_{F}(\bm{x}),\qquad\hat{\bm{y}}=P_{o}^{\top}\bm{v}_{F}. (18) Training adjusts R so that \hat{\bm{y}}\approx\bm{y} . Vanilla two-phase learning introduces a second (clamped) experiment by adding a small error-proportional source perturbation on the output edges; equivalently, \bm{s}_{C}(\bm{x},\bm{y})=\bm{s}_{F}(\bm{x})+P_{o}\,\beta(\hat{\bm{y}}-\bm{y}), (19) so that free and clamped equilibria differ only on the output-edge sources. These two experiments lead to the contrastive update ( 12 ). In contrast, the projector gradient ( 14 ) uses the same free inference quantities together with physical realizations of \Omega_{A/R}^{\top} to compute an analytical update without nudging. For further details on edge reordering, block partitions, and equivalent source definitions, see Appendix IV.8 . Figure 3: Training results on the Wisconsin breast cancer classification dataset: both methods train the mesh classifier to reach 90% accuracy. (a) A schematic, with example voltages, of the circuit during inference: the 30-dimensional data is projected to 3 dimensions using PCA. The output class is read as the maximum over two voltmeters. (b) The learned configuration of edge resistances. (c) Confusion matrices for each gradient method. (d) Loss curves for both methods. While comparable accuracy is achieved by both classifiers, training with contrastive learning displays greater instability. (e) The decision boundary learned by each classifier. In Figure 1 we present a schematic of a circuit implementation of two phase learning and the projector based analytical gradient method. II.5 Learning Recipes We summarize the two training protocols in Fig. 2 using the same notation as above. Let P_{i}\in\{0,1\}^{E\times s} select the \mathrm{E_{i}} input edges and P_{o}\in\{0,1\}^{\mathrm{E}\times\mathrm{E_{o}}} select the \mathrm{E_{o}} output edges. Given an input \bm{x}\in\mathbb{R}^{\mathrm{E_{i}}} , we encode it as an edge-source pattern S_{F}(\bm{x})=\gamma P_{i}^{\top}\bm{x}, (20) where \gamma is a fixed input gain. Applying S_{F} in voltage mode produces the steady-state ohmic drops \bm{v}=-\Omega_{A/R}S_{F}(\bm{x}) , and the model output is obtained by reading out the selected output edges, \hat{\bm{y}}=P_{o}\bm{v}. (21) Thus, a single “inference” experiment consists of imposing S_{F}(\bm{x}) , then measuring \hat{\bm{y}} . Two-phase learning performs a gradient estimate by comparing this free experiment to a second, weakly clamped experiment. After measuring \hat{\bm{y}} , we form an error signal \epsilon=\beta(\hat{\bm{y}}-\bm{y}), (22) and inject it back onto the output edges as an additional source, defining the clamped bias pattern S_{C}(\bm{x},\bm{y})=S_{F}(\bm{x})+P_{o}\epsilon. (23) We then run the circuit a second time under S_{C} and measure the resulting steady-state edge currents \bm{i}_{C} ; we also store the free-phase currents \bm{i}_{F} from the first run. The contrastive (two-phase) update is local and edgewise: each resistance is driven by the difference between the squared currents observed in the free and clamped phases, \Delta\bm{r}\ =\bm{i}_{F}^{\odot 2}-\bm{i}_{C}^{\odot 2} (24) In other words, the clamped experiment slightly perturbs the network toward the target, and the change in dissipated power on each edge (proportional to i_{e}^{2}r_{e} ) provides the learning signal. (a) (b) Figure 4: A comparison between the loss landscapes “seen” by the (a) two-phase and (b) projector-based gradients on the Wisconsin breast cancer task. The red trajectory indicates the weight evolution under projector-based training, while the blue trajectory is for two-phase learning. In both cases, the trajectories are plotted such that the initial state is towards the top, and the final state is towards the bottom. The \Omega -based method replaces the second voltage-mode (clamped) experiment by a single adjoint probe that implements \Omega_{A/R}^{\top} . After the free inference run and the readout of \hat{\bm{y}} , we again form a small error vector \epsilon=\alpha(\hat{\bm{y}}-\bm{y}) , but instead of adding \epsilon as an output voltage source, we apply it in current mode to realize the adjoint action \bm{v}_{\epsilon}=-\Omega_{A/R}^{\top}\epsilon . We then compute \Delta=\epsilon+\bm{v}_{\epsilon}, (25) and combine this with the stored free-phase currents to obtain an edgewise gradient estimate \displaystyle\nabla_{\bm{r}}\mathcal{L}(\hat{\bm{y}},\bm{y}) \displaystyle=\diag(\mathbf{i})(I-\Omega_{A/R}^{T})(v-v_{T}) \displaystyle=\bm{i}_{F}\odot\Delta. (26) Operationally, this scheme uses two physical primitives: a voltage-mode experiment to realize -\Omega_{A/R} (the free map \bm{s}\mapsto\bm{v} ) and a reciprocal current-mode experiment to realize -\Omega_{A/R}^{\top} (a voltage mode realization of -\Omega_{A/R}^{\top} is described in Appendix IV.8 ). The resulting update is still local as it multiplies a measured current on each edge by a locally computed \Delta on that edge, but it avoids a finite- \beta clamping step and does not require measuring a second set of clamped currents. In both cases, once a gradient estimate is available we update resistances by a (possibly constrained) step, \bm{r}\leftarrow\mathrm{clip}\!\left(\bm{r}-\nabla_{\bm{r}}\mathcal{L},\,\bm{r}_{\min},\,\bm{r}_{\max}\right), (27) where clipping is optional and enforces hardware bounds. When resistances are constrained to hardware bounds, the squared-error loss therefore attains a global minimizer; see Appendix IV.10 . Empirically, we find that bounding \bm{r} is often important for stable two-phase training, whereas the \Omega -based updates are typically less sensitive. III Example Tasks: Regression and Classification A passive resistive network implements a linear steady-state map from imposed edge sources to Ohmic drops, \bm{v}=-\Omega_{A/R}\,\bm{s}, (28) where \Omega_{A/R} depends on the tunable resistances R . Choosing which edges are actuated and measured selects an effective input–output block of this operator. With an input selector P_{i}\in\{0,1\}^{E\times s} and output selector P_{o}\in\{0,1\}^{E\times t} , encoding \bm{x}\in\mathbb{R}^{\mathrm{E_{i}}} as \bm{s}=\gamma P_{i}\bm{x} yields the readout \hat{\bm{y}}=f_{R}(\bm{x}):=P_{o}^{\top}\bm{v}=-\gamma\,P_{o}^{\top}\Omega_{A/R}P_{i}\,\bm{x}. (29) Training adjusts R so that f_{R}(\bm{x}) matches a target mapping on a task distribution. Since \Omega_{A/R} is a rank- C projector ( C=E-N+1 ), the realizable block satisfies the basic expressivity bound \mathrm{rank}(P_{o}^{\top}\Omega_{A/R}P_{i})\leq\min\{s,t,C\} (Appendix IV.9 ). III.1 Classification We next use the circuit as a binary classifier with a single readout edge. Given input \bm{x} , the circuit produces an edge-voltage pattern \bm{v}(\bm{x}) and scalar score f(\bm{x}):=\mathbf{e}_{o}^{\top}\bm{v}(\bm{x}), (30) with label y\in\{-1,1\} predicted by \mathrm{sign}(f(\bm{x})) . We train with hinge loss, see implementtion details in Appendix IV.13 , so that only margin-violating examples contribute updates; the corresponding circuit subgradient can be written directly in terms of steady-state currents and \Omega_{A/R} (derivation and implementation details in Appendix IV.13 ). We apply both gradient estimators to the Wisconsin breast cancer dataset after reducing the 30 features to 3 dimensions via PCA. Figure 3 summarizes training: both methods reach \sim 90% accuracy, while the contrastive estimator shows more visible instability in the loss and learned boundary. Figure 4 visualizes the effective landscapes traversed by each method: the two trajectories agree early and then diverge as resistances move away from the initial homogeneous regime. Performance under limited control . To model limited actuation, we freeze each edge resistance independently with probability p_{\text{freeze}} at the start of training, and apply updates only to the remaining edges. For each p_{\text{freeze}} we repeat the experiment over multiple random frozen subsets and report mean accuracy with error bars (Fig. 5 ). Specifically, we generate a masking vector \bm{m} which is a Bernoulli random vector with success probability p . Then, for a given gradient, we instead apply the masked gradient \bm{m}\odot\nabla_{\bm{r}}\mathcal{L}(\hat{\bm{y}},\bm{y}) . Figure 5 shows that, across random frozen subsets, the projector-based estimator exhibits lower variance and more consistent performance improvement as access to edges increases, whereas the two-phase estimator degrades more sharply under partial control. This implies that the control over all resistive states (e.g. updating the resistive value based on the gradient) is not strictly necessary. Figure 5: Accuracy on the Wisconsin dataset under varying degrees of circuit edge access for both gradient estimators. For each estimator and value of p_{\text{freeze}} , error bars and average accuracies are computed over 40 independent trials with randomly frozen edges (e.g. resistive values) for 1000 training steps; networks are always initialized from the everywhere homogeneous initial state. III.2 Noisy Regression with a disordered network topology The discussion we have had so far has focused on a resistive network with a rectangular grid topology. To show that this method also works for random network topologies, we consider nanowire-inspired random resistive networks, which provide a topology that is both more irregular and more scalable. We use the nanowire network construction algorithm introduced in 44 ; 43 and based on the Monte Carlo deposition method of nanowires on a surface and checking for intersections. Specifically, we use the variant algorithm introduced in 3 and described in App. IV.11 . We train on noisy linear regression data \bm{y}=M\bm{x}+\varepsilon, (31) with Gaussian noise \varepsilon and M\in\mathbb{R}^{2\times 2} sampled uniformly entrywise. Under additive zero-mean noise, the analytical (projector) gradient remains unbiased while the two-phase current-squared estimator incurs both an O(\beta) finite-nudge approximation error and a noise-induced statistical bias for any \beta\neq 0 . For proof, as well as a detailed description of the task and setting, see Appendix IV.12 . (a) (b) (c) (d) Figure 6: Training 40 random resistive networks using both \Omega learning and Two Phase Learning. (a) and (c) Training losses for noiseless and noisy training data respectively. (b) and (d) Error (Frobenius norm) between the learned input-output matrix and the true input-output matrix. Figure 6 provides the loss averaged over 40 random nanowire-inspired networks for vanilla two-phase and \Omega -based learning. We consider the regression task described above (both in the absence of and with noise in the training data). While the two methods are comparable in the noiseless regime, the results suggest that \Omega learning provides an improvement in convergence speed and in obtaining a better fit. This matches the theoretical predictions presented in Appendix IV.12 . IV Conclusion In this work, we reframed two-phase learning using linear-response theory, enabling EP- and CL-style updates to be compared to one another. We then specialized to passive linear resistor networks; this viewpoint yields a compact operator description in terms of the response projector \Omega_{A/R} and exposes what two-phase schemes approximate when \beta is finite. We show that the R -weighted cycle-space projector \Omega_{A/R} directly defines an exact gradient for learning in passive networks. Equilibrium propagation and coupled learning appear as approximate implementations of a similar projector-based learning rule. Within this circuit setting we studied two training routes. The contrastive rule is a genuine two-phase method, producing a local difference-of-squares update from free and nudged steady states. The projector-based rule instead realizes the analytical resistance gradient by physically implementing \Omega_{A/R} and \Omega_{A/R}^{\top} with a small number of voltage- and current-mode experiments, avoiding finite- \beta bias and requiring only a single network (no replica). We also showed that learnability is constrained by topology and by the choice of input/output edges: edge selection amounts to tuning a submatrix of \Omega_{A/R} , and poor selections can limit expressivity. Experiments on regression and binary classification indicate that projector-based training is typically more stable than two-phase learning, while achieving comparable performance when the latter succeeds. Finally, our operator/thermodynamic perspective suggests clear extensions to noise, dynamics, and nonlinear devices, and to co-design of graph structure, edge selection, and learning rules. This will be the scope of future analysis. Data availability The software package used to simulate this system can be found on GitHub 1 1 1 https://github.com/jlin1212/differentiable-circuits , along with methods for dataset access and generation. References Appendix IV.1 Physical derivation of Equilibrium Propagation Let y=(y_{1},\dots,y_{n})^{\top}\in\mathbb{R}^{n} denote a set of coarse variables (generalized coordinates) describing a physical system with the inputs clamped. We assume the system is in contact with a thermal bath at (approximately) fixed temperature T ; in this setting the appropriate thermodynamic potential for relaxation is a free energy (rather than the internal energy alone). Accordingly, we postulate the existence of a smooth (non-equilibrium) free-energy function \mathcal{F}_{\theta}(\,\cdot\,;T):\mathbb{R}^{n}\to\mathbb{R}, (32) parametrized by \theta\in\Theta\subset\mathbb{R}^{p} . When it is useful to be explicit about its thermodynamic meaning one may think of \mathcal{F}_{\theta}(y;T)\;=\;E_{\theta}(y)\;-\;T\,S(y), (33) where E_{\theta} is an effective internal energy and S an effective entropy associated with the coarse description. 2 2 2 More generally, depending on which macroscopic constraints are held fixed, F_{\theta} may represent the appropriate thermodynamic potential (e.g., Helmholtz or Gibbs free energy). For the present derivation it suffices that F_{\theta} is a Lyapunov-like potential whose gradient yields the thermodynamic forces. In the low-temperature limit, provided S(y) remains finite (or grows slower than 1/T ), \lim_{T\to 0}\mathcal{F}_{\theta}(y;T)\;=\;E_{\theta}(y), (34) so the formalism reduces to an energy-based description. We define the corresponding thermodynamic forces X_{i} as components of the free-energy gradient: X_{i}(y)\;:=\;\frac{\partial{\mathcal{F}}_{\theta}(y;T)}{\partial y_{i}},\qquad i=1,\dots,n, (35) or, in vector form, X(y)\;:=\;\nabla_{y}{\mathcal{F}}_{\theta}(y;T). (36) The associated fluxes are the rates of change of the coarse variables, J_{i}\;:=\;\dot{y}_{i},\qquad J(y):=\dot{y}. (37) Near equilibrium, generalized forces \{X_{i}\} and conjugate fluxes \{J_{i}\} are related by Onsager linear-response relations, J_{i}\;=\;-\sum_{j}L_{ij}X_{j}, (38) with phenomenological coefficients L_{ij} chosen so that relaxation produces nonnegative entropy production. In compact notation, Eq. ( 38 ) reads J(y)\;=\;-\,L\,X(y), (39) where L\in\mathbb{R}^{n\times n} is the Onsager matrix. The matrix L can be decomposed into symmetric and antisymmetric parts, L\;=\;\Gamma-A,\qquad\Gamma^{\top}=\Gamma\succeq 0,\;\;A^{\top}=-A, (40) where \Gamma encodes dissipative couplings and A encodes reversible couplings. In terms of y(t) , the dynamics reads \dot{y}\;=\;-\,\Gamma\,\nabla_{y}{\mathcal{F}}_{\theta}(y;T)\;+\;A\,\nabla_{y}{\mathcal{F}}_{\theta}(y;T). (41) The time derivative of the free energy along a trajectory t\mapsto y(t) is \displaystyle\frac{d}{dt}{\mathcal{F}}_{\theta}(y(t);T) \displaystyle=\nabla_{y}{\mathcal{F}}_{\theta}(y;T)^{\top}\dot{y} \displaystyle=X(y)^{\top}\big(-\,\Gamma\,X(y)+A\,X(y)\big) \displaystyle=-\,X(y)^{\top}\Gamma X(y), (42) since X^{\top}AX=0 for any antisymmetric A . Because \Gamma is positive semidefinite, \frac{d}{dt}{\mathcal{F}}_{\theta}(y(t);T)\;\leq\;0, (43) with equality only at points where X(y)=0 on the dissipative subspace. Thus \mathcal{F}_{\theta} is a Lyapunov function for ( 41 ), and the dynamics relaxes toward stable critical points of F_{\theta}(\cdot;T) (and, in the limit T\to 0 , of U_{\theta} ) compatible with the constraints encoded by A . In the following, we assume that T is sufficiently small, and that we can approximate \mathcal{F}_{\theta} with the energy E_{\theta} . Otherwise, the formalism follows naturally replacing E_{\theta} with \mathcal{F}_{\theta} . In many situations we may neglect reversible couplings, or treat them separately and retain only the dissipative part. This yields the gradient-flow limit \dot{y}\;=\;-\,\Gamma\,\nabla_{y}E_{\theta}(y),\qquad\Gamma\succ 0, (44) which we adopt as the baseline deterministic dynamics for the derivation of EP. Equilibrium Propagation introduces learning by applying a small static training field that biases the system toward desired outputs. In the thermodynamic language above, this corresponds to modifying the energy by an additional term that depends on a small control parameter \beta>0 (note that \beta below is not 1/k_{B}T but a generic parameter): F(\beta,\theta,y)\;:=\;E_{\theta}(y)+n(\beta,\theta,y), (45) where the nudge n(\beta,\theta,y) satisfies n(0,\theta,y)=0,\qquad n(\beta,\theta,y)=O(\beta)\quad\text{as }\beta\to 0. (46) The corresponding forces are X^{\beta}(y)\;=\;\nabla_{y}F(\beta,\theta,y)\;=\;\nabla_{y}E_{\theta}(y)+\nabla_{y}n(\beta,\theta,y), (47) and the dissipative dynamics becomes \dot{y}\;=\;-\,\Gamma\,\nabla_{y}F(\beta,\theta,y). (48) Equilibrium Propagation is recovered as the special case n(\beta,\theta,y)=\beta\,C(\theta,y), (49) where C(\theta,y) is a cost function that measures the disagreement between system outputs and targets. In that case, the nudging corresponds to a linear coupling between the physical degrees of freedom and the cost. For fixed (\beta,\theta) , the dynamics relaxes to a (locally) stable equilibrium y_{\theta}^{\beta} satisfying \nabla_{y}F(\beta,\theta,y_{\theta}^{\beta})=0. (50) The free phase corresponds to \beta=0 and equilibrium y_{\theta}^{0} determined by the unperturbed energy E_{\theta} . The nudged phase corresponds to a small but nonzero \beta>0 and equilibrium y_{\theta}^{\beta} of the perturbed energy E_{\theta}^{\beta} . The key observation behind EP is that, in the linear-response regime \beta\to 0 , the difference between local observables evaluated at y_{\theta}^{\beta} and y_{\theta}^{0} encodes the gradient of a training objective with respect to \theta . This leads to a two-phase learning rule in which parameter updates are computed from local measurements in the free and nudged phases. To make this precise, it is useful to distinguish between partial derivatives with respect to explicit arguments and total derivatives that also account for the dependence of the equilibrium state on those arguments. Let h(\beta,\theta,y^{\beta}) be any smooth function, where y^{\beta} denotes the (locally) stable equilibrium at a given pair (\beta,\theta) . We define the partial derivative with respect to the explicit argument \beta as \partial_{\beta}h(\beta,\theta,y^{\beta}):=\lim_{\alpha\to 0}\frac{1}{\alpha}\Big(h(\beta+\alpha,\theta,y^{\beta})-h(\beta,\theta,y^{\beta})\Big), (51) i.e., differentiation with respect to \beta while holding y^{\beta} fixed. In contrast, the total derivative of h with respect to \beta is \frac{d}{d\beta}h(\beta,\theta,y^{\beta}):=\lim_{\alpha\to 0}\frac{1}{\alpha}\Big(h(\beta+\alpha,\theta,y^{\beta+\alpha})-h(\beta,\theta,y^{\beta})\Big), (52) which includes both the explicit dependence on \beta and the implicit dependence via the equilibrium y_{\theta}^{\beta} . We use the analogous notation \partial_{\theta} and \dfrac{d}{d\theta} for differentiation with respect to the parameters \theta . Given the nudged energy in ( 45 ), we consider dynamics with the same Onsager operator \Gamma : \dot{y}\;=\;-\,\Gamma\,\nabla_{y}F(\beta,\theta,y). (53) The corresponding energy dissipation is \displaystyle\frac{d}{dt}F(\beta,\theta,y(t)) \displaystyle= \displaystyle\nabla_{y}F(\beta,\theta,y)^{\top}\dot{y} (54) \displaystyle= \displaystyle\big(\nabla_{y}E_{\theta}(y)+\nabla_{y}n(\beta,\theta,y)\big)^{\top}\big(-\,\Gamma\big(\nabla_{y}E_{\theta}(y)+\nabla_{y}n(\beta,\theta,y)\big)\big) \displaystyle= \displaystyle-\,\big\|\Gamma^{1/2}\big(\nabla_{y}E_{\theta}(y)+\nabla_{y}n(\beta,\theta,y)\big)\big\|^{2}\;\leq\;0, using that \Gamma\succeq 0 . Thus, for fixed \beta , the nudged energy E_{\theta}^{\beta} is again nonincreasing along trajectories and plays the role of a Lyapunov function for the nudged dynamics. In this formulation, the training field enters by modifying the energy itself. An alternative would be to keep E_{\theta} unchanged and add \nabla_{y}n(\beta,\theta,y) as an extra nonconservative force on top of \nabla_{y}E_{\theta}(y) . In that case the dynamics would, in general, no longer be of pure gradient-flow form and one would lose the simple monotonicity property in ( 54 ), which is what we will rely on when deriving linear-response identities for Equilibrium Propagation. We now characterize how the equilibrium y_{\theta}^{\beta} changes with the nudging strength \beta . For each fixed (\beta,\theta) , the equilibrium satisfies the stationarity condition \nabla_{y}F(\beta,\theta,y_{\theta}^{\beta})\;=\;\nabla_{y}E_{\theta}(y_{\theta}^{\beta})+\nabla_{y}n(\beta,\theta,y_{\theta}^{\beta})\;=\;0. (55) Let y^{0}:=y_{\theta}^{0} denote the free-phase equilibrium at \beta=0 , so that \nabla_{y}E_{\theta}(y^{0})=0. (56) We assume that y^{0} is a (locally) stable equilibrium and define the Hessian H\;:=\;\nabla_{y}^{2}E_{\theta}(y^{0}). (57) For small \beta , we expand ( 55 ) around (\beta,y)=(0,y^{0}) . Writing y^{\beta}:=y_{\theta}^{\beta} and using \nabla_{y}E_{\theta}(y^{0})=0 gives, to first order in \beta and y^{\beta}-y^{0} , \displaystyle 0 \displaystyle= \displaystyle\nabla_{y}E_{\theta}(y^{\beta})+\nabla_{y}n(\beta,\theta,y^{\beta}) (58) \displaystyle\approx \displaystyle\nabla_{y}E_{\theta}(y^{0})+H\,(y^{\beta}-y^{0})+\nabla_{y}n(\beta,\theta,y^{0}) \displaystyle= \displaystyle H\,(y^{\beta}-y^{0})+\nabla_{y}n(\beta,\theta,y^{0}). Thus y^{\beta}-y^{0}\;=\;-\,H^{-1}\,\nabla_{y}n(\beta,\theta,y^{0})+O(\beta^{2}). (59) Using that n(\beta,\theta,y)=O(\beta) as \beta\to 0 , we expand \nabla_{y}n(\beta,\theta,y^{0})=\beta\,\nabla_{y}\partial_{\beta}n(0,\theta,y^{0})+O(\beta^{2}), (60) which yields y^{\beta}-y^{0}\;=\;-\,\beta\,H^{-1}\,\nabla_{y}\partial_{\beta}n(0,\theta,y^{0})+O(\beta^{2}). (61) Equivalently, the static susceptibility of the equilibrium with respect to the nudging strength is \frac{dy^{\beta}}{d\beta}\Big|_{\beta=0}\;=\;-\,H^{-1}\,\nabla_{y}\partial_{\beta}n(0,\theta,y^{0}). (62) (If H is only semidefinite, H^{-1} may be interpreted as the inverse restricted to the stable subspace, or as the Moore–Penrose pseudoinverse.) Note that ( 62 ) depends only on the energy landscape E_{\theta} and the form of the nudge n(\beta,\theta,y) , but not on the specific choice of the Onsager operator \Gamma in the dynamics: \Gamma affects how the system relaxes to equilibrium, but not the location of the equilibrium itself, when \Gamma\succ 0 . We now derive the equilibrium propagation identity in this physical setting. Define \ell(y)\;:=\;\partial_{\beta}n(0,\theta,y), (63) and take the training objective to be the cost evaluated at the free-phase equilibrium: J(\theta)\;:=\;\ell(y^{0}(\theta)), (64) where y^{0}(\theta) is a (locally) stable equilibrium of E_{\theta} . In standard Equilibrium Propagation with n(\beta,\theta,y)=\beta\,C(\theta,y), (65) we have \ell(y)=C(\theta,y) and therefore J(\theta)=C(\theta,y^{0}) . We first express \nabla_{\theta}J(\theta) in terms of the response of the free equilibrium y^{0} to a change in \theta . Differentiating the free equilibrium condition \nabla_{y}E_{\theta}(y^{0})=0 (66) with respect to \theta and using the implicit function theorem gives \frac{\partial y^{0}}{\partial\theta}\;=\;-\,H^{-1}\,\nabla_{y}\partial_{\theta}E_{\theta}(y^{0}),\qquad H\;:=\;\nabla_{y}^{2}E_{\theta}(y^{0}), (67) provided H is invertible on the stable subspace. Using J(\theta)=\ell(y^{0}(\theta)) and the chain rule, we obtain \displaystyle\nabla_{\theta}J(\theta) \displaystyle= \displaystyle\left(\nabla_{y}\ell(y^{0})\right)^{\top}\frac{\partial y^{0}}{\partial\theta} (68) \displaystyle= \displaystyle\left(\nabla_{y}\ell(y^{0})\right)^{\top}\Big(-\,H^{-1}\,\nabla_{y}\partial_{\theta}E_{\theta}(y^{0})\Big). On the other hand, we can relate \nabla_{\theta}J(\theta) to the difference of energy derivatives between the nudged and free equilibria. Consider the quantity \partial_{\theta}F(\beta,\theta,y^{\beta})-\partial_{\theta}E_{\theta}^{0}(y^{0}), (69) where E_{\theta}^{\beta}=E_{\theta}+n(\beta,\theta,\cdot) and y^{\beta} is the nudged equilibrium. We decompose it as \displaystyle\partial_{\theta}F(\beta,\theta,y^{\beta})-\partial_{\theta}E_{\theta}^{0}(y^{0}) \displaystyle= \displaystyle\big(\partial_{\theta}F(\beta,\theta,y^{\beta})-\partial_{\theta}E_{\theta}^{0}(y^{\beta})\big)+\big(\partial_{\theta}E_{\theta}^{0}(y^{\beta})-\partial_{\theta}E_{\theta}^{0}(y^{0})\big). (70) The first bracket is just the explicit \theta –dependence introduced by the nudge: \partial_{\theta}F(\beta,\theta,y^{\beta})-\partial_{\theta}E_{\theta}^{0}(y^{\beta})\;=\;\partial_{\theta}n(\beta,\theta,y^{\beta}). (71) If n has no explicit \theta –dependence (for example n(\beta,\theta,y)=\beta\,\ell(y) ), this term vanishes. When \partial_{\theta}n\neq 0 but is O(\beta) , it contributes an O(\beta) correction to the EP identity that can be handled separately. For clarity, we focus on the common case where n depends on \theta only through y and hence \partial_{\theta}n(\beta,\theta,y^{\beta})=0. (72) We then expand the second term to first order in y^{\beta}-y^{0} : \displaystyle\partial_{\theta}E_{\theta}^{0}(y^{\beta})-\partial_{\theta}E_{\theta}^{0}(y^{0}) \displaystyle\approx \displaystyle\nabla_{y}\partial_{\theta}E_{\theta}(y^{0})^{\top}(y^{\beta}-y^{0})+O(\|y^{\beta}-y^{0}\|). (73) Using the linear response of the equilibrium state with respect to \beta in ( 61 ), and the definition \ell(y)=\partial_{\beta}n(0,\theta,y) , we have y^{\beta}-y^{0}\;=\;-\,\beta\,H^{-1}\,\nabla_{y}\ell(y^{0})+O(\beta^{2}). (74) Hence \displaystyle\partial_{\theta}F(\beta,\theta,y^{\beta})-\partial_{\theta}E_{\theta}^{0}(y^{0}) \displaystyle\approx \displaystyle\nabla_{y}\partial_{\theta}E_{\theta}(y^{0})^{\top}\big(-\,\beta\,H^{-1}\,\nabla_{y}\ell(y^{0})\big)+O(\beta^{2}) (75) \displaystyle= \displaystyle-\,\beta\,\nabla_{y}\partial_{\theta}E_{\theta}(y^{0})^{\top}H^{-1}\,\nabla_{y}\ell(y^{0})+O(\beta^{2}). Dividing by \beta and taking the limit \beta\to 0 yields \lim_{\beta\to 0}\frac{1}{\beta}\Big(\partial_{\theta}F(\beta,\theta,y^{\beta})-\partial_{\theta}E_{\theta}^{0}(y^{0})\Big)\;=\;-\,\nabla_{y}\partial_{\theta}E_{\theta}(y^{0})^{\top}H^{-1}\,\nabla_{y}\ell(y^{0}). (76) Comparing with ( 68 ) shows that \nabla_{\theta}J(\theta)\;=\;\lim_{\beta\to 0}\frac{1}{\beta}\Big[\partial_{\theta}F(\beta,\theta,y^{\beta})-\partial_{\theta}E_{\theta}^{0}(y^{0})\Big], (77) which is the equilibrium propagation (EP) identity 31 . It expresses the gradient of the training objective with respect to parameters as the linear-response limit of a difference of energy derivatives evaluated at the nudged and free equilibria. In practice, simulations of energy-based models often approximate the continuous-time dynamics \dot{y}=-\,\Gamma\,\nabla_{y}F(\beta,\theta,y) (78) by explicit Euler updates with step size \eta>0 . In this case, the discrete free and nudged phases are described by Free: \displaystyle y^{0}_{k+1}\;=\;y^{0}_{k}-\eta\,\Gamma\,\nabla_{y}E_{\theta}(y^{0}_{k}), (79) Nudged: \displaystyle y^{\beta}_{k+1}\;=\;y^{\beta}_{k}-\eta\,\Gamma\Big(\nabla_{y}E_{\theta}(y^{\beta}_{k})+\nabla_{y}n(\beta,\theta,y^{\beta}_{k})\Big). (80) Under standard smoothness and stability assumptions on E_{\theta} and a sufficiently small step size \eta , these iterations converge to the continuous equilibria y^{0} and y^{\beta} respectively, and the EP identity ( 77 ) can be approximated from finite differences measured between the two phases. IV.2 Generalized Equilibrium Propagation In this section, let y=(y_{1},\dots,y_{n})^{\top}\in\mathbb{R}^{n} denote a set of coarse variables (generalized coordinates) describing an input-clamped physical system. Here we wish to show in which sense Equilibrium Propagation (EP) and Coupled Learning (CL) are both two-phase schemes, one compares a free steady state to a nearby, weakly biased (nudged) steady state and extracts a parameter update from their difference. The key difference is the order of the perturbation with respect to the nudging strength. To treat both cases within a single perturbative framework, we introduce Generalized Equilibrium Propagation . We define a \beta -dependent (nudged) free energy F(\beta,\theta,y;\bm{z}):={\mathcal{F}}_{\theta}(y;\bm{z})+n(\beta,\theta,y;\bm{z}),\qquad\beta>0. (81) such that n(0,\theta,y;\bm{z})=0 for all \theta,y ). In this section, we will generally omit the dependence on the clamped input \bm{z} for brevity. We will also consider the low temperature limit, e.g. |TS|\ll|E| , but everything follows below by replacing E_{\theta} with \mathcal{F}_{\theta} in the finite temperature case. Let y^{0}(\theta) denote a (free) equilibrium of E_{\theta} , i.e. \nabla_{y}E_{\theta}(y^{0})=0 , and let y^{\beta}(\theta) denote a (nudged) equilibrium of F(\beta,\theta,\cdot) , i.e. \nabla_{y}F(\beta,\theta,y^{\beta})=0 for each \beta . We assume that n(\beta,\theta,y^{0})=O(\beta^{k}) for some constant k\geq 1 . Note that as long as y^{\beta} is a differentiable function of \beta , then \|y^{\beta}-y^{0}\|=O(\beta^{k}) . To see this, note that Equation ( 81 ) implies that \displaystyle\nabla_{\mathbf{y}}F(\beta,\theta,y^{\beta}) \displaystyle=\nabla_{\mathbf{y}}E_{\theta}(y^{\beta})\ +\nabla_{\mathbf{y}}n(\beta,\theta,y^{\beta}). (82) Assume that the Hessian H_{\theta}:=\nabla_{y}^{2}E_{\theta}(y^{0}) is invertible (nondegenerate equilibrium). Since y^{\beta} is a differentiable function of \beta , \displaystyle\nabla_{\mathbf{y}}F(\beta,\theta,y^{\beta}) \displaystyle=\nabla_{\mathbf{y}}E_{\theta}(y^{0})+\nabla_{\mathbf{y}}^{2}E_{\theta}(y^{0})(\mathbf{y}^{\beta}-\mathbf{y}^{0})+O(\|\mathbf{y}^{\beta}-\mathbf{y}^{0}\|^{2})+\nabla_{\mathbf{y}}n(\beta,\theta,y^{0})+\nabla_{\mathbf{y}}^{2}n(\beta,\theta,y^{0})(\mathbf{y}^{\beta}-\mathbf{y}^{0})+O(\|\mathbf{y}^{\beta}-\mathbf{y}^{0}\|^{2}) (83) By definition, \nabla_{\mathbf{y}}E_{\theta}(y^{0})=0 and \nabla_{\mathbf{y}}F(\beta,\theta,y^{\beta})=0 . Also, since n(\beta,\theta,y^{0})=O(\beta^{k}) , \nabla_{\mathbf{y}}n(\beta,\theta,y^{0})=O(\beta^{k}) . Thus \displaystyle 0 \displaystyle=\left(H_{\theta}+\nabla_{\mathbf{y}}^{2}n(\beta,\theta,y^{0})\right)(\mathbf{y}^{\beta}-\mathbf{y}^{0})+O(\beta^{k})+O(\|\mathbf{y}^{\beta}-\mathbf{y}^{0}\|^{2}) (84) Note that H_{\theta} is invertible and \nabla_{\mathbf{y}}^{2}n(\beta,\theta,y^{0}) is a differentiable function of \beta . Thus, for sufficiently small \beta , H_{\theta}+\nabla_{\mathbf{y}}^{2}n(\beta,\theta,y^{0}) is invertible and (H_{\theta}+\nabla_{\mathbf{y}}^{2}n(\beta,\theta,y^{0}))^{-1}=O(1) . Left-multiplying both sides by (H_{\theta}+\nabla_{\mathbf{y}}^{2}n(\beta,\theta,y^{0}))^{-1} gives us \displaystyle 0 \displaystyle=\mathbf{y}^{\beta}-\mathbf{y}^{0}+O(\|\mathbf{y}^{\beta}-\mathbf{y}^{0}\|^{2})+O(\beta^{k}). (85) For small \beta , the O(\|\mathbf{y}^{\beta}-\mathbf{y}^{0}\|^{2}) term is negligible compared to the other terms, so we conclude that \|y^{\beta}-y^{0}\|=O(\beta^{k}) . For small \beta , we then have the Taylor expansion \displaystyle n(\beta,\theta,y^{0}) \displaystyle=n(0,\theta,y^{0})+\sum_{j=1}^{\infty}{\beta^{j}\over j!}{\partial^{j}n\over\partial\beta^{j}}(0,\theta,y^{0}) \displaystyle={\beta^{k}\over k!}{\partial^{k}n\over\partial\beta^{k}}(0,\theta,y^{0})+O(\beta^{k+1}) \displaystyle=\beta^{k}h(\theta,y^{0})+O(\beta^{k+1}) (86) where here we define \displaystyle h(\theta,y):={1\over k!}{\partial^{k}n\over\partial\beta^{k}}(0,\theta,y). (87) We also assume that F(\beta,\theta,y^{\beta})-F(\beta,\theta,y)=O(\|\mathbf{y}^{\beta}-\mathbf{y}\|^{m}) for some constant m>1 . Then \displaystyle F(\beta,\theta,y^{\beta})-F(\beta,\theta,y^{0}) \displaystyle=O(\|\mathbf{y}^{\beta}-\mathbf{y}^{0}\|^{m}) \displaystyle=O(\beta^{mk}), (88) where the last line follows from the fact that \|y^{\beta}-y^{0}\|=O(\beta^{k}) . Next, note that by the chain rule, \displaystyle{dF\over d\theta}(\beta,\theta,y^{\beta})-{dF\over d\theta}(0,\theta,y^{0}) \displaystyle={\partial F\over\partial\theta}(\beta,\theta,y^{\beta})+{\partial F\over\partial y}(\beta,\theta,y^{\beta})\cdot{\partial y^{\beta}\over\partial\theta}(\theta)-\left({\partial F\over\partial\theta}(0,\theta,y^{0})+{\partial F\over\partial y}(0,\theta,y^{0})\cdot{\partial y^{0}\over\partial\theta}(\theta)\right) \displaystyle={\partial F\over\partial\theta}(\beta,\theta,y^{\beta})-{\partial F\over\partial\theta}(0,\theta,y^{0}) (89) Then \displaystyle{\partial F\over\partial\theta}(\beta,\theta,y^{\beta})-{\partial F\over\partial\theta}(0,\theta,y^{0}) \displaystyle={dF\over d\theta}(\beta,\theta,y^{\beta})-{dF\over d\theta}(0,\theta,y^{0}) \displaystyle={d\over d\theta}\left(F(\beta,\theta,y^{\beta})-F(\beta,\theta,y^{0})+F(\beta,\theta,y^{0})-F(0,\theta,y^{0})\right) \displaystyle={d\over d\theta}\left(O(\beta^{mk})+n(\beta,\theta,y^{0})\right) \displaystyle={d\over d\theta}\left(\beta^{k}h(\theta,y^{0})+O(\beta^{k+1})+O(\beta^{mk})\right). (90) Since k\geq 1 and m>1 , we have k0 . We stack edgewise quantities into vectors: sources \bm{s}\in\mathbb{R}^{\mathrm{E}} , currents \bm{i}\in\mathbb{R}^{\mathrm{E}} , and Ohmic drops \bm{v}:=R\bm{i}\in\mathbb{R}^{\mathrm{E}} , where R=\diag(r_{e})\succ 0. (98) Let A\in\mathbb{R}^{C\times\mathrm{E}} be a cycle (loop) matrix spanning the C=\mathrm{E}-N+1 fundamental cycles of the graph. The cycle constraints encode Kirchhoff’s Voltage Law (KVL): the signed sum of voltage drops around each fundamental cycle must be zero. With an edge source \bm{s} and Ohmic drops R\bm{i} , this gives A(\bm{s}+\bm{v})=\bf 0. (99) The total power dissipated in the resistors, \bm{v}^{\top}R^{-1}\bm{v} is minimized subject to the above constraint. We can solve this constrained optimization problem using the method of Lagrange multipliers. Define the Lagrangian: L(\bm{v},\mathbf{\lambda};\bm{s})=\bm{v}^{\top}R^{-1}\bm{v}+\mathbf{\lambda}^{\top}A(\bm{s}+\bm{v}) (100) where \mathbf{\lambda}\in\mathbb{R}^{C} is the vector of Lagrange multipliers and A is the cycle matrix. Now we have \nabla_{\bm{v}}L(\bm{v}^{*},\lambda^{*};\bm{s})=2R^{-1}\bm{v}^{*}+A^{\top}\lambda^{*}=0 (101) Thus \bm{v}^{*}=-{1\over 2}RA^{\top}\lambda^{*} . Similarly, \nabla_{\lambda}L(\bm{v}^{*},\lambda^{*};\bm{s})=A(\bm{s}+\bm{v}^{*})=0, (102) so \displaystyle A(\bm{s}-{1\over 2}RA^{\top}\lambda^{*}) \displaystyle=0 (103) and thus \lambda^{*}=2(ARA^{\top})^{-1}A\bm{s} . Substituting this back into our expression for \bm{v}^{*} gives us \bm{v}^{*}=-RA^{\top}(ARA^{\top})^{-1}A\bm{s} . This motivates defining the cycle projector \Omega_{A/R}:=RA^{\top}(ARA^{\top})^{-1}A, (104) so that the circuit implements the linear map \bm{v}=-\Omega_{A/R}\,\bm{s},\qquad\text{and}\qquad\bm{i}=-R^{-1}\Omega_{A/R}\,\bm{s}. (105) A key structural fact is that \Omega_{A/R} is an oblique projector : \Omega_{A/R}^{2}=\Omega_{A/R}. (106) Intuitively, \Omega_{A/R} extracts the component of an imposed edge-source pattern that is compatible with the graph’s cycle constraints and converts it into the steady-state distribution of Ohmic drops. Equivalently, each column of -\Omega_{A/R} is the network response (Ohmic drops on all edges) to a unit source applied on a single edge. Equations ( 105 ) provide the bridge between the physical two-phase picture and the projector-based schemes used later: voltage-mode experiments implement \bm{s}\mapsto\bm{v} (left multiplication by -\Omega_{A/R} ), while reciprocal/current-mode manipulations can be used to access the adjoint \Omega_{A/R}^{\top} in the projector-based gradient estimator developed in the next subsections. This operator viewpoint is useful for two reasons. First, it makes inference explicit: a voltage-mode experiment that imposes \bm{s} and measures \bm{v} is exactly a multiplication by -\Omega_{A/R} . Second, it clarifies what must be implemented physically for learning: our contrastive (two-phase) rule estimates gradients from differences between two such voltage-mode experiments, while our projector-based estimator additionally requires access to the adjoint action \Omega_{A/R}^{\top} via reciprocal/current-mode manipulations. A local minima of Equation ( 26 ) satisfies \displaystyle((\mathbf{v}-\mathbf{v}_{T})^{\top}(I-\Omega_{A/R})\,\text{diag}(\mathbf{i}))^{\top} \displaystyle=\bf 0 \displaystyle\text{diag}(\mathbf{i})(I-\Omega_{A/R}^{\top})(\mathbf{v}-\mathbf{v}_{T}) \displaystyle=\bf 0. (107) Assuming currents are nonzero on all edges (and thus \text{diag}(\mathbf{i}) is full rank), this means that \displaystyle(I-\Omega_{A/R}^{\top})(\mathbf{v}-\mathbf{v}_{T}) \displaystyle=\bf 0 \displaystyle\mathbf{v}-\mathbf{v}_{T} \displaystyle=\Omega_{A/R}^{\top}(\mathbf{v}-\mathbf{v}_{T}) so (\mathbf{v}-\mathbf{v}_{T}) is an eigenvector of \Omega_{A/R}^{\top} . IV.5 Bounds We record here a simple norm bound on the input–output map implemented by the circuit projector. For an input pattern applied on the designated input edges, the resulting output voltages satisfy \displaystyle\lVert\bm{v}^{\text{(output)}}\rVert \displaystyle\leq\lVert\Omega_{A/R}\rVert\lVert\bm{s}^{\text{(input)}}\rVert \displaystyle\leq\lVert R^{1\over 2}\rVert_{2}\lVert\Omega_{M}\rVert_{2}\lVert R^{-{1\over 2}}\rVert_{2}\lVert\bm{s}^{\text{(input)}}\rVert_{2} \displaystyle\leq\lVert\bm{s}^{\text{(input)}}\rVert_{2}\sqrt{R_{max}\over R_{min}} (108) where R_{\max} and R_{\min} denote the largest and smallest diagonal entries of R , respectively, and \Omega_{M}=R^{-{1\over 2}}\Omega_{A/R}R^{{1\over 2}} is a (symmetric) orthogonal projector operator. IV.6 Two-Phase Gradient in Electrical Systems Here we show that the standard two-phase current-squared contrastive update converges, in the \beta\to 0 limit to the gradient of a distinct objective function. Let i(\mathbf{s}) denote the steady-state edge current vector for clamped source voltages \mathbf{s} . For the linear resistor networks considered here, \displaystyle i(\mathbf{s})=M\mathbf{s},\qquad M:=-A^{\top}(ARA^{\top})^{-1}A. (109) Let \bm{i}_{F}=i(\mathbf{s}) and \bm{i}_{C}=i(\mathbf{s}+\delta) denote the free and clamped currents, for a nudge \displaystyle\delta=\beta P_{o}^{\top}(\hat{\bm{y}}-\bm{y}), (110) where P_{o} selects the output voltages, \mathbf{v} is the network output, and \mathbf{y} is the target. \displaystyle\lim_{\beta\to 0}\frac{1}{2\beta}\Big[\bm{i}_{C}^{\odot 2}-\bm{i}_{F}^{\odot 2}\Big] \displaystyle=\lim_{\beta\to 0}\frac{1}{2\beta}\left[(M\bm{s}_{C})^{\odot 2}-(M\bm{s}_{F})^{\odot 2}\right] \displaystyle=\lim_{\beta\to 0}\frac{1}{2\beta}\left[(M\bm{s}_{F}+\beta MP_{o}^{\top}(\hat{\bm{y}}-\bm{y}))^{\odot 2}-(M\bm{s}_{F})^{\odot 2}\right] \displaystyle=\lim_{\beta\to 0}\frac{1}{2\beta}\left[(M\bm{s}_{F})^{\odot 2}+2\beta(M\bm{s}_{F})\odot(MP_{o}^{\top}(\hat{\bm{y}}-\bm{y}))+\beta^{2}(MP_{o}^{\top}(\hat{\bm{y}}-\bm{y}))^{\odot 2}-(M\bm{s}_{F})^{\odot 2}\right] \displaystyle=\lim_{\beta\to 0}\left[\bm{i}_{F}\odot(MP_{o}^{\top}(\hat{\bm{y}}-\bm{y}))+\beta(MP_{o}^{\top}(\hat{\bm{y}}-\bm{y}))^{\odot 2}\right] \displaystyle=\diag(\bm{i}_{F})MP_{o}^{\top}(\hat{\bm{y}}-\bm{y}). (111) Thus, the standard two-phase contrastive update converges to the gradient in the \beta\to 0 limit. IV.7 Energy Functions for Circuits In the system that we are discussing, the system parameters are the resistances R , the clamped inputs are the source voltages \bm{s} , and the state is the resistor voltages \bm{v} . In the notation of Equation ( 81 ), \displaystyle\theta \displaystyle=\{R\} \displaystyle\bm{z} \displaystyle=\bm{s} \displaystyle\bm{y} \displaystyle=\bm{v} The Lagrangian formulation discussion in the previous section then provides a natural energy function in terms of \mathbf{v} , \bf s , and R . \displaystyle E_{R}(\bm{v};\bm{s}) \displaystyle=L(\bm{v},\mathbf{\lambda}^{*};\bm{s}) \displaystyle=\bm{v}^{\top}R^{-1}\bm{v}+\mathbf{\lambda}^{*\top}A(\bm{s}+\bm{v}) \displaystyle=\bm{v}^{\top}R^{-1}\bm{v}+2\bm{s}^{\top}A^{\top}(ARA^{\top})^{-1}A(\bm{s}+\bm{v}) \displaystyle=\bm{v}^{\top}R^{-1}\bm{v}-2\bm{s}^{\top}M(\bm{s}+\bm{v}) (112) Note that for a fixed input \bf s , \displaystyle\arg\min_{\mathbf{v}}E(\mathbf{s},\mathbf{v}) \displaystyle=\arg\min_{\mathbf{v}}\mathcal{L}(\mathbf{v},\mathbf{\lambda}^{*};\mathbf{s}) \displaystyle=-\Omega_{A/R}\mathbf{s}, (113) giving us an energy function in terms of the projector operator and input bias. IV.8 Circuits as tunable mappings Each element of \mathbf{s} corresponds exactly to a single voltage source on an edge of the circuit graph. We now activate i of these voltage sources, and measure the resulting voltages across the resistors on o other edges in the network. Having selected our “forcing" (input) and “measurement" (output) edges, it is always possible to reorder the edges in such a way that we may consider the following three groups of edges for some \mathbf{s}\in\mathbb{R}^{\mathrm{E}} , \mathbf{s}=\begin{bmatrix}\bm{s}^{\text{(input)}}\\ \bm{s}^{\text{(output)}}\\ \bm{s}^{\text{(hidden)}}\end{bmatrix}, (114) where now by definition \bm{s}^{\text{(input)}}\in\mathbb{R}^{\mathrm{E_{i}}},\bm{s}^{\text{(output)}}\in\mathbb{R}^{\mathrm{E_{o}}},\bm{s}^{\text{(hidden)}}\in\mathbb{R}^{\mathrm{E}-\mathrm{E_{i}}-\mathrm{E_{o}}} . This enforces the same ordering/grouping for some \mathbf{v} : \mathbf{v}=\begin{bmatrix}\bm{v}^{\text{(input)}}\\ \bm{v}^{\text{(output)}}\\ \bm{v}^{\text{(hidden)}}\end{bmatrix}. (115) In this ordering, it is the case that when we apply nonzero bias on the inputs \bm{s}_{F}=\left[\begin{array}[]{c}\bm{s}^{\text{(input)}}\\ \hline\cr\mathbf{0}^{(M-E_{i})\times 1}\end{array}\right]. (116) We call this biasing pattern \bm{s}_{F} to indicate that it allows the system dynamics to freely determine the voltages at the “output" edges. Applying this bias to the network creates the following set of voltages across the edge resistors: \mathbf{v}_{F}=-\Omega_{A/R}\bm{s}_{F}. (117) By measuring \bm{v}^{\text{(output)}}_{F} , one can effectively compute a mapping f_{R}(\bm{s}^{\text{(input)}}_{F})=\bm{v}^{\text{(output)}}_{F} . Here, we write f_{R}(\cdot) to emphasize the fact that the action of -\Omega_{A/R} is determined in part by tunable parameters, R : the set of on-edge resistances in the network. We thus have that the resistor network performs a voltage-mode inference. We would now like to tune R such that we achieve a given mapping between \bm{s}^{\text{(input)}}_{F} and \bm{v}^{\text{(output)}}_{F} . One approach would be to implement a two-phase learning method. Suppose we want the circuit, with resistances R , to realize a mapping f_{R}(\bm{x})\approx\bm{y}, (118) where \bm{x} is encoded as an input bias pattern and \bm{y} denotes the target readout on the output edges. Two-phase learning introduces a second steady-state experiment in which the outputs are weakly constrained toward their targets. Concretely, during the clamped (or nudged ) phase we add small source perturbations on the output edges whose signs and magnitudes are proportional to the output error. Intuitively, if an output edge voltage is too large, we apply a small opposing bias to pull it down; if it is too small, we apply a small reinforcing bias to push it up. This produces a nearby equilibrium that is slightly closer to the target, and the difference between the free and clamped equilibria provides a local signal for updating the resistances. Given a desired set of output edge voltages \mathbf{y} , we thus have two biasing patterns: \bm{s}_{F}=\left[\begin{array}[]{c}\mathbf{x}\\ \hline\cr\mathbf{0}^{(M-s)\times 1}\end{array}\right]\qquad\bm{s}_{C}=\left[\begin{array}[]{c}\mathbf{x}\\ \hline\cr\beta(\bm{v}^{\text{(output)}}_{F}-\mathbf{y})\\ \hline\cr\mathbf{0}^{(M-E_{i}-E_{o})\times 1}\end{array}\right]. (119) We have now replaced \bm{s}^{\text{(input)}} with \mathbf{x} and introduced the parameter \beta , which is a tunable scaling term controlling the magnitude of the error term. Its role is loosely analogous to the learning rate in standard gradient descent. Notice that \bm{s}_{F} and \bm{s}_{C} differ only on the biases at the output edges. This viewpoint lets us “read out” a proposed physical training scheme by translating each experimental primitive into an operator action. In particular, voltage-mode biasing implements \mathbf{s}\mapsto\mathbf{v} , i.e., left-multiplication by \Omega_{A/R} , whereas many learning rules require the adjoint action \Omega_{A/R}^{\top} when propagating error signals or forming analytical gradients. Operationally, -\Omega_{A/R}^{\top} corresponds to the reciprocal mapping accessed by current-mode manipulations: by driving the network with an appropriate edge-current pattern and measuring voltages, one realizes the transpose operator needed by the projector-based estimator. Alternatively, -\Omega_{A/R}^{\top} can be realized by fully voltage mode computations using the identity \Omega_{A/R}^{\top}=R^{-1}\Omega_{A/R}R . For any vector \mathbf{u}\in\mathbb{R}^{\mathrm{E}} , we can set the source voltages to be \bm{s}=\bm{r}\odot\mathbf{u} , then measure the voltages \bm{v}=-\Omega_{A/R}\bm{s} . We then perform a Hadamard multiplication by \bm{r}^{-1} , the element-wise reciprocal of \bm{r} , obtaining -\Omega_{A/R}^{\top}\mathbf{u}=\bm{r}^{-1}\odot\bm{v} . Each Hadamard multiplication can be done completely locally, adhering to physical constraints. However, we note that the division required for the Hadamard multiplication by \bm{r}^{-1} would likely be expensive to perform on hardware, and that the explicit Hadamard products involving \bm{r} and \bm{r}^{-1} would likely be less robust to both noise and nonidealities (than the alternative current-mode computation) when implemented in practice. Finally, because \Omega_{A/R} is an idempotent (oblique) projector, \Omega_{A/R}^{2}=\Omega_{A/R} , compositions of biasing/measurement steps simplify algebraically. This makes it possible to analyze complex multi-step physical protocols as products of \Omega_{A/R} and \Omega_{A/R}^{\top} , providing a direct bridge between circuit experiments and the learning rules developed in the main text. IV.9 Input–Output Transformations A passive resistive network implements a linear map from edge sources to Ohmic drops, \mathbf{v}=-\,\Omega_{A/R}\,\mathbf{s},\qquad\Omega_{A/R}:=RA^{\top}(ARA^{\top})^{-1}A, (120) where A\in\mathbb{R}^{C\times\mathrm{E}} is a cycle matrix and C:=\mathrm{rank}(A)=E-N+1 is the cycle-space dimension. Selecting \mathrm{E_{i}} input edges and \mathrm{E_{o}} readout edges via column selectors P_{i}\in\{0,1\}^{\mathrm{E_{i}}\times\mathrm{E}} and P_{o}\in\{0,1\}^{\mathrm{E_{o}}\times\mathrm{E}} , we encode inputs \mathbf{x}\in\mathbb{R}^{\mathrm{E_{i}}} as \mathbf{s}=\gamma P_{i}^{\top}\mathbf{x} and read \hat{\mathbf{y}}:=P_{o}\bm{v}=-\gamma\,P_{o}\Omega_{A/R}P_{i}^{\top}\,\mathbf{x}\;=:\;W_{R}\,\mathbf{x}. (121) Proposition IV.1 (Rank bounds and cycle-space bottleneck) . The induced input–output map W_{R}=-\gamma\,P_{o}\Omega_{A/R}P_{i}^{\top} satisfies \mathrm{rank}(W_{R})\leq\min\{\mathrm{E_{i}},\mathrm{E_{o}},C\}. (122) Moreover, \mathrm{rank}(W_{R})\leq\min\Big\{\mathrm{rank}(AP_{i}^{\top}),\,\mathrm{rank}(AP_{o})\Big\}. (123) Proof. The scalar factor -\gamma does not affect rank. For the first bound, \mathrm{rank}(W_{R})=\mathrm{rank}(P_{o}\Omega_{A/R}P_{i}^{\top})\leq\min\{\mathrm{rank}(P_{o}),\mathrm{rank}(\Omega_{A/R}),\mathrm{rank}(P_{i}^{\top})\}. (124) Since \mathrm{rank}(P_{o})=\mathrm{E_{o}} , \mathrm{rank}(P_{i})=\mathrm{E_{i}} , and \Omega_{A/R}=RA^{\top}(ARA^{\top})^{-1}A\quad\Rightarrow\quad\mathrm{rank}(\Omega_{A/R})=\mathrm{rank}(A)=C (125) (because R is invertible and (ARA^{\top}) is invertible on \mathrm{im}(A) ), we obtain \mathrm{rank}(W_{R})\leq\min\{\mathrm{E_{i}},\mathrm{E_{o}},C\} . For the second bound, use the factorization W_{R}=-\gamma\,(P_{o}RA^{\top})\,(ARA^{\top})^{-1}\,(AP_{i}^{\top}). (126) Hence \mathrm{rank}(W_{R})\leq\mathrm{rank}(AP_{i}). (127) Similarly, by transposing and using \mathrm{rank}(M)=\mathrm{rank}(M^{\top}) , \mathrm{rank}(W_{R})=\mathrm{rank}(W_{R}^{\top})\leq\mathrm{rank}\big((AP_{o})^{\top}\big)=\mathrm{rank}(AP_{o}). (128) Combining yields ( 123 ). ∎ Proposition IV.2 (A sufficient condition for saturating the input-cycle rank) . Fix a fundamental cycle basis so that (after reordering edges) the cycle matrix has the form A=\begin{bmatrix}I_{C}\;\;A^{\prime}\end{bmatrix}, (129) where I_{C} is the C\times C identity block corresponding to one designated edge per fundamental cycle. If the chosen input edges include q distinct edges from this identity block, then \mathrm{rank}(AP_{i})\;\geq\;q, (130) and in particular if q=\min\{C,s\} (i.e. the s input edges lie on s distinct fundamental cycles, up to the cycle-space limit), then \mathrm{rank}(AP_{i})=\min\{C,s\}. (131) An analogous statement holds for AP_{o} . Proof. Let the q selected input edges that belong to the identity block correspond to column indices j_{1},\dots,j_{q} within the first C columns. Then the corresponding columns of A are exactly the standard basis vectors e_{j_{1}},\dots,e_{j_{q}}\in\mathbb{R}^{C} , which are linearly independent. Since AP_{i} contains these columns, \mathrm{rank}(AP_{i})\geq q . Also, \mathrm{rank}(AP_{i})\leq\min\{\mathrm{rank}(A),\mathrm{rank}(P_{i})\}=\min\{C,s\} . If q=\min\{C,s\} , the lower and upper bounds coincide, giving \mathrm{rank}(AP_{i})=\min\{C,s\} . The output case is identical with P_{o} . ∎ IV.10 Existence of a Minimum Theorem IV.3 (Existence of a global minimizer) . Let \Theta be compact and let f:\Theta\to\mathbb{R}^{\mathrm{E_{o}}} be continuous. For a fixed target \mathbf{y}_{T}\in\mathbb{R}^{\mathrm{E_{o}}} , define \mathcal{L}(\theta):=\frac{1}{2}\|f(\theta)-\mathbf{y}_{T}\|^{2}. (132) Then \mathcal{L} attains a global minimum on \Theta . Moreover, \min_{\theta\in\Theta}\mathcal{L}(\theta)=\frac{1}{2}\min_{\mathbf{y}\in f(\Theta)}\|\mathbf{y}-\mathbf{y}_{T}\|^{2}, (133) and \min_{\theta\in\Theta}\mathcal{L}(\theta)=0 iff \mathbf{y}_{T}\in f(\Theta) . Proof. Since f is continuous and \mathbf{y}\mapsto\frac{1}{2}\|\mathbf{y}-\mathbf{y}_{T}\|^{2} is continuous, their composition \mathcal{L} is continuous on \Theta . By compactness of \Theta , the extreme value theorem implies \mathcal{L} attains a minimum. The identity \min_{\theta\in\Theta}\mathcal{L}(\theta)=\frac{1}{2}\min_{\mathbf{y}\in f(\Theta)}\|\mathbf{y}-\mathbf{y}_{T}\|^{2} (134) holds because the set of achievable outputs is exactly f(\Theta) . Finally, \mathcal{L}(\theta)=0 iff f(\theta)=\mathbf{y}_{T} , which is possible iff \mathbf{y}_{T}\in f(\Theta) . ∎ IV.11 Random nanowire deposition model To generate a more realistic connectivity graph than an abstract random-graph ensemble, we model a random deposition of nanowires on a planar substrate and then convert geometric overlaps into edges of an equivalent graph. This is similar to the approaches taken in 42 and 2 . We deposit n nanowires on a 2D surface sequentially and at random as follows. Each nanowire N_{i} is represented as a straight line segment of fixed length l , with a randomly chosen in-plane orientation \theta_{i}\sim\mathrm{Unif}(0,2\pi) and a randomly chosen center position. The segment is fully specified by its endpoints \bigl(x_{i}^{(1)},y_{i}^{(1)}\bigr) and \bigl(x_{i}^{(2)},y_{i}^{(2)}\bigr) , or equivalently by the direction vector \mathbf{d}_{i}=\bigl(x_{i}^{(2)}-x_{i}^{(1)},\,y_{i}^{(2)}-y_{i}^{(1)}\bigr). (135) For every pair of nanowires (i,j) we test whether the corresponding segments intersect by using a parametric representation: \displaystyle(x_{i}(t_{i}),y_{i}(t_{i})) \displaystyle=(x_{i}^{(1)},y_{i}^{(1)})+t_{i}\Bigl[(x_{i}^{(2)},y_{i}^{(2)})-(x_{i}^{(1)},y_{i}^{(1)})\Bigr],\qquad t_{i}\in[0,1], (136) \displaystyle(x_{j}(t_{j}),y_{j}(t_{j})) \displaystyle=(x_{j}^{(1)},y_{j}^{(1)})+t_{j}\Bigl[(x_{j}^{(2)},y_{j}^{(2)})-(x_{j}^{(1)},y_{j}^{(1)})\Bigr],\qquad t_{j}\in[0,1]. (137) An intersection exists if there are parameters (t_{i},t_{j})\in[0,1]^{2} such that (x_{i}(t_{i}),y_{i}(t_{i}))=(x_{j}(t_{j}),y_{j}(t_{j})) . We then construct an unweighted graph intermediate \mathcal{G}=(\mathcal{N},\mathcal{E}) where each nanowire is a node ( \mathcal{N}=\{1,\dots,n\} ), and an edge e_{ij}\in\mathcal{E} is present iff nanowire i and nanowire j intersect. Next, we calculate a minimal spanning tree of \mathcal{G} , then randomly select input and output edges from the largest connected component of the complement of that minimal spanning tree. This ensures that our input and output edges are well-connected to one another and to the overall graph structure while allowing us to effectively sample from a realistic distribution of graph topologies. IV.12 Stochastic gradient We quantify how additive observation noise in the targets affects the two-phase current-squared update and the analytical (projector) gradient in our linear resistor network. As is common in statistical learning theory, we assume that we observe output \bm{y} for input \mathbf{x} , where \displaystyle\bm{y}=f(\mathbf{x})+\varepsilon, (138) with \varepsilon a zero-mean noise term, \mathbb{E}[\varepsilon]=0 . For our circuit, with input \mathbf{x} , the source voltages are \bm{s}_{F}=P_{i}^{\top}\mathbf{x} . The resulting resistor voltages are then -\gamma\Omega_{A/R}\bm{s}_{F}=-\gamma\Omega_{A/R}P_{i}^{\top}\mathbf{x} . The resulting outputs are thus \hat{\bm{y}}(\mathbf{x})=-\gamma\,P_{o}^{\top}\Omega_{A/R}P_{i}^{\top}\mathbf{x} . Defining the loss function as \displaystyle\mathcal{L}(\mathbf{x},\bm{y}) \displaystyle=\|\hat{\bm{y}}(\mathbf{x})-\bm{y}\|^{2} \displaystyle=\|-\gamma P_{o}^{T}\Omega_{A/R}P_{i}^{\top}\mathbf{x}-\bm{y}\|^{2}, (139) we can write the analytical gradient with respect to the resistances as \displaystyle\partial_{r}\mathcal{L}(v,v_{T}) \displaystyle=\frac{\partial\mathcal{L}}{\partial\hat{\bm{v}}}\frac{\partial\hat{\bm{v}}}{\partial r} \displaystyle=\diag(\mathbf{i})(I-\Omega_{A/R}^{T})(v-v_{T}), (140) where \mathbf{i}=R^{-1}v and v_{T} is the target voltage pattern embedded on the output edges. For our linear circuit, v(\mathbf{x})=-\gamma\Omega_{A/R}P_{i}^{\top}\mathbf{x} and v_{T}(\mathbf{x})=P_{o}^{\top}\bm{y} , so \displaystyle\partial_{r}\mathcal{L}(\mathbf{x},\bm{y}) \displaystyle=\diag(-\gamma R^{-1}\Omega_{A/R}P_{i}^{T}\mathbf{x})(I-\Omega_{A/R}^{T})\left(-\gamma\Omega_{A/R}P_{i}^{T}\mathbf{x}-P_{o}^{T}\bm{y}\right). (141) We now define C=-\gamma\Omega_{A/R}P_{i}^{T} . The two-phase gradient calculated with the true (noiseless) data f(\mathbf{x}) is given by T(\mathbf{x},\beta) : \displaystyle T(\mathbf{x},\beta) \displaystyle=-\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-\bm{i}_{C}^{\odot 2}\Big] \displaystyle=-\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-(\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x}))^{\odot 2}\Big]. (142) for some circuit-dependent matrix Q that captures the linear response of the currents to an output-level nudging signal. The two-phase gradient of the observed (noisy) data \bm{y} is given by \hat{T}(\mathbf{x},\bm{y},\beta) : \displaystyle\hat{T}(\mathbf{x},\bm{y},\beta) \displaystyle=-\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-\bm{i}_{C}^{\odot 2}\Big] \displaystyle=-\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-(\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-\bm{y})^{\odot 2}\Big] \displaystyle=-\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-(\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x})-\varepsilon)^{\odot 2}\Big] \displaystyle=-\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-\left(\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x}))-\beta Q\varepsilon\right)^{\odot 2}\Big] \displaystyle=-\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-\left((\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x})))^{\odot 2}-2(\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x})))\odot(\beta Q\varepsilon)+\beta^{2}(Q\varepsilon)^{\odot 2}\right)\Big]. (143) Then it follows that the expectation form is \displaystyle\mathbb{E}[\hat{T}(\mathbf{x},\beta)] \displaystyle=\mathbb{E}\left[-\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-\left((\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x})))^{\odot 2}-2(\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x})))\odot(\beta Q\varepsilon)+\beta^{2}(Q\varepsilon)^{\odot 2}\right)\Big]\right] \displaystyle=\mathbb{E}\left[-\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-(\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x})))^{\odot 2}\right]+\frac{1}{2\beta}\left(2\mathbb{E}\left[(\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x})))\odot(\beta Q\varepsilon)\right]-\mathbb{E}\left[\beta^{2}(Q\varepsilon)^{\odot 2}\right]\right) \displaystyle=\mathbb{E}\left[T(\mathbf{x},\beta)\right]+\frac{1}{2\beta}\left(2(\bm{i}_{F}+\beta Q(\hat{\bm{y}}(\mathbf{x})-f(\mathbf{x})))\odot(\beta Q\mathbb{E}\left[\varepsilon\right])-\mathbb{E}\left[\beta^{2}(Q\varepsilon)^{\odot 2}\right]\right) \displaystyle=T(\mathbf{x},\beta)-\frac{\beta}{2}\mathbb{E}\left[(Q\varepsilon)^{\odot 2}\right]. (144) The presence of the second term implies that \hat{T}(\mathbf{x},\bm{y},\beta) is not an unbiased estimator of T(\mathbf{x},\beta) . While we are generally focused on linear circuits in this manuscript, we note that this proof applies to both linear and nonlinear circuits. In other words, a gradient estimate of the form -\frac{1}{2\beta}\Big[\bm{i}_{F}^{\odot 2}-\bm{i}_{C}^{\odot 2}\Big] is guaranteed to be statistically biased, in addition to the well-known estimation error introduced by non-zero nudging. Returning to the case of fully linear circuits, we now focus on the form of the analytical ( \Omega ) gradient for the true data, \displaystyle A(\mathbf{x}) \displaystyle=\diag(\mathbf{i})(I-\Omega_{A/R}^{T})(v-P_{o}^{\top}f(\mathbf{x})) \displaystyle=\diag(R^{-1}C\mathbf{x})(I-\Omega_{A/R}^{T})(C\mathbf{x}-P_{o}^{\top}f(\mathbf{x})), (145) and the observed analytical gradient, \displaystyle\mathbb{E}\left[\hat{A}(\mathbf{x})\right] \displaystyle=\mathbb{E}\left[\diag(R^{-1}C\mathbf{x})(I-\Omega_{A/R}^{T})(C\mathbf{x}-P_{o}^{\top}g(\mathbf{x}))\right] \displaystyle=\diag(R^{-1}C\mathbf{x})(I-\Omega_{A/R}^{T})\mathbb{E}\left[C\mathbf{x}-P_{o}^{\top}f(\mathbf{x})-P_{o}^{\top}\varepsilon\right] \displaystyle=\diag(R^{-1}C\mathbf{x})(I-\Omega_{A/R}^{T})(C\mathbf{x}-P_{o}^{\top}f(\mathbf{x})-P_{o}^{\top}\mathbb{E}\left[\varepsilon\right]) \displaystyle=\diag(R^{-1}C\mathbf{x})(I-\Omega_{A/R}^{T})(C\mathbf{x}-P_{o}^{\top}f(\mathbf{x})) \displaystyle=A(\mathbf{x}). (146) Thus, the observed analytical gradient \hat{A} is an unbiased estimator of the true analytical gradient A . Note that this means that there are two sources of error when using the two-phase gradient in practice: 1. The deterministic error due to the fact that the true two-phase gradient T is only an O(\beta) approximation of ( 111 ). 2. The stochastic error due to the fact that the empirical two-phase gradient \hat{T} is a biased estimator of the true two-phase gradient T for any non-zero nudge. In contrast, the analytical gradient does not incur the finite- \beta approximation error of the two-phase estimator and remains unbiased under additive zero-mean observation noise. In particular, assuming \mathbb{E}[\varepsilon\mid\mathbf{x}]=0 , the observed analytical gradient satisfies \displaystyle\mathbb{E}\left[\hat{A}(\mathbf{x})\mid\mathbf{x}\right]=A(\mathbf{x}). (147) However, \hat{A}(\mathbf{x}) still has variance from observation noise (and from finite-sample minibatching over \mathbf{x} ). The noise-induced error is explicit: \displaystyle\hat{A}(\mathbf{x})-A(\mathbf{x})=\diag(R^{-1}C\mathbf{x})\,(I-\Omega_{A/R}^{\top})\,P_{o}^{\top}\varepsilon, (148) so that its conditional covariance (given \mathbf{x} ) is \displaystyle\mathrm{Cov}\!\left[\hat{A}(\mathbf{x})\mid\mathbf{x}\right]=\diag(R^{-1}C\mathbf{x})\,(I-\Omega_{A/R}^{\top})\,P_{o}^{\top}\Sigma_{\varepsilon}P_{o}\,(I-\Omega_{A/R})\,\diag(R^{-1}C\mathbf{x}), (149) where \Sigma_{\varepsilon}:=\mathrm{Cov}(\varepsilon\mid\mathbf{x}) . This bounds the mean-square-error of the analytical gradient, \displaystyle\mathbb{E}\!\left[\|\hat{A}(\mathbf{x})-A(\mathbf{x})\|_{2}^{2}\mid\mathbf{x}\right]\leq\|P_{o}\,(I-\Omega_{A/R})\,\diag(R^{-1}C\mathbf{x})\|_{2}^{2}\;\mathbb{E}\!\left[\|\varepsilon\|_{2}^{2}\mid\mathbf{x}\right]. (150) Thus, unlike the two-phase estimator which incurs both finite- \beta approximation error and an O(\beta) noise-induced bias, the analytical gradient remains unbiased under \mathbb{E}[\varepsilon\mid\mathbf{x}]=0 , with remaining uncertainty arising only from variance due to observation noise and finite-sample averaging. When testing these theoretical results experimentally, we sample regression inputs \bm{x}\sim\mathcal{N}(0,1) , and noiseless and noisy outputs \bm{y},\bm{y}_{\varepsilon}\in\mathbb{R}^{2} respectively. We use the generation procedure \bm{y}=M\bm{x} , \bm{y}_{\varepsilon}=M\bm{x}+\varepsilon , with M\in\mathbb{R}^{2\times 2} sampled uniformly entrywise from the interval [0,10) and \varepsilon\sim\mathcal{N}(0,9) . Inputs are encoded as edge sources and outputs read out on selected edges, producing \hat{\bm{y}}(\bm{x}) . In order to create Fig. 6 , we generated 160 nanowire networks via the procedure described in Appendix IV.11 . Training was performed with both vanilla two-phase and \Omega learning. Vanilla two-phase learning was performed with nudge \beta=0.3 and a learning rate of 1 . Similarly, \Omega learning used a learning rate of 0.3 to match the scale of the gradient for vanilla two-phase learning (which has a magnitude roughly proportional to the nudge). To ensure that we are only using those nanowire networks with trainable topologies, we considered only the results from the top 25\% of networks (40 total networks) with the best performance early in training (as measured by the average of the losses of \Omega learning and vanilla two-phase learning at Epoch 20). We report loss curves, resistance evolution, and the Frobenius distance between the learned and target input–output maps (Fig. 6 ). These appear to confirm our theoretical results: namely, while both vanilla two-phase learning and \Omega learning perform well in the noiseless setting, \Omega learning has a significant advantage in the noisy setting due to the statistical bias in the gradient estimates of vanilla two-phase learning. IV.13 Hinge-loss classification in circuits IV.13.1 Classifier and hinge loss We use a single readout edge with basis vector \mathbf{e}_{o}\in\mathbb{R}^{M} . For an input \bm{x} , the circuit produces \bm{v}(\bm{x}) and scalar score f(\bm{x})=\mathbf{e}_{o}^{\top}\bm{v}(\bm{x}) . With labels y\in\{-1,1\} , the hinge loss is L_{h}(\bm{x},y)=\max(0,\,1-yf(\bm{x})). (151) Equivalently, define a target voltage vector supported on the output edge, \mathbf{v}_{T}:=y^{\top}\,\mathbf{e}_{o}, (152) so that the margin is \mathbf{v}_{T}^{\top}\bm{v}=y\,\mathbf{e}_{o}^{\top}\bm{v} and \mathcal{L}_{h}(\bm{v},\mathbf{v}_{T})=\max(0,\,1-\mathbf{v}_{T}^{\top}\bm{v}). (153) Only margin-violating examples (those with 1-\mathbf{v}_{T}^{\top}\bm{v}>0 ) contribute a nonzero update. IV.13.2 Subgradient with respect to resistances Let \bm{r} be the vector of edge resistances. For margin-violating samples, a subgradient is \frac{\partial\mathcal{L}_{h}}{\partial\bm{r}}=-\,\frac{\partial(\mathbf{v}_{T}^{\top}\bm{v})}{\partial\bm{r}}=-\,\mathbf{v}_{T}^{\top}\frac{\partial\bm{v}}{\partial\bm{r}}. (154) Using the circuit Jacobian identity \frac{\partial\bm{v}}{\partial\bm{r}}=(I-\Omega_{A/R})\,\diag(\bm{i}), (155) (where \bm{i} is the steady-state edge current vector), we obtain for violating samples \frac{\partial\mathcal{L}_{h}}{\partial\bm{r}}=-\,\mathbf{v}_{T}^{\top}(I-\Omega_{A/R})\,\diag(\bm{i}), (156) and \partial\mathcal{L}_{h}/\partial\bm{r}=0 otherwise. This expresses the classification update entirely in terms of steady-state observables and \Omega_{A/R} . IV.13.3 How the two estimators implement this update Two-phase (contrastive) estimator. The two-phase scheme forms an update from free/clamped current measurements: \Delta\bm{r}\ \propto\ \bm{i}_{F}^{\odot 2}-\bm{i}_{C}^{\odot 2}, (157) where the clamped phase is obtained by applying a small output-edge perturbation. For hinge loss with a single output edge, we gate the nudge by the margin condition: \epsilon=\begin{cases}-\beta\,y\,\mathbf{e}_{o},&\text{if }1-y\,\mathbf{e}_{o}^{\top}\bm{v}>0,\\ \mathbf{0},&\text{otherwise,}\end{cases} (158) and implement the clamped experiment using this \epsilon as the output-edge bias. The resulting contrastive update approximates the subgradient above, with accuracy controlled by the nudge magnitude. Projector-based (analytical) estimator. The projector-based scheme first applies an output-supported error vector \epsilon (as above) and computes \Delta:=(I-\Omega_{A/R}^{\top})\epsilon, (159) where the action of \Omega_{A/R}^{\top} is realized by a reciprocal/current-mode experiment. The resistance update is then local: \Delta\bm{r}\ \propto\ \bm{i}_{F}\odot\Delta. (160) This mirrors the analytical structure in ( 155 ) and removes finite-nudge bias at the estimator level. IV.14 Landscape visualization To visualize training trajectories, we follow the loss-landscape procedure of Li et al. 25 . Concretely, we collect the resistance trajectory \{\bm{r}_{t}\}_{t=0}^{T} during training. We then compute the offsets \{\Delta\bm{r}_{i}\}_{t=0}^{T} for each timestep relative to the initial resistance state, namely \Delta\bm{r}_{i}=\bm{r}_{i}-\bm{r}_{0} (161) and then find the two principal directions of variation in these offsets, which we denote ( \bm{\delta}_{1} , \bm{\delta}_{2} ). It is then possible to deterministically sample the two-dimensional loss landscape S “around" the starting resistance configuration \bm{r}_{0} at some coordinate (q_{1},q_{2}) by evaluating \displaystyle\bm{r}^{\prime} \displaystyle=\bm{r}_{0}+q_{1}\bm{\delta}_{1}+q_{2}\bm{\delta}_{2} (162) \displaystyle S(q_{1},q_{2}) \displaystyle=\overline{\mathcal{L}}(-\Omega_{A/R}(\bm{r}^{\prime})) (163) where \overline{\mathcal{L}}(\cdot) is the full-batch loss and -\Omega_{A/R}(\cdot) is the projector of the circuit with a given vector of edge resistances. Generally we restrict (q_{1},q_{2}) to lie in [-1.5,1.5]^{2} . To plot an actual trajectory of weights on the landscape, we instead compute the inverse transform, finding the transformed (q_{1},q_{2}) coordinates of every stored resistance configuration in the trajectory.