```python class Flow(DensityEstimator): def loss(self, input, condition): return self.log_prob(input, condition=condition) def log_prob(input, condition): return self.net.log_prob(input, condition) class SNLEObjective(Objective): def __call__(net, theta, x): return net.loss(input=x, condition=theta) def train(objective: Objective, net, theta, x, **objective_kwargs): ... loss_val = objective(net=net, theta=theta, x=x, **objective_kwargs) ``` Level 1: General across all methods. Level 2: `Loss` of the method. - SNLE: `net.loss(input=x, condition=theta)` - SNPE: `net.loss(input=theta, condition=x)` - SNRE: `net.loss(theta, x)` Level 3: `.loss` of the density estimator. - Flows: `net.loss` -> `net.log_prob()` - Diffusion: `net.loss` -> `net.....()` Related to #922, #766
Activity