def network_shape(params, last_neuron):
    """Provides the ability to include network shape in experiments. If params
    dictionary for the round contains float value for params['shapes'] then
    a linear contraction towards the last_neuron value. The higher the value,
    the fewer layers it takes to reach lesser than last_neuron.

    Supports three inbuilt shapes 'brick', 'funnel', and 'triangle'.


    params : dict
         Scan() params for a single roundself.
    last_neuron : int
         Number of neurons on the output layer in the Keras model.
    """
    import numpy as np
    from ..utils.exceptions import TalosParamsError
    layers = params['hidden_layers']
    shape = params['shapes']
    first_neuron = params['first_neuron']
    out = []
    n = first_neuron
    if layers == 0:
        return [0]
    if isinstance(shape, float):
        for i in range(layers):
            n *= 1 - shape
            if n > last_neuron:
                out.append(int(n))
            else:
                out.append(last_neuron)
    elif shape == 'brick':
        out = [first_neuron] * layers
    elif shape == 'funnel':
        for i in range(layers + 1):
            n -= int((first_neuron - last_neuron) / layers)
            out.append(n)
        out.pop(-1)
    elif shape == 'triangle':
        out = np.linspace(first_neuron, last_neuron, layers + 2, dtype=int
            ).tolist()
        out.pop(0)
        out.pop(-1)
        out.reverse()
    else:
        message = (
            "'shapes' must be float or in ['funnel', 'brick', 'triangle']")
        raise TalosParamsError(message)
    return out
