Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for main interface #86

Open
willwerscheid opened this issue Sep 23, 2018 · 2 comments
Open

Suggestion for main interface #86

willwerscheid opened this issue Sep 23, 2018 · 2 comments

Comments

@willwerscheid
Copy link
Member

It would be nice if we had something like a method option with useful combinations of ebnm_fn, ebnm_param, and init_fn. For example, "fast" could be the usual ebnm_pn. "Nonnegative" could give a nonnegative MF, and we could also have "nonneg_loadings" and "nonneg_factors" (which I've been using quite a bit). As we find new uses for flash, we could add to this list. I am thinking of the method parameter in ashr which has a similar purpose.

@willwerscheid
Copy link
Member Author

As a long-term goal, it would be nice to have a single flash function. flash_greedy and flash_backfit are already redundant. We can return a sampler function with the flash object and eliminate flash_sampler. We can add S as a parameter to flash and eliminate flash_set_data. We could add parameters FF_init and LL_init with some way to indicate which elements are fixed, and get rid of flash_add_fixed_factors, flash_add_fixed_loadings, and flash_add_factors_from_data. To do this, we need to decide whether it's better to add greedy before fixed or fixed before greedy (this is not an easy problem). flash_fill is a trivial function and does not need to be exported. Finally, flash_zero_out_factor is sort of useful as a utility but is probably best filed alongside other utilities for experienced flash users (that is, not exported).

@willwerscheid
Copy link
Member Author

My ideal interface would be something like
flash(Y, S = NULL, var_type = c(...), method = c(...), flash_init = NULL, LL_init = NULL, FF_init = NULL, greedy_Kmax = 100, greedy_maxiter = 500, backfit_maxiter = 0, nullcheck = TRUE, verbose = TRUE, custom_params = list())
where LL_init is either a matrix or a list with one matrix specifying LL and one specifying fixl, and custom_params is a list that can include init_fn, ebnm_fn, ebnm_param, stopping_rule, tol, and verbose_output (which override the method-specific defaults)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant