Closed patel-zeel closed 2 years ago
Yeah, this looks better. However can you please explain what exact role @parametrised
plays here and how it gets related with vs
?
@parametrised
def model(vs, noise: Positive = 0.1, length_scale: Positive = 1):
"""Constuct a model with learnable parameters."""
return GP(EQ().stretch(length_scale)), noise
is equivalent to
def model(vs):
"""Constuct a model with learnable parameters."""
noise = vs.positive(0.1, name="noise")
length_scale = vs.positive(1, name="length_scale")
return GP(EQ().stretch(length_scale)), noise
This conversion is performed by @parametrised
. I'm happy to go with either version! I agree that using @parametrised
may be a little bit too much syntactic sugar.
Yes, I agree. Given that the examples in README help newcomers the most, explicit is better than implicit. @parametrised
function can be kept as a comment just below the simple function.
Perfect. Let's go with the more explicit version then. (I think CI is failing because it's currently behind master
, which incorporates some missing dependencies.)
I lost this fork so reopening this PR at #18.
Thanks for this example! This looks great. How would you feel about the following simplification of the code, which removes some unused components?