def mse_grad(y, tx, w):
    """
    Compute gradient for mse loss

    Parameters
    ----------
    y : Vector
        Input.
    tx : Matrix
        Output.
    w : Vector
        Weights.

    Returns
    -------
    Vector of gradients.

    """
    e = y - tx @ w
    return (-1/tx.shape[0]) * tx.T @ e