Skip to content

Commit

Permalink
[DOC] Specify comparability with Hutchinson
Browse files Browse the repository at this point in the history
  • Loading branch information
f-dangel committed Oct 16, 2023
1 parent 3c97467 commit 522cf82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions curvlinops/trace/meyer2020hutch.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ def __init__(
large, or the sampling distribution is not supported.
Note:
If you are planning to perform a fair comparison with vanilla Hutchinson,
``basis_dim`` should be ``s / 3`` where ``s`` is the number of samples
used by vanilla Hutchinson and you should take the mean over ``s / 3``
samples.
If you are planning to perform a fair (i.e. same computation budget)
comparison with vanilla Hutchinson, ``basis_dim`` should be ``s / 3``
where ``s`` is the number of samples used by vanilla Hutchinson. If
``s / 3`` requires storing a too large matrix, you can pick
``basis_dim = s1`` and draw ``s2`` samples from Hutch++ such that
``2 * s1 + s2 = s``.
"""
if len(A.shape) != 2 or A.shape[0] != A.shape[1]:
raise ValueError(f"A must be square. Got shape {A.shape}.")
Expand Down
3 changes: 3 additions & 0 deletions docs/rtd/linops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ Trace approximation

.. autoclass:: curvlinops.HutchinsonTraceEstimator
:members: __init__, sample

.. autoclass:: curvlinops.HutchPPTraceEstimator
:members: __init__, sample

0 comments on commit 522cf82

Please sign in to comment.