-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Labels
featureNew feature or requestNew feature or request
Description
Say you have a setup like this:
def context(batch_size):
n = np.random.randint(10,100)
return dict(n=n)
def prior():
mu = np.random.normal(0,1)
return dict(mu=mu)
def likelihood(mu, n):
y = np.random.normal(mu,1,n)
return dict(y=y)
simulator = bf.make_simulator([prior, likelihood], meta_fn=context)Sometimes (e.g., during validation), it would be handy to generate a batch of data with something not according to the simulator specification, e.g., generate data with fixed context:
simulator.sample(1000, fixed=dict(n=50))Of course one could make a separate simulator to do this, but that is at times a bit cumbersome and leads to code duplication. Looking at the code it should be relatively straightforward to implement this, I am curious to hear if there are any downsides, @stefanradev93, @LarsKue, @paul-buerkner?
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request