You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a good way to execute SPPL model source code while having it rely on a previously existing model? For example, assume I have an SPPL model m (of type ProductSPE) which models variables a and b.
I have this source code source in form of a string:
if a < 17
c ~= bernoulli(p=0.1)
else:
c ~= bernoulli(p=0.9)
which relies on a being defined but which would otherwise compile fine if I run:
SPPL_Compiler(source).execute_module().model
Obviously, without knowing about m it won't compile because the compiler doesn't know about a. Is there a good way to tell the compiler about a model (like m) as a starting point? i.e. something like this:
SPPL_Compiler(m, source).execute_module().model
The text was updated successfully, but these errors were encountered:
Try to use the reverse compiler from the compiled SPE m to an SPPL program source with equivalent semantics and then append it to the original program. Below is a sketch
m= ...
fromsppl.compilersimportspe_to_spplsource_m=spe_to_sppl(m) # return type is io.StringIOsource_m_str=source_m.getvalue()
source_joint='%s\n\n%s'% (source_m_str, source)
model=SPPL_compiler(source_joint).execute_module().model
Is there a good way to execute SPPL model source code while having it rely on a previously existing model? For example, assume I have an SPPL model
m
(of type ProductSPE) which models variablesa
andb
.I have this source code source in form of a string:
which relies on
a
being defined but which would otherwise compile fine if I run:Obviously, without knowing about
m
it won't compile because the compiler doesn't know abouta
. Is there a good way to tell the compiler about a model (likem
) as a starting point? i.e. something like this:The text was updated successfully, but these errors were encountered: