Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training interface #766

Closed
michaeldeistler opened this issue Nov 2, 2022 · 1 comment · Fixed by #983
Closed

Training interface #766

michaeldeistler opened this issue Nov 2, 2022 · 1 comment · Fixed by #983
Assignees
Labels
architecture Internal changes without API consequences enhancement New feature or request

Comments

@michaeldeistler
Copy link
Contributor

michaeldeistler commented Nov 2, 2022

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
@janfb
Copy link
Contributor

janfb commented Feb 16, 2024

related to #932

@janfb janfb linked a pull request Aug 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Internal changes without API consequences enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants