Combined Evaluation and Split Access of Functions


[Up] [Top]

Documentation for package ‘splitfngr’ version 0.1.1

Help Pages

fngr Access a list of values separately but calculate them together. This function generalizes grad_share for any number of functions.
grad_share Calculate function and gradient together but access separately. Reduces computation since they share data in calculation. Doesn't have to be function and gradient, can be any two values calculated together but accessed separately. Useful in optimization when function evaluation is expensive since the chain rule means many parts of function and gradient are the same.
lbfgs_share Use lbfgs packages's lbfgs function but pass in a single function that returns both the function and gradient together in a list. Useful when the function and gradient are expensive to calculate and can be calculated faster together than separate.
make_share Convert a function from multiple function arguments to a single function
optim_share Use R's optim function but pass in a single function that returns both the function and gradient together in a list. Useful when the function and gradient are expensive to calculate and can be calculated faster together than separate.