Search in sources :

Example 1 with PrecisionMatrixVectorProductProvider

use of dr.inference.hmc.PrecisionMatrixVectorProductProvider 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);
    }
}
Also used : PrecisionColumnProvider(dr.inference.hmc.PrecisionColumnProvider) GradientWrtParameterProvider(dr.inference.hmc.GradientWrtParameterProvider) Parameter(dr.inference.model.Parameter) ReversibleZigZagOperator(dr.inference.operators.hmc.ReversibleZigZagOperator) PrecisionMatrixVectorProductProvider(dr.inference.hmc.PrecisionMatrixVectorProductProvider) AbstractParticleOperator(dr.inference.operators.hmc.AbstractParticleOperator) IrreversibleZigZagOperator(dr.inference.operators.hmc.IrreversibleZigZagOperator)

Aggregations

GradientWrtParameterProvider (dr.inference.hmc.GradientWrtParameterProvider)1 PrecisionColumnProvider (dr.inference.hmc.PrecisionColumnProvider)1 PrecisionMatrixVectorProductProvider (dr.inference.hmc.PrecisionMatrixVectorProductProvider)1 Parameter (dr.inference.model.Parameter)1 AbstractParticleOperator (dr.inference.operators.hmc.AbstractParticleOperator)1 IrreversibleZigZagOperator (dr.inference.operators.hmc.IrreversibleZigZagOperator)1 ReversibleZigZagOperator (dr.inference.operators.hmc.ReversibleZigZagOperator)1