Commit 8cc8dd2
[FIX] Refactor the function
* [FEAT] Add the 'median' method to the backend base class and implements this method in the Numpy, Pytorch, Jax and Cupy backends
* [TEST] Modify the 'cost_normalization' test to multiple backends
* [REFACTOR] Refactor the 'utils.cost_normalization' function for multiple backends
* [TEST] Update backend tests for method 'median'
* [DEBUG] Fix the error in the test in the 'median' method with PyTorch backend
* [TEST] Add the edge case where the 'median' method is not yet implemented in the Tensorflow backend.
* [FEAT] Implement the 'median' method in the Tensorflow backend using Numpy
* [DEBUG] For compatibility reasons, the median method in the Pytorch backend change using numpy
* [DEBUG] The 'median' method checks the Pytorch version to decide whether to use torch.quantile or numpy
* Add changes to RELEASES.md
---------
Co-authored-by: Rémi Flamary <remi.flamary@gmail.com>utils.cost_normalization to work with multiple backends (#472)1 parent 03341c6 commit 8cc8dd2
File tree
5 files changed
+73
-15
lines changed- ot
- test
5 files changed
+73
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
577 | 587 | | |
578 | 588 | | |
579 | 589 | | |
| |||
1123 | 1133 | | |
1124 | 1134 | | |
1125 | 1135 | | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
1126 | 1139 | | |
1127 | 1140 | | |
1128 | 1141 | | |
| |||
1482 | 1495 | | |
1483 | 1496 | | |
1484 | 1497 | | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
1485 | 1501 | | |
1486 | 1502 | | |
1487 | 1503 | | |
| |||
1899 | 1915 | | |
1900 | 1916 | | |
1901 | 1917 | | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
1902 | 1934 | | |
1903 | 1935 | | |
1904 | 1936 | | |
| |||
2289 | 2321 | | |
2290 | 2322 | | |
2291 | 2323 | | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
2292 | 2327 | | |
2293 | 2328 | | |
2294 | 2329 | | |
| |||
2678 | 2713 | | |
2679 | 2714 | | |
2680 | 2715 | | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
2681 | 2723 | | |
2682 | 2724 | | |
2683 | 2725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
362 | 364 | | |
363 | 365 | | |
364 | 366 | | |
365 | | - | |
| 367 | + | |
366 | 368 | | |
367 | | - | |
| 369 | + | |
368 | 370 | | |
369 | | - | |
| 371 | + | |
370 | 372 | | |
371 | | - | |
| 373 | + | |
372 | 374 | | |
373 | 375 | | |
374 | 376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| |||
519 | 521 | | |
520 | 522 | | |
521 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
522 | 528 | | |
523 | 529 | | |
524 | 530 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
274 | 274 | | |
275 | 275 | | |
| 276 | + | |
276 | 277 | | |
277 | 278 | | |
278 | | - | |
279 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
280 | 282 | | |
281 | | - | |
282 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
283 | 286 | | |
284 | | - | |
285 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
286 | 290 | | |
287 | | - | |
288 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
289 | 294 | | |
290 | | - | |
291 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
| |||
0 commit comments