Open SaltedfishLZX opened 12 months ago
Hi @SaltedfishLZX , mc dropout and predict_likelihood_parameters shouldn't be used together.
likelihood
to train your model, then the model learns to predict the likelihood parameters based on some input. Monte carlo dropout will not be used during training. predict_likelihood_parameters
will then return the predicted distribution/parameters. These are deterministic.
You can also set predict_likelihood_parameters=False
and num_sample >> 1
to generate probabilstic samples. Then you can calculate the distribution parameters from the sampled prediction (e.g. with quantiles, mean, std, etc.).likelihood
. It can be a deterministic model that was trained using a loss_fn
. When predicting with mc_dropout
, we use monte carlo sampling to generate probabilistic samples. If you train the model using a likelihood
instead, you should set predict_likelihood_parameters=False
, mc_dropout=True
and num_samples >> 1
to generate the samples. Later you could caluclate the distribution parameters from the sampled prediction (e.g. with quantiles, mean, std, etc.)Hope this helps
Hi @SaltedfishLZX , mc dropout and predict_likelihood_parameters shouldn't be used together.
- if you use a
likelihood
to train your model, then the model learns to predict the likelihood parameters based on some input. Monte carlo dropout will not be used during training.predict_likelihood_parameters
will then return the predicted distribution/parameters. These are deterministic. You can also setpredict_likelihood_parameters=False
andnum_sample >> 1
to generate probabilstic samples. Then you can calculate the distribution parameters from the sampled prediction (e.g. with quantiles, mean, std, etc.).- For the Monte Carlo dropout, your model does not have to be trained using a
likelihood
. It can be a deterministic model that was trained using aloss_fn
. When predicting withmc_dropout
, we use monte carlo sampling to generate probabilistic samples. If you train the model using alikelihood
instead, you should setpredict_likelihood_parameters=False
,mc_dropout=True
andnum_samples >> 1
to generate the samples. Later you could caluclate the distribution parameters from the sampled prediction (e.g. with quantiles, mean, std, etc.)Hope this helps
Thanks for your response @dennisbader. My idea is based on the User Guide: Capturing model uncertainty using Monte Carlo Dropout. It mentions that "Monte Carlo Dropout can be combined with other likelihood estimations in Darts, which can be interpreted as a way to capture both epistemic and aleatoric uncertainty."
Therefore, I am considering the possibility of using MC dropout with likelihood. Given that MC dropout with a deterministic model effectively captures model uncertainty, incorporating MC dropout with a likelihood model appears to be a more comprehensive approach for capturing both epistemic and aleatoric uncertainty. It just likes that we utilize MC dropout to obtain the distribution of a distribution (mean, std), and the distribution of the mean may correspond to the epistemic uncertainty.
Could you confirm if my understanding is correct? I would appreciate your guidance on implementing the approach outlined in the User Guide.
- if you use a
likelihood
to train your model, then the model learns to predict the likelihood parameters based on some input. Monte carlo dropout will not be used during training.
As for training likelihood
, I came across an example of TFT setting dropout=0.1
and likelihood=QuantileRegression
. It appears that the use of MC dropout for training does not conflict with learning the likelihood, since it is just a way of regularization during training.
In any case, I believe we need to clarify the usage scenarios for MC dropout and the sampling method.
Hi, thanks for the prompt response regarding issue #2097 . I'm now able to utilize
mc_dropout
inhistorical_forecasts
.My current objective is to incorporate
mc_dropout
for obtaining epistemic uncertainty andpredict_likelihood_parameters
for acquiring aleatoric uncertainty. However, when settingpredict_likelihood_parameters
toTrue
, I encounter an issue where I'm unable to use the sample method. Consequently, I'm limited to obtaining only one result with each call tohistorical_forecasts
withpredict_likelihood_parameters=True
andmc_dropout=True
.I suspect that the solution might involve distinguishing the sample generation process by using mc_dropout and sample generation process based on the fitted distribution. Now they are using the same
num_samples
parameter.