Search in sources :

Example 1 with SumDerivative

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

the class SumDerivativeParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    List<GradientWrtParameterProvider> derivativeList = new ArrayList<GradientWrtParameterProvider>();
    for (int i = 0; i < xo.getChildCount(); i++) {
        GradientWrtParameterProvider grad = (GradientWrtParameterProvider) xo.getChild(i);
        derivativeList.add(grad);
    }
    return new SumDerivative(derivativeList);
}
Also used : ArrayList(java.util.ArrayList) GradientWrtParameterProvider(dr.inference.hmc.GradientWrtParameterProvider) SumDerivative(dr.inference.hmc.SumDerivative)

Aggregations

GradientWrtParameterProvider (dr.inference.hmc.GradientWrtParameterProvider)1 SumDerivative (dr.inference.hmc.SumDerivative)1 ArrayList (java.util.ArrayList)1