Train()
The drift against the old loop was measured, not assumed, and it is never zero: 1e-16 after ONE epoch, 1e-15 at ten, 1e-14 at a hundred and still 1e-14 at five hundred. That is the one thing that could not be held fixed -- Haro's exp is the C library's, the engine's is Zig's, they agree to within an ulp, and gradient descent feeds each step into the next so the difference grows about a decade per five hundred epochs. Against weights of magnitude 1 to 10 it stays around 1e-15 relative, and both loops classify identically.
Exemples de base (1)
o = new stzLogisticRegression(new stzTrainingSet([
[ [0.0], "lo" ], [ [0.1], "lo" ], [ [0.2], "lo" ],
[ [0.8], "hi" ], [ [0.9], "hi" ], [ [1.0], "hi" ] ]))
o.Train(300)
# the weight has the sign the data implies
? o.Weights()[1] > 0
# low input -> low class
? o.Classify([0.05])
# high input -> high class
? o.Classify([0.95])
# ...and the boundary sits between them
? o.Probability([0.05]) < 0.5 and o.Probability([0.95]) > 0.5
# it fits its own training data
? o.TrainingAccuracy()
# Why() still narrates
? StzFindFirst("P('hi')", o.Why()) > 01 lo hi 1 1 1
exécuté le 2026-10-02 04:23 dans la bibliothèque au commit 0e72e2e2c ; tiré de numeric_logistic_narrated.ring(s'ouvre dans un nouvel onglet)
Les extensions de cette méthode
Chaque extension, et si elle existe pour cette méthode ; une extension qui existe se compose avec les autres (FindSTCS).
Chaque exemple est un fichier de test de la bibliothèque, exécuté dans la bibliothèque pour cette page ; seuls ceux dont la sortie a tenu toutes les promesses écrites par leur fichier sont montrés. Les explications, les titres et le code sont ceux de la bibliothèque, en anglais.

