LLNL / MuyGPyS

A fast, pure python implementation of the MuyGPs Gaussian process realization and training algorithm.
Other
25 stars 11 forks source link

optimization functions need an elegant copy method for creating the returned model #105

Closed bwpriest closed 1 year ago

bwpriest commented 1 year ago

We are currently using deepcopy, which is unnecessarily heavy (especially once we start using heteroscedastic noise). What we need is a copy method that does something like

def copy_model(model: MuyGPS) -> MuyGPS:
    ret = MuyGPS()
    # for all fixed parameters of model, set ret's corresponding references to those objects (no copying)
    # for all free parameters of model, copy ret's corresponding members to those objects (copying)
alecmdunton commented 1 year ago

Are we going to pursue this approach still or go with the other optimization model where we just write over the input MuyGPS model?

bwpriest commented 1 year ago

I think we agreed to overwrite the model. We don't need to address this for the current release, though.

bwpriest commented 1 year ago

This is mostly addressed by v0.7.0, although we might improve on this later.