Skip to content

Commit

Permalink
deterministic sorting of arrays from maps
Browse files Browse the repository at this point in the history
  • Loading branch information
xmariachi committed Feb 19, 2025
1 parent 7c82e06 commit 2e4a03c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions x/emissions/keeper/actor_utils/losses.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"cosmossdk.io/collections"
errorsmod "cosmossdk.io/errors"
cosmosMath "cosmossdk.io/math"
alloraMath "github.com/allora-network/allora-chain/math"
keeper "github.com/allora-network/allora-chain/x/emissions/keeper"
synth "github.com/allora-network/allora-chain/x/emissions/keeper/inference_synthesis"
"github.com/allora-network/allora-chain/x/emissions/types"
Expand Down Expand Up @@ -148,15 +149,9 @@ func CloseReputerNonce(
// Calculate the regret_stdnorm and the weights (multistep process).
// 0. Get inferer and forecaster regrets
infererRegrets := regrets.InfererRegrets
inferers := make([]synth.Worker, 0, len(infererRegrets))
for inferer := range infererRegrets {
inferers = append(inferers, inferer)
}
inferers := alloraMath.GetSortedKeys(infererRegrets)
forecasterRegrets := regrets.ForecasterRegrets
forecasters := make([]synth.Worker, 0, len(forecasterRegrets))
for forecaster := range forecasterRegrets {
forecasters = append(forecasters, forecaster)
}
forecasters := alloraMath.GetSortedKeys(forecasterRegrets)

// 2. Calculate the regret_stdnorm to be used in
// 2.a Calculate the regret_stdnorm filtered by ∫the previous weights. If not, apply stddev.
Expand Down

0 comments on commit 2e4a03c

Please sign in to comment.