memilio.surrogatemodel.ode_secir_groups.network_architectures

Functions

cnn_multi_input_multi_output(label_width[, ...])

CNN Network which uses multiple time steps as input and returns the compartments for multiple age groups and time steps in the future.

lstm_multi_input_multi_output(label_width[, ...])

LSTM Network which uses multiple time steps as input and returns the compartments for multiple age groups and time steps in the future.

mlp_multi_input_multi_output(label_width[, ...])

Simple MLP Network which takes the compartments for multiple time steps as input and returns the compartments for multiple time step.

mlp_multi_input_single_output([...])

Simple MLP Network which takes the compartments for multiple time steps as input and returns the compartments for one single time step for all age groups.

memilio.surrogatemodel.ode_secir_groups.network_architectures.cnn_multi_input_multi_output(
label_width,
num_age_groups=6,
num_outputs=8,
conv_size=3,
num_filters=256,
num_hidden_layers=1,
num_neurons_per_layer=256,
activation='relu',
)

CNN Network which uses multiple time steps as input and returns the compartments for multiple age groups and time steps in the future.

The parameter conv_size describes the kernel_size of the 1d Conv layer. We also use the parameter in combination with a lambda layer to transform the input to shape [batch, CONV_WIDTH, features].

Parameters:
  • label_width – Number of time steps in the output.

  • num_age_groups – Number of age groups in the population.

  • num_outputs – Default: 8 Number of compartments. Default value is reached when aggregating the confirmed compartments.

  • conv_size – Default: 3 Convolution kernel width which is 3 per default.

  • num_filters – Number of different filters used in the Conv1D-Layer

  • num_hidden_layers – Number of layers in the dense network following the convolution layer

  • num_neurons_per_layer – Number of neurons in each of the hidden layers (except the output layer)

  • activation – activation function used in the hidden MLP-layers.

Returns:

Tensorflow keras CNN model with given architecture

memilio.surrogatemodel.ode_secir_groups.network_architectures.lstm_multi_input_multi_output(
label_width,
num_age_groups=6,
num_outputs=8,
internal_dimension=32,
num_hidden_layers=1,
num_neurons_per_layer=32,
activation='relu',
)

LSTM Network which uses multiple time steps as input and returns the compartments for multiple age groups and time steps in the future.

Parameters:
  • label_width – Number of time steps in the output.

  • num_age_groups – Number of age groups in the population, default 6.

  • num_outputs – Default: 8 Number of compartments. Default value is reached when aggregating the confirmed compartments.

  • internal_dimension – Output dimension of the LSTM-layer.

  • num_hidden_layers – Number of hidden layers in the dense network

  • num_neurons_per_layer – Number of neurons per hidden layer

  • activation – Name of the used activation function

Retruns:

Tensorflow keras LSTM model with given architecture

memilio.surrogatemodel.ode_secir_groups.network_architectures.mlp_multi_input_multi_output(
label_width,
num_age_groups=6,
num_outputs=8,
num_hidden_layers=3,
num_neurons_per_layer=32,
activation='relu',
)

Simple MLP Network which takes the compartments for multiple time steps as input and returns the compartments for multiple time step.

Reshaping adds an extra dimension to the output, so the shape of the output is label_widthx(num_age_groups*num_outputs). This makes the shape comparable to that of the multi-output models.

Parameters:
  • label_width – Number of time steps in the output.

  • num_age_groups – Number of age groups in the population, default 6.

  • num_outputs – Default: 8 Number of compartments. Default value is reached when aggregating the confirmed compartments.

  • num_hidden_layers – Number of hidden dense layers in the MLP architecture

  • num_neurons_per_layer – Number of neurons per hidden layer

  • activation – name of the used activation function

Returns:

MLP network with given architecture

memilio.surrogatemodel.ode_secir_groups.network_architectures.mlp_multi_input_single_output(
num_age_groups=6,
num_outputs=8,
num_hidden_layers=3,
num_neurons_per_layer=32,
activation='relu',
)

Simple MLP Network which takes the compartments for multiple time steps as input and returns the compartments for one single time step for all age groups.

Reshaping adds an extra dimension to the output, so the shape of the output is 1x8. This makes the shape comparable to that of the multi-output models.

Parameters:
  • num_age_groups – Number of the age groups, default 6

  • num_outputs – Default: 8 Number of compartments. Default value is reached when aggregating the confirmed compartments.

  • num_hidden_layers – Number of hidden dense layers in the MLP architecture

  • num_neurons_per_layer – Number of neurons per hidden layer

  • activation – name of the used activation function

Returns:

Tensorflow keras model with given architecture