def bottleneck_param(scope,
                     base_depth=64,
                     kernel_size=3,
                     num_units=3,
                     stride=2,
                     rate=1):
    """ Generate parameters for each stage in a res-net.
    :param scope: string, the name of the stage(bottleneck), e.g, "block1".
    :param base_depth: int, the base depth of each residual block, default 64.
    :param kernel_size: int, default 3.
    :param num_units: int, the total number of residual blocks in this stage, default 3.
    :param stride: int, the stride of the middle convolution layer in each residual block,
        default 2
    :param rate: int, default 1.

    :return: list of parameters, can be passed to the function 'ResidualBottleneck(...)'
    """
    return [{
        "base_depth": base_depth,
        "depth": base_depth*4,
        "kernel_size": kernel_size,
        "stride": 1,
        "rate": rate,
        "block_name": scope
    }]*(num_units-1) + [{
        "base_depth": base_depth,
        "depth": base_depth*4,
        "kernel_size": kernel_size,
        "stride": stride,
        "rate": rate,
        "block_name": scope
    }]