alan-ppl / alan_old

1 stars 0 forks source link

Covariates and predictive log likelihoods. #7

Closed ThomasHeap closed 1 year ago

ThomasHeap commented 1 year ago

How should covariates work with pred lls? Presumably we want to do something similar to .sample where we can pass inputs, but we need to call self.dims_data_inputs on the covariates first to ensure they have the right dims. The issue is that that the platedims we already have will be the size of the train set not trainset + testset like the latents in trace pred will be. We are doing the named to torchdim mapping in two places with two different sizes.

https://github.com/alan-ppl/alan/blob/44c5546778baee599adcd2e307fa8d95e7f97d49/alan/model.py#L106

ThomasHeap commented 1 year ago

A quick solution to this would be accepting the covariates into trace_pred to have the name to dim mapping happen there and then grabbing tr.covariates_all

See: https://github.com/alan-ppl/alan/blob/822313fd61c6d91e033794e5c69fdc18560a658b/alan/model.py#L110-L111

LaurenceA commented 1 year ago

Is this still an issue on the laurence branch?

ThomasHeap commented 1 year ago

This is fixed now.