Skip to content

Conversation

@nMaax
Copy link
Owner

@nMaax nMaax commented Jul 4, 2025

Generally, each Masked version of other objects are provided exacly below their counterpart in the same python file, e.g. MaskedConditionalVectorFieldEstimator is exactly below the code block of ConditionalVectorFieldEstimator

Furthermore, regarding the automatic generation of condition masks and edge masks, (i.e., a bernoulli mask and a full ones respectively), it is only done in the loss() function of MaskedConditionalScoreEstimator, for the remaining methods of the Masked*-interface, they should always expect them as non-optional parameters, already in a "batched" shape (i.e., 3 dimensional input tensors: B, T, F) --- while the same loss() function is still able to accept "un-batched" tensors (i.e., 2 dimensions inputs only: T, F), adapt them, and send them in the appropriate shape to the other methods used


Files I modified should be the following:

sbi/analysis
sbi/analysis/plots.py # Added .cpu() in return t.cpu().numpy() in ensure_numpy()

sbi/inference
sbi/inference/trainers/base.py # MaskedNeuralInference(ABC)
sbi/inference/trainers/vfpe/base_vf_inference.py # MaskedVectorFiedlEstimatorBuilder(Protocol), MaskedVectorFieldInference(MaskedNeuralInference)
sbi/inference/trainers/vfpe/simformer.py # New file, Simformer(MaskedVectorFieldInference)

sbi/neural_nets
sbi/neural_nets/factory.py # simformer_nn
sbi/neural_nets/estimators/base.py # MaskedConditionalEstimator, MaskedConditionalVectorFieldEstimator(MaskedConditionalEstimator)
sbi/neural_nets/estimators/score_estimator.py # MaskedConditionalScoreEstimator(MaskedConditionalVectorFieldEstimator), comments just above ConditionalScoreEstimator, MaskedVEScoreEstimator(MaskedConditionalScoreEstimator)
sbi/neural_nets/net_builders/vector_field_nets.py # build_vector_field_estimator accepts simformer and masked-score, MaskedSimformerBlock (rename! in MaskedTimeAdditiveBlock), MaskedDiTBlock, SimformerNet(MaskedVectorFieldNet), build_simformer_network(choose default parameters here)

sbi/utils
sbi/utils/vector_field_utils.py # MaskedVectorFieldNet


The remaining files listed here can be ignored as they were my attempt to develop a joint-distribution object/pipeline (I will properly ignore them when I will apply the official commits for the future PR)

  • sbi/inference/joints/* # New files
  • sbi/inference/potentials/base_potential.py # Defined MaskedBasePotential, CustomMaskedPotential(Protocol), CustomMaskedPotentialWrapper(MaskedBasePotential)
  • sbi/inference/potentials/joint_based_potential.py # Same as joint distribution above
  • sbi/inference/potentials/vector_field_potential.py # Defined masked_vector_field_estimator_based_potential and MaskedVectorFieldBasedPotential
  • sbi/samplers/ode_solvers/base.py # MaskedNeuralODEFunc(Protocol), MaskedNeuralODE(LazyDistribution), MaskedZukoNeuralODE(MaskedNeuralODE), comment in Diffuser
  • sbi/utils/torchutils.py # ensure_latent_batch

nMaax added 30 commits June 2, 2025 12:10
…-catch blocks for debugging, minor adjustments
nMaax added 28 commits July 9, 2025 14:10
…sion in sample batched again, everything still works
@nMaax nMaax closed this Aug 22, 2025
@nMaax nMaax mentioned this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants