Conversation
Codecov Report
@@ Coverage Diff @@
## develop #138 +/- ##
========================================
Coverage 87.96% 87.96%
========================================
Files 78 78
Lines 3955 3955
Branches 678 678
========================================
Hits 3479 3479
Misses 308 308
Partials 168 168Continue to review full report at Codecov.
|
| where `Θ` denotes all of the weights and biases collected together. | ||
|
|
||
| ## Rejected Alternatives | ||
|
|
There was a problem hiding this comment.
Is there a reason you can't pass a "targets" list, instead of "ignored"? I think we could then use those targets to only compute log_pdf / draw samples for those variables (and their associated dependencies).
Also it's not really an issue that we define mean-field for all variables in the posterior definition, as long as we ignore unnecessary parts during the computation. This I feel less strongly about as it doesn't change the main API, only the create_gaussian_meanfield helper function.
So in the above, it would look something like:
kwargs = dict(x=x, y0=y, targets=[model.y0])
inference.run(max_iter=max_iter, learning_rate=learning_rate, verbose=False, callback=print_status, **kwargs)And the inference algorithm would figure out the required subgraph to compute those targets automatically. (Just traversing up the FactorGraph.)
There was a problem hiding this comment.
Do you mean "targets" here in the sense of classification targets, or inference targets? If it's the former, then I think that's pretty specific to the supervised learning setting. If it's the latter, then actually I think this is quite reasonable in many cases - to be able to specify which variables are observed and which variables you're interested in, and only perform computations on the subgraph that these represent. Note that this is the model that Infer.NET uses (set observed variables, declare which variables you are interested in marginal posteriors for. Of course, sometimes you are truly interested in the full posterior (e.g. when performing MCMC) and this makes less sense.
Design proposal for "ignored" variables.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.