Search in sources :

Example 16 with GradientWrtParameterProvider

use of dr.inference.hmc.GradientWrtParameterProvider in project beast-mcmc by beast-dev.

the class MaskedGradientParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    GradientWrtParameterProvider gradient = (GradientWrtParameterProvider) xo.getChild(GradientWrtParameterProvider.class);
    Parameter mask = (Parameter) xo.getElementFirstChild(MaskedParameterParser.MASKING);
    if (gradient.getDimension() != mask.getDimension()) {
        throw new XMLParseException("Unmatched dimensions");
    }
    return new MaskedGradient(gradient, mask);
}
Also used : GradientWrtParameterProvider(dr.inference.hmc.GradientWrtParameterProvider) Parameter(dr.inference.model.Parameter) MaskedGradient(dr.inference.hmc.MaskedGradient)

Aggregations

GradientWrtParameterProvider (dr.inference.hmc.GradientWrtParameterProvider)16 ArrayList (java.util.ArrayList)6 Parameter (dr.inference.model.Parameter)4 TreeDataLikelihood (dr.evomodel.treedatalikelihood.TreeDataLikelihood)3 SumDerivative (dr.inference.hmc.SumDerivative)3 Likelihood (dr.inference.model.Likelihood)3 Tree (dr.evolution.tree.Tree)2 DistributionLikelihood (dr.inference.distribution.DistributionLikelihood)2 MultivariateDistributionLikelihood (dr.inference.distribution.MultivariateDistributionLikelihood)2 CompoundDerivative (dr.inference.hmc.CompoundDerivative)2 CompoundGradient (dr.inference.hmc.CompoundGradient)2 CompoundLikelihood (dr.inference.model.CompoundLikelihood)2 Transform (dr.util.Transform)2 AutoCorrelatedGradientWrtIncrements (dr.evomodel.branchratemodel.AutoCorrelatedGradientWrtIncrements)1 BranchRateGradientWrtIncrements (dr.evomodel.branchratemodel.BranchRateGradientWrtIncrements)1 DataLikelihoodDelegate (dr.evomodel.treedatalikelihood.DataLikelihoodDelegate)1 BranchRateGradient (dr.evomodel.treedatalikelihood.continuous.BranchRateGradient)1 BranchSpecificGradient (dr.evomodel.treedatalikelihood.continuous.BranchSpecificGradient)1 ContinuousDataLikelihoodDelegate (dr.evomodel.treedatalikelihood.continuous.ContinuousDataLikelihoodDelegate)1 ContinuousTraitGradientForBranch (dr.evomodel.treedatalikelihood.continuous.ContinuousTraitGradientForBranch)1