You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good practice for method overrides in Python would be that an inheriting method has exactly the same parameters as the method in the superclass it inherits from and all additional parameters are optional (have a default value). We're violating this by having:
This may actually be an easy fix of just introducing the default value None.
1.1. methods which are missing parameters of their superclass but have others instead (this is by far the most common problem)
SNPE-A is an example where this is happening. After reordering parameters, we see that PosteriorEstimator of snpe_base has the parameters force_first_round_loss and discard_prior_samples which SNPE-A doesn't implement. The additional optional parameters component_perturbation and final_round alone would be fine, so this is really a variant of 1.
sbi/inference/snpe/snpe_a.py:97:9 - error: Method "train" overrides class "PosteriorEstimator" in an incompatible manner
Parameter 10 name mismatch: base parameter is named "force_first_round_loss", override parameter is named "component_perturbation"
Parameter 11 name mismatch: base parameter is named "discard_prior_samples", override parameter is named "final_round" (reportIncompatibleMethodOverride)
Good practice for method overrides in Python would be that an inheriting method has exactly the same parameters as the method in the superclass it inherits from and all additional parameters are optional (have a default value). We're violating this by having:
1. methods which are missing parameters
e.g. SNPE-B's
_log_prob_proposal_posterior
sbi/sbi/inference/snpe/snpe_b.py
Lines 42 to 44 in db91f59
is missing the
proposal
of its base methodsbi/sbi/inference/snpe/snpe_base.py
Lines 553 to 558 in db91f59
This may actually be an easy fix of just introducing the default value
None
.1.1. methods which are missing parameters of their superclass but have others instead (this is by far the most common problem)
SNPE-A is an example where this is happening. After reordering parameters, we see that
PosteriorEstimator
ofsnpe_base
has the parametersforce_first_round_loss
anddiscard_prior_samples
which SNPE-A doesn't implement. The additional optional parameterscomponent_perturbation
andfinal_round
alone would be fine, so this is really a variant of 1.sbi/sbi/inference/snpe/snpe_base.py
Lines 204 to 219 in db91f59
sbi/sbi/inference/snpe/snpe_a.py
Lines 97 to 112 in db91f59
The text was updated successfully, but these errors were encountered: