Skip to content

Training interface #766

Closed
Closed

Description

@michaeldeistler

In order to give more flexibility, we could expose the entire training loop to the user:

from sbi.inference import nre_loss, ratio_estimator_based_potential, MCMCPosterior

net = classifier_nn("mdn")

data_loader = ...
for e in range(epochs):
    optim.zero_grad()
    loss = nre_loss(net, theta, x)
    loss.backward()
    optim.step()

potential = ratio_estimator_based_potential(net, prior, x_o)
posterior = MCMCPosterior(potential, proposal=prior)

This would require two things:

  • a good way to deal with z-scoring
  • separating the loss functions from the rest

Activity

  1. added
    enhancement
    architecture
    on Nov 2, 2022
  2. added this to the Pre Hackathon 2024 milestone on Feb 6, 2024
  3. janfb commented on Feb 16, 2024

    @janfb
    Contributor

    related to #932

  4. linked a pull request that will close this issueAdd tutorial for training interface #983on Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

architectureenhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions