Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use N or N-1 instead of empirical kmax in degree histogram
Tweaks `DegreeDivergence` to use N (if there are self-loops) or N-1 (if there are not) instead of the largest observed degree when constructing the degree histogram. This works because a `Counter` behaves like a `defaultdict(int)`, so the list comprehension ``` hist = np.array([counter[v] for v in range(max_deg)]) ``` pads out the zeros automatically. It should rarely affect results, but has the advantages of (i) being slightly more accurate for the pedants among us and (ii) being faster for some reason. And while it doesn't affect the JSD, if we ever do implement #174, maybe it ends up mattering somewhere else.
- Loading branch information