edu.stanford.rsl.jpop
Class AdditiveFunctionAssembler
- java.lang.Object
-
- edu.stanford.rsl.jpop.AdditiveFunctionAssembler
-
- All Implemented Interfaces:
- FunctionAssembler
public class AdditiveFunctionAssembler extends java.lang.Object implements FunctionAssembler
Implements an additive FunctionAssembler meaning that it computes the sum element by element of each block result. This FunctionAssembler can be used as an example for alternative FunctionAssembler implementations.
-
-
Constructor Summary
Constructors Constructor and Description AdditiveFunctionAssembler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleassembleEvaluationBlocks(double[] blockResults)This method is provided with an array of block results and assembles them into a single function evaluation result.double[]assembleGradientBlocks(double[][] blockResults)This method is provided with an array of gradients which were obtained by the different processing blocks.double[][]assembleHessianBlocks(double[][][] blockResults)This method is provided with an array of hessians as computed fron the parallel procesing blocks.
-
-
-
Method Detail
-
assembleEvaluationBlocks
public double assembleEvaluationBlocks(double[] blockResults)
Description copied from interface:FunctionAssemblerThis method is provided with an array of block results and assembles them into a single function evaluation result.- Specified by:
assembleEvaluationBlocksin interfaceFunctionAssembler- Parameters:
blockResults- the results of the processing blocks.- Returns:
- the evaluation result
-
assembleGradientBlocks
public double[] assembleGradientBlocks(double[][] blockResults)
Description copied from interface:FunctionAssemblerThis method is provided with an array of gradients which were obtained by the different processing blocks. The methods assembles the data into a single gradient vector. The first index of the gradient array is supposed to refer to the block number.- Specified by:
assembleGradientBlocksin interfaceFunctionAssembler- Parameters:
blockResults- the block results- Returns:
- the assembled gradient vector
-
assembleHessianBlocks
public double[][] assembleHessianBlocks(double[][][] blockResults)
Description copied from interface:FunctionAssemblerThis method is provided with an array of hessians as computed fron the parallel procesing blocks. The first index of the array should refer to the block index.- Specified by:
assembleHessianBlocksin interfaceFunctionAssembler- Parameters:
blockResults- the block results.- Returns:
- the assembled Hessian.
-
-
DMelt 3.0 © DataMelt by jWork.ORG