Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional flag to generate that turns on and off unvisited address check. #335

Open
marcoct opened this issue Nov 18, 2020 · 2 comments

Comments

@marcoct
Copy link
Collaborator

marcoct commented Nov 18, 2020

Generate (and assess) should take an optional Bool argument that determines whether 'not all address visited' errors get raised.

Currently, assess raises this error and generate does not, but the fact that generate does not raise this error is not clearly documented.

There are cases where we need the error to be raised, for defensive programming purposes, and cases where we don't (because we need the flexibility of being able to pass constraints that may include extra addresses in them).

Documentation for semantics of 'generate' without this check can be found on page 143 of my thesis (https://www.mct.dev/assets/mct-thesis.pdf).

@alex-lew
Copy link
Contributor

alex-lew commented Nov 23, 2020

@marcoct Is the intention that every GF should accept 'impossible' constraints for generate, and be able to respect only a subset of them? And also support a version where such constraints raise an error? (It's not obvious to me what the right notion of "unvisited" is, for arbitrary custom GFs, but I haven't looked carefully at the definition in the thesis yet. It'd be great, for the docs, to try to concisely describe the required behavior for a custom GF.)

@marcoct
Copy link
Collaborator Author

marcoct commented Nov 23, 2020

@alex-lew Yes, the requirement that generative functions have densities on choice maps that are 'structured' allows for a precise definition of behavior of generate that allows it to ignore constraints on random choices that it doesn't, informally speaking, "visit".

The internal proposal distribution must only propose choice maps that, when merged with some subset of the constraint choice map, produce a trace with nonzero density according to the generative function.

Relevant parts of my thesis are:

  • Section 2.1 -- Defines structured distributions on choice maps, and a relevant definition of conditional distribution on choice maps that allows for ignoring some constraints (see the second example on page 51).
  • Section 4.1 -- Defines internal proposals, building on Section 2.1

Yes, the docs should definitely describe this content, or at least link to it in the immediate term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants