Commit 26ca5d2
authored
Add mean and median threshold modes to binary quantization (#716)
The current binary quantization function sets a bit when the corresponding input dataset element is positive. This method (zero threshold mode) does not work well for, for example, a dataset where all elements are positive. This PR adds mean and median modes that set bits when the corresponding elements are larger than the dim-wise mean and median, respectively.
The new `transform` function requires NVIDIA/raft#2592 to be merged to support large datasets.
TODO:
- [x] C++
- [x] C
- [x] test
- [x] <del>python</del> The Python support will be added in a later PR, as the Python package build requires the C header file installed by `conda create` to include this update.
Authors:
- tsuki (https://github.com/enp1s0)
- Corey J. Nolet (https://github.com/cjnolet)
Approvers:
- Tamas Bela Feher (https://github.com/tfeher)
- Corey J. Nolet (https://github.com/cjnolet)
URL: #7161 parent ecea00e commit 26ca5d2
10 files changed
Lines changed: 908 additions & 70 deletions
File tree
- cpp
- include/cuvs/preprocessing/quantize
- src/preprocessing/quantize
- detail
- tests/preprocessing
- docs/source/cpp_api
- python/cuvs/cuvs/preprocessing/quantize/binary
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
27 | 110 | | |
28 | 111 | | |
29 | 112 | | |
| |||
39 | 122 | | |
40 | 123 | | |
41 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
42 | 142 | | |
43 | 143 | | |
44 | 144 | | |
0 commit comments