From 1eafbac335c8169f5b41d62b7d673d26128ea13c Mon Sep 17 00:00:00 2001 From: Viktor Danov Date: Sun, 29 Oct 2023 18:44:49 +0200 Subject: [PATCH] fix: weight randomization --- production_rule.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/production_rule.go b/production_rule.go index df5d7a2..db282cf 100644 --- a/production_rule.go +++ b/production_rule.go @@ -104,11 +104,7 @@ func (bp *ByteProductionRule) RandomizeWeights(delta float64) { total := 0.0 for i := 0; i < len(bp.Weights); i++ { - random := rand.Float64() - _, tokens := bp.findSuccessorByProbability(random) - for _, token := range tokens { - currentWeights[token] += delta - rand.Float64()*2*delta - } + currentWeights[i] += delta - rand.Float64()*2*delta bp.Weights[i].LowerLimit = total total += currentWeights[i]