def count_parameters(model):
    """Count the number of differentiable parameters in the model.
    
    Arguments
    ----------
    model: subclass instance of pyTorch nn.Module
        The neural network model in question.
    
    Returns
    ----------
    The number of model parameters as an integer.
    
    """
    return sum(p.numel() for p in model.parameters() if p.requires_grad)