<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nickson Mwamsojo on Medium]]></title>
        <description><![CDATA[Stories by Nickson Mwamsojo on Medium]]></description>
        <link>https://medium.com/@nicksonmwamsojo?source=rss-5a9ba67c6a68------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*sxVicK5TWe9QwfD-.</url>
            <title>Stories by Nickson Mwamsojo on Medium</title>
            <link>https://medium.com/@nicksonmwamsojo?source=rss-5a9ba67c6a68------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 00:58:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nicksonmwamsojo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Chronos-2 lost to LightGBM at retail forecasting. Here’s where it still wins.]]></title>
            <link>https://medium.com/@nicksonmwamsojo/chronos-2-lost-to-lightgbm-at-retail-forecasting-heres-where-it-still-wins-9ac0c9972608?source=rss-5a9ba67c6a68------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ac0c9972608</guid>
            <category><![CDATA[retail-forecasting]]></category>
            <category><![CDATA[time-series-forecasting]]></category>
            <category><![CDATA[chrono]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Nickson Mwamsojo]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 16:01:26 GMT</pubDate>
            <atom:updated>2026-11-04T16:01:26.436Z</atom:updated>
            <content:encoded><![CDATA[<h4>The 28-day rule for cold-start retail forecasting.</h4><p>Our tuned LightGBM beat Chronos-2 by 22% on 30,490 Walmart products. I’d still deploy Chronos tomorrow, for one specific job: forecasting products that launched less than four weeks ago.</p><p>Here’s how I got there, dead ends included. If you just want the setup, skip to ‘‘<strong>How I’d use this”.</strong></p><h3>The problem nobody’s model handles</h3><p>Mature products are easy. A well-tuned gradient boosting model with lag features handles a SKU with three years of history and a stable weekly pattern without much effort.</p><p>Launches are hard. A mid-sized retailer introduces hundreds of new SKUs a month, and a fast-fashion brand replaces its whole range every season. A product launched today has no lag features, no rolling averages, and no target encoding. That’s everything a tree-based model needs.</p><p>So teams wait. They collect a few weeks of sales, then fold the product into the next retraining cycle. In the meantime, the demand planner guesses, the supply chain over-orders to be safe, and the overstock bill grows.</p><p>Chronos-2 skips that wait. It’s a time series foundation model pre-trained on a large set of series, so a new SKU needs no training run. Give it a series of any length, even a few days, and it returns a forecast.</p><h3>What I found</h3><p>I tested Chronos-2-small against the M5 benchmark: 30,490 Walmart SKUs, a 28-day horizon, scored with WRMSSE over three seasonal cutoffs.</p><ul><li><strong>The best Chronos pipeline scored 0.7969</strong>, 51% better than the naive baseline (1.6310). Zero-shot alone gets you to about 1.03, or 0.98 with a light calibration step, in a few days.</li><li><strong>A fully tuned LightGBM scored 0.6198.</strong> On products with full history, it wins clearly.</li><li><strong>On products with under 28 days of history, Chronos won 59% of series</strong>, and 72% on the cutoff with the most launches. Below 28 days, LightGBM’s most important feature doesn’t exist yet.</li></ul><p>If you already run a mature forecasting pipeline, Chronos-2 is a cold-start layer: use it for the first 28 days after a launch, then hand over. If you’re starting from scratch, it gets you a competitive forecast with very little feature engineering or infrastructure.</p><h3>The setup</h3><p>A few terms I’ll use throughout:</p><ul><li><strong>WRMSSE</strong>: the M5 competition metric. It’s a scaled error weighted by each series’ sales value, so lower is better and high-volume items count most.</li><li><strong>Zero-shot (ZS)</strong>: running the pre-trained model as is, with no training on Walmart data.</li><li><strong>Context length (CL)</strong>: how many past days the model sees before forecasting.</li><li><strong>Cross-learning</strong>: a Chronos-2 option (cross_learning=True) that lets each series attend to the other series in its inference batch.</li><li><strong>Covariates</strong>: extra inputs per series, here price, calendar events, and SNAP days. SNAP is the US food assistance program; benefits are paid on fixed days that differ by state, which creates visible sales spikes.</li><li><strong>OLS calibration</strong>: a single multiplicative correction per department, fitted by ordinary least squares with leave-one-cutoff-out validation.</li></ul><p>The floor is a plain naive forecast that repeats each series’ last day:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYHXCbN_JMu6QuJVkHDYtg.png" /></figure><p>Autumn is the hard one. Pre-holiday stocking breaks the weekly pattern a naive forecast depends on.</p><h3>Getting zero-shot right</h3><p>Most of the improvement came before any training at all. Just from three configuration choices. All scores below are geometric means over the three cutoffs unless I say otherwise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UaTMQ4gUQmEa0Xm8aA9QZg.png" /></figure><h3>1. Context length matters more than anything else</h3><p>My first run used one week of context (CL=7) across all series and scored 1.2504. It’s better than naive but by a small margin.</p><p>The more useful discovery was at CL=1. With a single observation, Chronos produces exactly the same forecast as the naive baseline: 1.6310, to four decimals. That makes a handy sanity check. If your CL=7 result is barely better than CL=1, something is wrong with how you’re building the context.</p><p>One week captures the weekly cycle. Past CL=14, results got worse on noisy series because the model starts reading old spikes as structure. So sweep {1, 4, 7, 14, 28} before you settle on anything in your experiments.</p><h3>2. Covariates and cross-learning cancel each other out</h3><p>This was the most counter-intuitive result. I expected price and calendar covariates to stack with cross-learning. In a global batch with all 30,490 series mixed together, they did the opposite:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NL3XRqA2opYs8TtVUod-PQ.png" /></figure><p>Both mechanisms bring in information from outside the series themselves, through different channels. Mix them in a batch where neighbors have nothing in common, and cross-attention blends covariate signals that don’t belong together. A California item attends to a Texas item during a California-only SNAP day, and both forecasts get noisier.</p><p><strong>The rule</strong>: if you have rich covariates and a mixed batch, try to toggle cross-learning off first.</p><h3>3. Cross-learning works once batches make sense</h3><p>Cross-learning isn’t useless. It just needs neighbors worth learning from. When I ran inference one department at a time, the picture flipped:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mbyuMvkYwgtl1mhVHJTeoQ.png" /></figure><p>In a batch of 100 <strong><em>FOODS_1</em></strong> items, every series shares the same SNAP eligibility, the same promotions, and similar weekly rhythms. Attention now finds a real group signal. That’s worth about 0.04 WRMSSE, more than most single settings I tried.</p><p>There’s one side effect. Department batches made <strong><em>FOODS_1</em></strong> forecasts about 1.59× too low, because a batch of high-volume items has no outside anchor. The OLS calibration step fixes this, so always include it when you segment.</p><p>I also played with other ways to group series. Demand-type classes (smooth, erratic, intermittent, lumpy) worked but didn’t line up with the metric. Volume tiers, built from quartiles of WRMSSE weight, worked better and were simpler. Grouping by store was worse than not grouping at all: the ten Walmart stores share the same seasonality and differ mostly in volume. Group by how products sell.</p><h3>Fine-tuning: where it hurt and where it helped</h3><h3>Global fine-tuning destroys the model fast</h3><p>If zero-shot reaches 1.08, a few gradient steps on Walmart data should help. That was my assumption. So I fine-tuned on all 30,490 series for up to 1,000 steps and blended each checkpoint 50/50 with the tier ensemble described below (spring cutoff):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YVh1HVxXrJsyyRMI6QbCWA.png" /></figure><p>Five steps bought 0.004, which is inside the noise. By ten steps the gain was gone, and by 200 the error had increased by nearly 50%. That’s a symptom of <strong>catastrophic forgetting</strong>: the updates overwrite the broad patterns learned in pre-training faster than they learn anything Walmart-specific. If you fine-tune a time series foundation model on intermittent retail data, check results at 5, 10, and 25 steps and stop as soon as they flatten.</p><h3>The LoRA bug that wasted my experiments</h3><p>After that, LoRA looked like the safer route: train small adapters and leave the base model frozen. I set it up myself with the PEFT library and ran it by tier and by department. The results were flat, and for a while I concluded LoRA just didn’t help on this data.</p><p>Then I noticed every LoRA run matched the base model exactly, number for number. My inference code was calling the underlying model directly instead of going through the PEFT wrapper, so the adapters were loaded but never used. Calling peft_model.merge_and_unload() before inference fixed it.</p><p>With the fix, department-level LoRA (200 steps) scored 0.9509: better, but still well behind the tier ensemble. Two lessons: if fine-tuned outputs are identical to the base model, that’s a bug. And today you can avoid this entirely with Chronos-2’s built-in fit(finetune_mode=”lora”), which handles the adapters for you.</p><h3>Fine-tuning per volume tier works</h3><p>What did work was fine-tuning four separate models, one per volume tier, with aggressive early stopping. Series within a tier are similar enough that forgetting stays under control, and the four models disagree in useful ways.</p><p>The trick is how you blend them. I learned a 4×4 weight matrix where each row says how much each tier model contributes to series in a given tier, optimized with Nelder-Mead over the three cutoffs. A single set of weights shared by every series scored 0.9278. The per-tier matrix scored 0.8180. The blend structure accounted for the whole gap.</p><p>I also tried the larger Chronos-2 BASE model (120M parameters). And to my surprise, it did worse than the small model, at 1.1963, with a severe scale bias on FOODS_1. I think short, gappy retail series don’t give the extra capacity anything to work with, so benchmark both sizes before naively assuming bigger is better, as I did.</p><h3>The final recipe</h3><p>The best result combines two pieces with a light calibration:</p><ol><li><strong>The tier ensemble</strong> (0.8180 alone), which captures fine patterns within each volume segment.</li><li><strong>Department-segmented zero-shot with cross-learning</strong> (0.9829 alone after calibration), which brings in cross-series patterns that tier-by-tier fine-tuning never sees.</li><li><strong>One OLS scalar per department</strong>, validated leave-one-cutoff-out, to combine them and correct the FOODS_1 bias. With only three cutoffs, in-sample OLS would overfit, so the leave-one-out step isn’t optional.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHPWdtbQvn36iz2D_f-UZw.png" /></figure><p>When you read the table from top to bottom: configuration choices took the score from 1.63 to 1.03. Fine-tuning and calibration took it the rest of the way, to 0.80.</p><h3>LightGBM wins, until a product is new</h3><p>I designed a stronger classical baseline: a LightGBM model used 37 hand-built features: six lags between 28 and 42 days, seven rolling statistics anchored at lag 28, price features, SNAP flags, calendar features, and target-encoded sales means by store, department, and state. It had a Tweedie objective and 20 Optuna trials, each running three calibration cutoffs with up to 800 boosting rounds. That also meant a feature cache, checkpointing, and a fair amount of debugging.</p><p>It scored <strong>0.6198</strong> (autumn 0.6016, winter 0.6406, spring 0.6178). That’s 22% better than the best Chronos pipeline.</p><p>I tried blending the two. The blend scored 0.6254, slightly worse than LightGBM alone. On autumn, the optimal weight was 100% LightGBM. On products with full history, Chronos adds nothing LightGBM doesn’t already have.</p><p>The effort gap is worth stating too. The Chronos pipeline came down to a context-length sweep, one boolean and seven small regressions. LightGBM needed domain knowledge to pick the features and real infrastructure to train them.</p><h3>The 28-day rule</h3><p>The M5 test set hides LightGBM’s real weakness, because every test series has a full training history. In production, new SKUs show up that the model has never seen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X8BdxIocgtM7WdYdLWl71g.png" /></figure><p>To measure this, I computed the unweighted error (RMSSE) for every series and grouped series by active history: days since their first non-zero sale. I used the unweighted version on purpose, because WRMSSE favors high-volume items and would drown out the few new products.</p><p>The Chronos column here’s plain department-level zero-shot with cross-learning. No fine-tuning, no ensemble: exactly what you could deploy on day one.</p><p>Below 28 days, Chronos wins 59% of series and has the lower median error. On the autumn cutoff, which has the most launches, it wins 72%, with a median RMSSE of 1.189 against 1.285. Above 28 days, LightGBM takes over and stays ahead.</p><p>The crossover isn’t a coincidence. LightGBM’s most predictive feature in my experiments is lag_28, sales on the same weekday four weeks earlier. For a product younger than 28 days, that value doesn’t exist. LightGBM sends it down the branch it learned for missing values, which was trained on stockouts and gaps, not on brand-new products. Chronos has no such floor: one day of history gives a forecast, and a week captures the weekly cycle.</p><p>One caveat. The under-28-days bucket holds only 43 series across two cutoffs (32 in autumn, 11 in winter, none in spring). The win rate is only a hint. The structural argument doesn’t depend on sample size; before day 28, the feature LightGBM relies on most isn’t available.</p><h3>How I’d use this</h3><p><strong>If you already have a production model</strong>, put Chronos-2 in front of it for new products only. A gate on history length is all it takes:</p><pre>def forecast(sku_id, history_days):<br>    if history_days &lt; 28:<br>        return chronos_forecast(sku_id)  # zero-shot, no training<br>    return lgbm_forecast(sku_id)         # your production model</pre><p><strong>If you’re starting from scratch</strong>, start with Chronos-2 and build up in stages:</p><ol><li><strong>Day one: baseline.</strong> Zero-shot at CL=7, no segmentation, no covariates. Check it’s clearly better than CL=1.</li><li><strong>Two to three days: a proper zero-shot pipeline.</strong> Run inference per product category with cross-learning on, add SNAP and calendar covariates (and price, if it’s clean), sweep context length per category, then add per-category OLS calibration. Expect a WRMSSE around 0.98–1.08.</li><li><strong>One to two weeks, only if you need it: the tier ensemble.</strong> Fine-tune one model per volume tier for at most 25 steps, learn the blend weights with Nelder-Mead, and calibrate against the zero-shot pipeline. Expect around 0.80.</li></ol><p>The zero-shot loop in step 2 looks like this:</p><pre>for category in product_categories:<br>    best_cl = sweep_cl([1, 4, 7, 14, 28], category)<br>    forecasts[category] = chronos_small.predict_quantiles(<br>        series=filter_by_category(all_series, category),<br>        context_length=best_cl,<br>        cross_learning=True,   # only in category-coherent batches<br>        batch_size=100,<br>    )<br>calibrated = loo_ols(forecasts, actuals)  # needs at least 3 cutoffs</pre><p>Three traps to avoid: don’t fine-tune globally, don’t assume the bigger model is better, and don’t turn on cross-learning in mixed batches when you have covariates.</p><h3>The point</h3><p>For retailers with a mature ML pipeline and the people to maintain it, LightGBM will stay more accurate on most of the range. But every week brings new products that planners still forecast by eye. For those first four weeks, Chronos-2 was the simplest option in my comparison that works from day one, and it beat the classical model, which had nothing to work with.</p><p><em>I’m a data scientist interested in bringing time series foundation models into existing forecasting stacks. If you’re working on something similar, I’d like to hear about it: </em><a href="/service/mailto:contact@aquiladata.fr"><em>mwamsojonr@</em></a>gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ac0c9972608" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hopfield Neural Networks: Time Series Solutions for Combinatorial Optimization Problems]]></title>
            <link>https://medium.com/@nicksonmwamsojo/hopfield-neural-networks-time-series-solutions-for-combinatorial-optimization-problems-13a8ed1e4477?source=rss-5a9ba67c6a68------2</link>
            <guid isPermaLink="false">https://medium.com/p/13a8ed1e4477</guid>
            <category><![CDATA[ising-model]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[time-series-analysis]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Nickson Mwamsojo]]></dc:creator>
            <pubDate>Fri, 14 Feb 2025 20:03:40 GMT</pubDate>
            <atom:updated>2026-09-15T13:08:35.823Z</atom:updated>
            <content:encoded><![CDATA[<p><em>“I think that the prize is recognizing, in part, the fact that understanding the deep problems of things like the mind is not going to come forth in some simple way like Newtonian physics. It really requires much more </em><strong><em>understanding of the relationship between structure and properties, and structure dynamics and properties</em></strong><em>. And that’s a mixture of </em><strong><em>some corners of physics, some corners of chemistry, some corners of biology</em></strong><em>, coming together to understand and create an area of study.”</em></p><p>— John J. Hopfield</p><p>The words cited above were uttered by <strong>John J. Hopfield</strong> in an Interview with Adam Smith about his Nobel Prize award. The words ‘<strong><em>understanding of the relationship between structure and properties’ </em></strong>stood out because they remind me of what sparked my interest in physical neural networks. As a physicist, he spent a lot of time examining questions in biology, especially the workings of the brain. It’s pretty fascinating how such brilliant minds succeed in stealing the secret mysteries of our complex biology and sharing them with the rest of us.</p><p>Of his many works, he proposed <strong>Hopfield Neural Networks</strong>, an interesting class of interconnected neuron-like elements whose structural dynamics and properties can be useful for combinatorial optimization problems. Thanks to his work and subsequent generalizations we have hardware implementations known as <strong>Ising Machines</strong>. These networks are powerful because any NP-complete problem can be recast as finding the ground state of an Ising system (Lucas, 2014) – and while that ground state remains hard to compute exactly, an Ising machine can relax into a high-quality solution with striking speed and energy efficiency.</p><h3>Ising Machines</h3><p>Certain metals exhibit a fascinating phenomenon at temperatures below a critical threshold, known as T_<em>cr</em> — they become magnetized on a macroscopic scale. This behavior, called ferromagnetism, arises when individual atoms’ magnetic moments (or spins) align in the same direction at the microscopic level. However, once the temperature surpasses T_<em>cr</em>, thermal energy disrupts this alignment, causing the spins to orient randomly and canceling out any net magnetic field. This fundamental concept is the basis of the Ising model, named after physicist <em>Ernst Ising</em>. The model envisions a fixed lattice structure where atoms remain stationary, with their spin orientation being the only variable degree of freedom.</p><p>Suppose we have a square lattice/grid of interacting spins of size <em>n x n.</em> Every node at position s=[<em>l, c]</em> can have one of two spin states. We can represent the lattice (matrix) in a vector format (<strong>σ</strong>) by raster scanning the spin states columnwise. If Spin-up, σ[s] = σ_<em>s = 1</em> and if spin-down, σ[s] = σ_<em>s = -1</em>. The energy of this system is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*cWpRFEfjc_aWBRV1ItBckQ.png" /></figure><p>Here, Js,t = −1 is a matrix governing interactions between the spin at position <em>s</em> and the spin <em>t </em>whereas <em>b_s</em> and is the bias associated with the spin <em>s</em>. Like all physical systems, left to its own devices, the lattice system above will evolve naturally in a manner that lowers its energy <em>E(</em><strong><em>σ</em></strong><em>)</em>. An interesting question arises:</p><blockquote><strong><em>Can we formulate a combinatorial optimization problem such that the optimal or quasi-optimal solution coincides with the ground state of an Ising system?</em></strong></blockquote><p>Turns out the answer is, fortunately, <strong>yes!</strong> And that’s pretty exciting. But to demonstrate this to you in practice I have to show you how we transform the above lattice system with binary spin states to a <strong>physical analog system</strong>. This can be done by the generalized Hopfield network defined by the equation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZjOGBAdcCfZQorrbClXViw.png" /></figure><p>Where <strong><em>x</em></strong><em>_s</em> is the activation state of the neuron at position <em>s, </em>at discrete time <em>k, </em>and<em> f </em>is a nonlinear function. We use the <em>square cosine</em> function in this article. Parameters α and β are constants to be tuned for the right network dynamics. Since our lattice is a binary spin state system, the analog neuron states <strong><em>x</em></strong><em>_s</em> can be mapped to <strong>σ</strong>_<em>s </em>via:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*oVNVHXCZrnrJdcmp0Y-xXA.png" /></figure><p>All these mathematical formulas are cool, but seeing them in actions is even cooler, so I will go right to their applications by solving a few fun examples.</p><h4>Maxcut example</h4><p>Let’s start with a lattice <em>10x10</em> with random initial spin orientations that can interact. Their interaction is governed by the connectivity matrix J_s,t = −1 ∀(s, t) where spin <em>s</em> and<em> </em>spin<em> t</em> are neighbors (only the <strong>left</strong>, <strong>bottom</strong>, <strong>right</strong>, and <strong>top</strong> spins are considered neighbors). This interaction is termed <strong><em>antiferromagnetic</em></strong>. The bias term is set to zero. We add normal noise to the spin equation above, with variance = 0.02 to avoid being stuck in local minima. The noise helps the system to jump out of local minima in search of global minimum. The <em>gif</em> below shows the spin state evolution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qPyziPXPbac071bpVv0RQ.gif" /></figure><p>Where :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/153/1*l0a15OtC-DpS0X2_1Uu06w.png" /></figure><p>As we can see in the animation above, the neural network adjusted its state (spin orientations) to reach the ground state that here happens to correspond to a checker-board pattern of spins (E(σ) = -100). This is the Max-Cut problem, a fundamental problem in graph theory and combinatorial optimization. It involves dividing the vertices of a graph into two disjoint subsets such that the number (or weight) of edges between the two subsets is maximized.</p><h4>Image denoising</h4><p>We have seen how a neural network can solve the max-cut problem above without supervision or training. It evolves naturally to the ground state according to the <em>antiferromagnetic</em> interaction rules. So, let’s try a more interesting example. Say, Mr. Wick asked you to keep this cool 120<em>x</em>120 black-and-white image of him safe:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*aQAQyHShekBPj6Cqnag5BA.png" /></figure><p>And, for some messed-up reason, you spill Salt-and-pepper noise on this picture (technically, by flipping random pixels with probability, <em>p = 20%</em>). The image will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*fH92XBXXiwrt6nXBGRj-aA.png" /><figcaption>*I’m sorry Mr. Wick, I swear I mean no offense.</figcaption></figure><p>The question becomes:</p><blockquote><strong>Knowing Mr. Wick, can you formulate this image problem such that given the noisy image above, the HNN can on its own, reconstruct the original clean image? And potentially save your life?</strong></blockquote><p>Now you know it’s possible to do a raster scan to obtain a large vector like in the spin-lattice example above. And that you can encode the pixels by considering <strong>black </strong>ones as <strong>spin-up</strong> and <strong>white</strong> ones as <strong>spin-down</strong>.<strong> </strong>You use this vector as a fixed bias term for the system equation above. For the interaction matrix, you can use a <em>ferromagnetic</em> model (i.e. <em>J_s,t = 1</em>). You try several values of α and β and find that 0.64 and 0.17 respectively work best. You allow the network to evolve undisturbed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N8NwPsUiXKzQYwFag0pifQ.gif" /></figure><p>We can see that, the HNN removed most of the nasty Salt-and-pepper noise and we ended up with a cleaner version of Mr. Wick’s picture. Now, will this fix save your life? The final image isn’t exactly like the original to be honest. Here Mr. Wick looks more like the <strong>aftermath</strong> of his fights at the Basilica Of Sacré Coeur De Montmartre in Paris. Should you find a better method to clean this image? Power to you.</p><h3>Conclusion</h3><p>Hopfield Networks showcases the fascinating intersection of physics, biology, and artificial intelligence. They may have not saved you from Mr. Wick’s wrath but they can provide optimal solutions by optimizing security systems, logistics, and supply chains. As we continue to refine neural network designs, one thing remains clear: understanding intelligence is as much an art as it is a science. What’s more, all examples shared in this article are Python code implementations. However, the same examples can be run on a hardware simulations of HNN bringing unprecedented speeds and energy efficiency.</p><p><em>[1] N. Mwamsojo, F. Lehmann, K. Merghem, B.-E. Benkelfat and Y. Frignac, Optoelectronic coherent Ising machine for combinatorial optimization problems, Opt. Lett. 48, 2150 (2023), doi:10.1364/OL.485215.</em></p><p><em>[2] Böhm, F., Vaerenbergh, T.V., Verschaffelt, G. et al. Order-of-magnitude differences in computational performance of analog Ising machines induced by the choice of nonlinearity. Commun Phys </em><strong><em>4</em></strong><em>, 149 (2021). </em><a href="https://doi.org/10.1038/s42005-021-00655-8"><em>https://doi.org/10.1038/s42005-021-00655-8</em></a></p><p><em>[3] </em><a href="https://www.nobelprize.org/prizes/physics/2024/hopfield/facts/"><em>https://www.nobelprize.org/prizes/physics/2024/hopfield/facts/</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13a8ed1e4477" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>