def forward(network, X):
    """
    Return a list of activations for each layer by applying them sequentially. 
    """
    activations = []
    input = X

    for layer in network:
        activations.append(layer.forward(input))
        input = activations[-1]

    return activations