Skip to content

Changing prior mean after model is trained #1219

Answered by saitcakmak
kentwar asked this question in Q&A
Discussion options

You must be logged in to vote

You could technically delete it with

mem_cache = model.prediction_strategy.__dict__["_memoize_cache"]
mean_cache_key = list(mem_cache.keys())[0]
del mem_cache[mean_cache_key]

but it won't work since mean_cache will be re-generated from other cached values, such as model.prediction_strategy.train_prior_dist. You could delete that as well, but then you'd have to replace it, otherwise you'll get an error. You can give it a try and see if it speeds things up.

In general, I am a bit suspicious of the idea of training the covar_module along with the mean_module then swapping out the mean_module with something else. Wouldn't it be better to set a custom mean_module from the start (e.g., fix it …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kentwar
Comment options

@saitcakmak
Comment options

Answer selected by saitcakmak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants