Skip to content

Commit

Permalink
feat: add Caratheodory and Tree recombination.
Browse files Browse the repository at this point in the history
Adds a new `recombination.py` module to the solvers subpackage,
providing a generalised `RecombinationSolver`, in addition to the
`CaratheodoryRecombination` and `TreeRecombination` solvers.

A `RecombinationSolverTest` case has been added to `test_solvers.py`,
covering the known degenerate cases that may arise in recombination.

The documentation has been updated where required, but no dedicated
new examples/documentation pages have been created.

Refs: #497
  • Loading branch information
tc85324 committed Jul 31, 2024
1 parent 20d9d40 commit 421c74d
Show file tree
Hide file tree
Showing 11 changed files with 811 additions and 22 deletions.
6 changes: 6 additions & 0 deletions .cspell/custom_misc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ANNchor
approximator
approximators
archiveprefix
binom
cand
coreax
coreset
Expand All @@ -24,18 +25,23 @@ kdtree
kernelised
kernelized
KSD
mapsto
ml.p3.8xlarge
ndmin
parsable
PCIMQ
phdthesis
PMLR
primaryclass
PRNG
rcond
recomb
refs
regulariser
RKHS
RPCHOLESKY
sigmas
subseteq
supp
TLDR
typecheck
Expand Down
5 changes: 5 additions & 0 deletions .cspell/library_terms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ brightgreen
bysource
cmap
color
Concretization
dispname
dollarmath
dtype
Expand All @@ -30,8 +31,10 @@ dunder
eigh
emibcn
eprint
errstate
figsize
finfo
flatnonzero
fori_loop
fracv
furo
Expand Down Expand Up @@ -112,6 +115,7 @@ sklearn
softplus
sphinxcontrib
sphobjinv
tensordot
texttt
toctree
tomli
Expand All @@ -124,6 +128,7 @@ unsrt
vars
viewcode
vmap
vmaps
writebytes
xlabel
ylabel
5 changes: 5 additions & 0 deletions .cspell/people.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Benard
Caratheodory
Chatalic
Duvenaud
Epperly
Expand All @@ -13,6 +14,8 @@ Jaehoon
Jiaxin
Jitkrittum
Kanagawa
Litterer
Lyons
Martinsson
Motonobu
Nystr
Expand All @@ -26,6 +29,8 @@ Schreuder
Smirnov
Smola
Staber
Tchakaloff
Tchernychova
Tropp
Veiga
Wittawat
Expand Down
8 changes: 8 additions & 0 deletions coreax/solvers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
RPCholeskyState,
SteinThinning,
)
from coreax.solvers.recombination import (
CaratheodoryRecombination,
RecombinationSolver,
TreeRecombination,
)

__all__ = [
"CompositeSolver",
Expand All @@ -49,4 +54,7 @@
"PaddingInvariantSolver",
"GreedyKernelPoints",
"GreedyKernelPointsState",
"RecombinationSolver",
"CaratheodoryRecombination",
"TreeRecombination",
]
2 changes: 1 addition & 1 deletion coreax/solvers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PaddingInvariantSolver(Solver):
A :class:`Solver` whose results are invariant to zero weighted data.
In some cases, such as in :class:`coreax.solvers.MapReduce`, there is a need to pad
data to ensure shape stability. In some cases, we may assign zero weight to the
data to ensure shape stability. In these cases, we may assign zero weight to the
padded data points, which allows certain 'padding invariant' solvers to return the
same values on a call to :meth:`~coreax.solvers.Solver.reduce` as would have been
returned if no padding were present.
Expand Down
Loading

0 comments on commit 421c74d

Please sign in to comment.