Train one scalar weight to match a target using the same gradient-descent loop. Return the loss path instead of hiding the learning process.
Required APIdef train_neuron(weight, target, learning_rate, steps):
return [[step, weight, loss], ...]BehaviorThink through the mechanism first if you want the extra reasoning step. It never blocks the editor.
train_neuron(0.0, 1.0, 0.25, 2)the loss should fall while the weight approaches the target
train_neuron(1.0, 1.0, 0.5, 1)an optimum needs no corrective update
2 hidden edge tests run after the visible contract passes.
Run Tests to see the contract verdicts here.