You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Free energy code generation should be extended to allow for parameterized factor nodes from custom packages.
In freeEnergySourceCode() the Free energy algorithm is constructed by looping over the average energies and entropies. In energiesSourceCode() the node_code is obtained by the removePrefix() function. Consider the package X with custom node Y of custom type Z. Here removePrefix() is called over the node type X.Y{X.Z}. Since removePrefix() is defined as removePrefix(type::Type) = split(string(type), '.')[end], this function will return Z} instead of the desired X{Z} and therefore the Free energy algorithm will contain an average energy contribution defined as F += averageEnergy(Z}, marginals), causing an error.
Solution: The removePrefix() should be extended to check for custom parameterized nodes.
The text was updated successfully, but these errors were encountered:
The Free energy code generation should be extended to allow for parameterized factor nodes from custom packages.
In
freeEnergySourceCode()
the Free energy algorithm is constructed by looping over the average energies and entropies. InenergiesSourceCode()
thenode_code
is obtained by theremovePrefix()
function. Consider the packageX
with custom nodeY
of custom typeZ
. HereremovePrefix()
is called over the node typeX.Y{X.Z}
. SinceremovePrefix()
is defined asremovePrefix(type::Type) = split(string(type), '.')[end]
, this function will returnZ}
instead of the desiredX{Z}
and therefore the Free energy algorithm will contain an average energy contribution defined asF += averageEnergy(Z}, marginals)
, causing an error.Solution: The
removePrefix()
should be extended to check for custom parameterized nodes.The text was updated successfully, but these errors were encountered: