When symfer serializes factor expressions from Python memory to a file, it uses the YAML format. YAML is like JSON, only:
The translation is as follows.
Python constructor | YAML |
---|---|
SumProd(['A','B'],[f,g])
|
!sumprod
arg: [A,B]
fac: [*f,*g]
|
f = Multinom([{'A':[0,1]},..],
[0.25,0.75,..])
|
&f !multinom
dom: [A: [0,0],..]
par: [0.25,0.75,..]
|
d = Fun([{'C':[False,True]}],
[{'A':[0,1],..],
[1,0,..])
|
&d !fun
cod: [C: [False,True]]
dom: [A: [0,1],..]
par: [1,0,..]
|
Index([d],[h])
|
!index
det: [*d]
fac: [*h]
|
I()
|
!i {}
|
Embed([d])
|
!embed
det: [*d]
|
Reorder([{'newB':'B'},
{'newA':'A'}],
[f])
|
!reorder
dic: [newB: B, newA: A]
fac: [*f]
|