def const_searches_per_hyperparam(searches_per_param=5, max_searches=100):
    """Return a function that maps the number of hyperparameters to a constant
    multiple per hyperparameter, capped at a certain maximum."""
    def n_iter(n_hyperparameters):
        return max(1,
                   min(max_searches, searches_per_param * n_hyperparameters))
    return n_iter