(norms, maxes=None, num_points=25)
return grid
Construct a discretization.
Construct a discretization.
Construct a discretization .
def gridify(norms, maxes=None, num_points=25):
    """Construct a discretization."""
    norms = np.asarray(norms).ravel()
    if maxes is None:
        maxes = norms
    else:
        maxes = np.asarray(maxes).ravel()
    limits = np.column_stack((- maxes / norms, maxes / norms))

    if isinstance(num_points, int):
        num_points = [num_points, ] * len(norms)
    grid = GridWorld(limits, num_points)
    return grid
def gridify ( norms , maxes = None , num_points = 25 ) : norms = np . asarray ( norms ) . ravel ( ) if maxes is None : maxes = norms else : maxes = np . asarray ( maxes ) . ravel ( ) limits = np . column_stack ( ( - maxes / norms , maxes / norms ) ) if isinstance ( num_points , int ) : num_points = [ num_points , ] * len ( norms ) grid = GridWorld ( limits , num_points ) return grid