Skip to content

Free energy code generation using custom parameterized factor nodes #149

Description

@bartvanerp

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions