sgd icon indicating copy to clipboard operation
sgd copied to clipboard

Allow user to specify generic loss function to do SGD on

Open dustinvtran opened this issue 9 years ago • 2 comments

This cannot be efficiently implemented in Rcpp. Rcpp cannot interface with the R function in any way other than calling it in R each time. Hence for now, we are using strings to match models specified by the user, which allows for faster computation using C++ functions. Later on, we will extend this where some model argument in SGD can either be a string (uses C++ function on case-by-case basis) or a generic function (uses R function).

dustinvtran avatar Apr 22 '15 00:04 dustinvtran

Look into how optim() and gmm() do this, since they're quite fast but also allow users to specify a generic function.

dustinvtran avatar Apr 23 '15 01:04 dustinvtran

The optim() and lapply() in the built in r core package evaluates the user defined functions in R by calling the function in R. For now, we can also call the function in R with sacrifice in performance.

lantian2012 avatar Apr 23 '15 04:04 lantian2012