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

Implement an environment for SPN #54

Closed
fsaad opened this issue Apr 14, 2020 · 4 comments
Closed

Implement an environment for SPN #54

fsaad opened this issue Apr 14, 2020 · 4 comments

Comments

@fsaad
Copy link
Collaborator

fsaad commented Apr 14, 2020

Consider the following SPML program:

X ~ Normal(0, 1);
if X > 0:
    Z := X**3
else:
    Z := 1 + X

probability(Z > 0);

Here, each sub-SPN in the overall mixture induced by if needs to be able to map Z differently.

@fsaad
Copy link
Collaborator Author

fsaad commented Apr 14, 2020

It is not likely to be useful implementing the environment directly in the interpreter, since we would need have to store nested environments induced by nested SPNs. The cleaner solution is to have the SPN manage it's own environment.

@fsaad
Copy link
Collaborator Author

fsaad commented Apr 14, 2020

Naturally, SPML should disallow redefining variables.

@fsaad
Copy link
Collaborator Author

fsaad commented Apr 15, 2020

The new SPN method transform will record the transformed variables in the environment.

@fsaad
Copy link
Collaborator Author

fsaad commented Apr 19, 2020

0e63a63

@fsaad fsaad closed this as completed Apr 19, 2020
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

1 participant