Hi everyobdy,
I am trying to find a way to include an autoguide
as the guide method in my model class:
class MYMODEL(object):
def __init__(self, ...):
...
def model(self):
...
def guide(self):
pyro.infer.autoguide.AutoNormal(self.model)
mm = MYMODEL(...)
svi = SVI(mm.model, mm.guide, optimizer, loss=Trace_ELBO())
However, this always throws back a warning
UserWarning: Found vars in model but not guide: {'...', '...'}
warnings.warn(f"Found vars in model but not guide: {bad_sites}")
Also, the optimized values after SVI look different. Hence, I guess something is wrong with this approach or it is not intended to use autoguide
like this?
Thanks in advance!