Upgraded all uses of math/rand to math/rand/v2.

This commit is contained in:
Simon Sarasova 2024-05-02 02:45:00 +00:00
parent a7a0e99c8a
commit 38f9eca9db
No known key found for this signature in database
GPG key ID: EEDA4103C9C36944
4 changed files with 6 additions and 5 deletions

View file

@ -6,6 +6,7 @@ Small and insignificant changes may not be included in this log.
## Unversioned Changes
* Upgraded all uses of math/rand to math/rand/v2. - *Simon Sarasova*
* Improved Whitepaper.md. Race and ancestry are now seperate concepts. - *Simon Sarasova*
* Improved ReadMe.md and Documentation.md. - *Simon Sarasova*
* Upgraded Fyne to version 2.4.5. - *Simon Sarasova*

View file

@ -9,4 +9,4 @@ Many other people have written code for modules which are imported by Seekia. Th
Name | Date Of First Commit | Number Of Commits
--- | --- | ---
Simon Sarasova | June 13, 2023 | 237
Simon Sarasova | June 13, 2023 | 238

View file

@ -19,7 +19,7 @@ import "seekia/internal/helpers"
import "gorgonia.org/gorgonia"
import "gorgonia.org/tensor"
import mathRand "math/rand"
import mathRand "math/rand/v2"
import "bytes"
import "encoding/gob"
import "slices"
@ -558,7 +558,7 @@ func GetNewUntrainedNeuralNetworkObject(traitName string)(*NeuralNetwork, error)
// This is a necessary step so our neural network models will be reproducable
// Reproducable means that other people can run the code and produce the same models, byte-for-byte
pseudorandomNumberGenerator := mathRand.New(mathRand.NewSource(1))
pseudorandomNumberGenerator := mathRand.New(mathRand.NewPCG(1, 2))
// A layer is a column of neurons
// Each neuron has an initial value between 0 and 1

View file

@ -37,7 +37,7 @@ import "os"
import "strings"
import "sync"
import "slices"
import mathRand "math/rand"
import mathRand "math/rand/v2"
import goFilepath "path/filepath"
@ -1347,7 +1347,7 @@ func getTrainingAndTestingDataFilepathLists(traitName string)([]string, []string
slices.Sort(userIdentifiersList)
// Now we deterministically randomize the order of the user identifiers list
pseudorandomNumberGenerator := mathRand.New(mathRand.NewSource(1))
pseudorandomNumberGenerator := mathRand.New(mathRand.NewPCG(1, 2))
pseudorandomNumberGenerator.Shuffle(len(userIdentifiersList), func(i int, j int){
userIdentifiersList[i], userIdentifiersList[j] = userIdentifiersList[j], userIdentifiersList[i]