Setting random seeds for randomBN #6
-
I tried using the following to fix the seed, but it doesn't seem to work for
How can I fix a seed so that I can re-generate the same BN with the same CPT each time? |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 10 replies
-
Hi @kenneth-lee-ch , We have an internal random generator initialized with |
Beta Was this translation helpful? Give feedback.
-
Just to let you know the progress we made here :
|
Beta Was this translation helpful? Give feedback.
-
@kenneth-lee-ch : Fixed ! (tomorrow in pyAgrum-nightly , soon in 1.6.2) |
Beta Was this translation helpful? Give feedback.
-
Hum, that's logical but I do not know how to prevent that : the new randomBN use the names X{i} in topological order ... So if you try to force the same names (using graphnames), you may try to change the name "X10" of a node whereas another has the same name. Now you can just use : |
Beta Was this translation helpful? Give feedback.
-
PS- 16.2 will finally be 1.7.0 tomorrow |
Beta Was this translation helpful? Give feedback.
-
PS2- Finally, I found a way to prevent these names collision. Will be in 1.7.0 tomorrow :-) |
Beta Was this translation helpful? Give feedback.
-
Thanks! I look forward to the latest version!
…On Thu, Mar 16, 2023, 6:59 PM Pierre-Henri Wuillemin < ***@***.***> wrote:
PS2- Finally, I found a way to prevent these names collision. Will be in
1.7.0 tomorrow :-)
—
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF3Z3CUGFGRWXDMAOVR3QJLW4OLLJANCNFSM6AAAAAAVNMKZ6Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
:-) 1.7.1 is here ! |
Beta Was this translation helpful? Give feedback.
-
@phwuil When I use |
Beta Was this translation helpful? Give feedback.
-
@kenneth-lee-ch , it seems to work here : |
Beta Was this translation helpful? Give feedback.
-
It should not and it looks okt : import pyAgrum as gum
class A:
def f(self,seed):
gum.initRandom(seed)
return gum.randomBN(names="ABCDEFG")
a=A()
seeds=[5,4,0,5,4]
for seed in seeds:
print("************")
print(f"** {seed=}")
print("************")
bn=a.f(seed)
print(f' => {bn.parents("G")=}')
print(bn.cpt("A")) |
Beta Was this translation helpful? Give feedback.
@kenneth-lee-ch : Fixed !
(tomorrow in pyAgrum-nightly , soon in 1.6.2)