如何设置 MLFlow 用于随机生成运行名称的种子?

huangapple go评论55阅读模式
英文:

How can I set the seed that MLFlow uses to randomly generate run names?

问题

我正在为Hugging Face transformers设置随机数生成器种子,使用transformers.set_seed()。我发现该函数也会为MLFlow设置种子,导致我始终得到相同的MLFlow运行和嵌套运行名称序列,这对我来说不理想。

在设置了Hugging Face transformers的种子后,我希望能够将MLFlow的种子重置为不同的值(或随机值)。

我如何设置MLFlow用于随机生成运行名称的种子?

英文:

I am currently setting the random number generator seed for Hugging Face transformers with transformers.set_seed() . I found that function also sets the seed for MLFlow and, as a consequence, I always get the same sequence of run and nested run names from MLFlow, which is to me undesirable.

After setting the Hugging Face transformers seed, I would like to be able to reset the seed for MLFlow to a different value (or a random value).

How can I set the seed that MLFlow uses to randomly generate run names?

答案1

得分: 0

MLFLow使用Python模块random来随机生成运行名称,请查看name_utils.py中的_generate_string()的实现。因此,设置该种子的方式是只需调用random.seed()

transformers的set_seed()实现设置了各种随机种子,包括random.seed()

我认为为了从MLFlow获得随机运行名称,要么我不调用set_seed(),而是手动设置Numpy和Pytorch的种子,要么在调用set_seed()后自己调用random.seed()

英文:

MLFLow uses python module random to randomly generate a run name, see the implementation of _generate_string() in name_utils.py. Therefore the way to set the seed for that would be to just call random.seed().

The implementation of the transformers set_seed() sets a variety of random seeds, including random.seed().

It seems to me that in order to have random run names from MLFlow, either I don't call set_seed(), but I manually set the seeds for Numpy and Pytorch, or I call random.seed() myself after calling set_seed().

huangapple
  • 本文由 发表于 2023年4月19日 18:11:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76053273.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定