use of dr.inference.hmc.MaskedGradient 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);
}
Aggregations