from typing import Dict
from typing import Any
from typing import List


def get_region_sizes(settings: Dict[str, Any]) -> List[int]:
    """ Compute size of each layer in network specified by `settings`. """

    dim = settings["num_tasks"] + settings["obs_dim"]
    region_sizes = []
    for region in range(settings["num_layers"]):
        if region == 0:
            region_size = settings["hidden_size"] * (dim + 1)
        elif region == settings["num_layers"] - 1:
            region_size = dim * (settings["hidden_size"] + 1)
        else:
            region_size = settings["hidden_size"] ** 2 + settings["hidden_size"]
        region_sizes.append(region_size)

    return region_sizes