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

Resuming from a state file does not update parameter dimensiom #1159

Closed
jordandouglas opened this issue Aug 5, 2024 · 1 comment
Closed
Labels

Comments

@jordandouglas
Copy link
Member

For example, if the xml file specifies that a parameter has dimension 5, and it has 6 in the state file, then resuming will keep its dimension on 5.

This is a problem for reversible jump MCMC where a parameter dimension can change from operators

The problematic code is here below. It can be fixed by calling this.setDimension(source.getDimension())

@Override
public void assignFromFragile(final StateNode other) {
    @SuppressWarnings("unchecked") final Parameter.Base<T> source = (Parameter.Base<T>) other;
    System.arraycopy(source.values, 0, values, 0, Math.min(values.length, source.getDimension()));
    Arrays.fill(m_bIsDirty, false);
}

https://github.com/CompEvol/beast2/blob/master/src/beast/base/inference/parameter/Parameter.java

@jordandouglas
Copy link
Member Author

Fixed with commit

3916ce5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant