def _get_network_layer_sizes(net_params):
    """Infer the architecture of the simply connected network from the parameters"""
    dense_params = [p for p in net_params if len(p) > 0]
    all_dense_layer_sizes = [p[1].size for p in dense_params]
    dim_in = all_dense_layer_sizes[0]
    dim_out = all_dense_layer_sizes[-1]
    latent_sizes = all_dense_layer_sizes[1:-1]
    return dim_in, latent_sizes, dim_out