# Aligned Induction

## MUSH - Model induction

MUSH_model17.json is induced by the following script -

from MUSHDev import *

(uu,aa) = mushIO()
vv = uvars(uu)
vvl = sset([VarStr("edible")])
vvk = vv - vvl

hr = aahr(uu,aa)

model = "MUSH_model17"
(wmax,lmax,xmax,omax,bmax,mmax,umax,pmax,fmax,mult,seed) = ((9*9*10), 8, (9*9*10), 20, (20*3), 3, (9*9*10), 1, 10, 7, 5)

(uu1,df1) = decomperIO(uu,vvk,hr,wmax,lmax,xmax,omax,bmax,mmax,umax,pmax,fmax,mult,seed)

open(model+".json","w").write(decompFudsPersistentsEncode(decompFudsPersistent(df1)))

print("alignment: %.2f" % a)



The first section loads the sample,

from MUSHDev import *

(uu,aa) = mushIO()
vv = uvars(uu)
vvl = sset([VarStr("edible")])
vvk = vv - vvl

hr = aahr(uu,aa)



Then the parameters are defined,

model = "MUSH_model17"
(wmax,lmax,xmax,omax,bmax,mmax,umax,pmax,fmax,mult,seed) = ((9*9*10), 8, (9*9*10), 20, (20*3), 3, (9*9*10), 1, 10, 7, 5)



Here the limit of the underlying volume, xmax, is set to the product of the second, third and fourth largest valencies, 9*9*10,

rpln(sset([(vol(uu,sset([w])),w) for w in vv]))
# ...
# (9, stalk-color-above-ring)
# (9, stalk-color-below-ring)
# (10, cap-color)
# (12, gill-color)


In general, the maximum-roll-by-derived-dimension decomper is such that increasing any of the parameters generally increases the summed alignment valency-density at the cost of computation time and space. In this case the chosen parameters are such that MUSH_engine17 runs on a Windows 7 Xeon CPU 5150 @ 2.66GHz in less than 1GMB memory in 2554 seconds.

Then the decomper (defined in MUSHDev) is run,

def decomperIO(uu,vv,hr,wmax,lmax,xmax,omax,bmax,mmax,umax,pmax,fmax,mult,seed):

(uu1,df1) = decomperIO(uu,vvk,hr,wmax,lmax,xmax,omax,bmax,mmax,umax,pmax,fmax,mult,seed)



Then the model is is written to MUSH_model17.json,

open(model+".json","w").write(decompFudsPersistentsEncode(decompFudsPersistent(df1)))


Finally, the summed alignment and the summed alignment valency-density are calculated,

(a,ad) = summation(mult,seed,uu1,df1,hr)
print("alignment: %.2f" % a)

alignment: 85780.46