Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free energy code generation using custom parameterized factor nodes #149

Closed
bartvanerp opened this issue Jan 28, 2021 · 0 comments · Fixed by #150
Closed

Free energy code generation using custom parameterized factor nodes #149

bartvanerp opened this issue Jan 28, 2021 · 0 comments · Fixed by #150

Comments

@bartvanerp
Copy link
Member

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.

@bartvanerp bartvanerp linked a pull request Jan 28, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant