use of dr.inference.operators.hmc.ReversibleZigZagOperator in project beast-mcmc by beast-dev.
the class ZigZagOperatorParser method parseXMLObject.
@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
GradientWrtParameterProvider derivative = (GradientWrtParameterProvider) xo.getChild(GradientWrtParameterProvider.class);
PrecisionMatrixVectorProductProvider productProvider = (PrecisionMatrixVectorProductProvider) xo.getChild(PrecisionMatrixVectorProductProvider.class);
PrecisionColumnProvider columnProvider = (PrecisionColumnProvider) xo.getChild(PrecisionColumnProvider.class);
Parameter mask = parseMask(xo);
AbstractParticleOperator.Options runtimeOptions = parseRuntimeOptions(xo);
int threadCount = xo.getAttribute(THREAD_COUNT, 1);
boolean reversible = xo.getAttribute(REVERSIBLE_FLG, true);
if (reversible) {
return new ReversibleZigZagOperator(derivative, productProvider, columnProvider, weight, runtimeOptions, mask, threadCount);
} else {
return new IrreversibleZigZagOperator(derivative, productProvider, columnProvider, weight, runtimeOptions, mask, threadCount);
}
}
Aggregations