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

Evaluation/context: opt-in abstraction #48

Closed
phipsgabler opened this issue Jan 31, 2022 · 2 comments
Closed

Evaluation/context: opt-in abstraction #48

phipsgabler opened this issue Jan 31, 2022 · 2 comments

Comments

@phipsgabler
Copy link
Member

phipsgabler commented Jan 31, 2022

During @PavanChaggar's work on implementing the simple graph model here, it turned out that we end up with something close to the DynamicPPL.jl approach: a generic evaluator function with context dispatch.

I therefore propose to move AbstractContext and evaluate!! from DynamicPPL.jl here, into a new file evaluation.jl. This would then not become a required part of the AbstractModel interface, but an opt-in abstraction open possibilities for reuse and common terminology.

(The concrete contexts existing in DynamicPPL.jl should IMHO not be moved here, as they use a very specific system to achieve correct, complex nesting, which is not required everywhere. But maybe the leaf contexts could be moved?.)

@PavanChaggar
Copy link
Collaborator

Proposed function signature is to be consistent with DynamicPPL.jl:

function evaluate!!(m::Model, trace::AbstractModelTrace, ctx::AbstractContext)
...
end

Possibly with some extension to allow for empty trace, in which case a new 'empty' trace would be created, e.g. through trace = empty(m). In the case of models using GraphInfo, the first two arguments are containing within the Model. In the first instance, we'll choose to keep the two argument form to remain consistent with DynamicPPL.jl.

@yebai
Copy link
Member

yebai commented Oct 23, 2023

No longer needed.

@yebai yebai closed this as completed Oct 23, 2023
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

3 participants