I am using BayesFlow for the first time, and having some issues doing offline training with a summary network (everything works fine if I exclude it and just supply the data to the inference network). Basically, I am simulating from an agent-based model in R, and then bringing the data (13 parameters and 1921 output features) into Python so that it has the format required by BayesFlow.
#define function that configures the input for the amortizer
def configure_input(forward_dict):
#prepare placeholder dict
out_dict = {}
#add to keys
out_dict["parameters"] = forward_dict["prior_draws"].astype(np.float32)
out_dict["summary_conditions"] = forward_dict["sim_data"].astype(np.float32)
out_dict["direct_conditions"] = None
#return the output dictionary
return out_dict
ValueError: Exception encountered when calling layer 'sequential_549' (type Sequential).
Input 0 of layer "dense_1530" is incompatible with the layer: expected min_ndim=2, found ndim=1. Full shape received: (64,)
Call arguments received by layer 'sequential_549' (type Sequential):
• inputs=tf.Tensor(shape=(64,), dtype=float32)
• training=True
• mask=None
Hello!
I am using BayesFlow for the first time, and having some issues doing offline training with a summary network (everything works fine if I exclude it and just supply the data to the inference network). Basically, I am simulating from an agent-based model in R, and then bringing the data (13 parameters and 1921 output features) into Python so that it has the format required by BayesFlow.
Here is my
configure input
script:Then, if I run the following code:
I get the following error:
Do you know what the issue might be?