Skip to content

Inconsistent output shapes of SIR and Lotka-Volterra simulators #518

@vpratz

Description

@vpratz

The time-series benchmark simulators currently produce different output shapes, I think we should unify this to always produce shape (batch_size, n_timesteps, 1), which is what the summary networks expect. It looks like the problem occurs due to the subsampling functionality. Labeling this as a bug as I suppose it is not intended behavior.

Code to reproduce:

import bayesflow as bf
import keras

keras.tree.map_structure(keras.ops.shape, bf.simulators.SIR().sample(2))
# {'parameters': (2, 2), 'observables': (2, 160, 1)}
keras.tree.map_structure(keras.ops.shape, bf.simulators.SIR(subsample=10).sample(2))
# {'parameters': (2, 2), 'observables': (2, 10)}
keras.tree.map_structure(keras.ops.shape, bf.simulators.LotkaVolterra().sample(2))
# {'parameters': (2, 4), 'observables': (2, 20)}

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions