I am training an sbi algorithm to infer neuron parameters from simulation results. However, some parameter choices result in nonsensical non biological membrane potentials being generated. When training an autoencoder to provide a summary representation of these membrane potentials, I'm considering "removing" signals that have an excessive spike rate or highly discontinuous membrane trace (beyond what is biologically reasonable). Should I simply remove these samples from the training set, or should I give all such samples the same unphysical reconstruction target (or better yet, say a latent space of 0, 0, etc.)?
By giving them a common reconstruction target, this would incentivise finding a common latent space representation for all unphysical traces, allowing the sbi algorithm to safely distinguish between meaningful and unmeaningful traces during training. This could lead to more clearly defined posteriors, since during SNPE I may be forced to draw parameters from the proposal which lead to unphysical outcomes. This way the model knows how to interpret such situations. An issue with this approach is that the latent space is a 128 dimensional vector of continuous scalar values, so embeddings of physical simulation states with embeddings near the 0, 0, 0 vector may be incorrectly interpreted by the sbi process. Enforcing such a latent state for nonphysical traces would effectively introduce a discontinuity into the latent space.
Alternatively I could also simply remove the bad traces from the training set. However, this would lead to the autoenocder performing unpredictably with these unphysical traces when they appear during sbi, which could lead to the latent space mimicking that of a physical parameterisation. This could then confuse the normalising flow.
Ideally I would want to also exclude the erronuous samples from the sbi process, but I am unsure if this can be done, as it would also change the prior / proposal distribution from which that rounds parameters are drawn. This would in turn change the weighting each sample should be given in the loss function in a non trivial way. If the proposal distribution is not adjusted accordingly to account for this rejection of certain samples the loss may correctly determine the true shape of the posterior. Perhaps I could just train the autoencoder on only physical results, and then if during sbi a sample turns out to be nonphysical, I can simply input to the sbi algorithm a custom e.g. all zero latent space vector instead of the true but meaningless latent embedding? However, this still introduces discontinuity into the latent space observed by the sbi process.
What approaches do you recommend in this scenario to provide the best autoencoder - sbi pipeline