Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Design proposals/ignored variables#138

Open
tdiethe wants to merge 4 commits intoamzn:developfrom
tdiethe:design_proposals/ignored_variables
Open

Design proposals/ignored variables#138
tdiethe wants to merge 4 commits intoamzn:developfrom
tdiethe:design_proposals/ignored_variables

Conversation

@tdiethe
Copy link
Copy Markdown
Contributor

@tdiethe tdiethe commented Nov 26, 2018

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.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Nov 27, 2018

Codecov Report

Merging #138 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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      168

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ae3fa0...109d05a. Read the comment docs.

where `Θ` denotes all of the weights and biases collected together.

## Rejected Alternatives

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants