Skip to content
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dba3049
add PearsonCorrelation metric
kzkadc Mar 20, 2024
1f80ede
match the notation of the docstring with the other metrics
kzkadc Mar 20, 2024
d5f3b0c
Merge branch 'master' into correlation-coefficient
kzkadc Mar 23, 2024
69f7f5e
move PearsonCorrelation metric from contrib.metrics.regression to met…
kzkadc Mar 23, 2024
855a505
update test for PearsonCorrelation metric
kzkadc Mar 23, 2024
6b17c36
update test
kzkadc Mar 23, 2024
fb5b8f4
Merge branch 'master' into correlation-coefficient
kzkadc Mar 24, 2024
194f213
Merge branch 'correlation-coefficient_rewrite-test' into correlation-…
kzkadc Mar 24, 2024
7b1acd3
Merge branch 'master' into correlation-coefficient
kzkadc Mar 24, 2024
62e65d2
Merge branch 'master' into correlation-coefficient
kzkadc Mar 25, 2024
ce701bc
Merge branch 'master' into correlation-coefficient
kzkadc Mar 28, 2024
b931ec9
modify doc for PearsonCorrelation metric
kzkadc Mar 28, 2024
6609925
fix import
kzkadc Mar 28, 2024
9069779
resolve code formatting issue
kzkadc Mar 29, 2024
4a0096d
remove loop from test
kzkadc Mar 29, 2024
1de9181
Merge branch 'master' into correlation-coefficient
vfdev-5 Mar 29, 2024
ad1e090
Update ignite/metrics/regression/pearson_correlation.py
kzkadc Mar 29, 2024
4d6b18e
Update pearson_correlation.py
vfdev-5 Mar 29, 2024
ad41bbc
update test for PearsonCorrelation
kzkadc Mar 29, 2024
30f1684
Update tests/ignite/metrics/regression/test_pearson_correlation.py
vfdev-5 Mar 29, 2024
c6b6d92
relax pytest.approx
kzkadc Mar 30, 2024
bb93a5e
fix device compatibility
kzkadc Mar 31, 2024
56985fc
Merge branch 'master' into correlation-coefficient
kzkadc Mar 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ignite/metrics/regression/pearson_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ def reset(self) -> None:

def _update(self, output: Tuple[torch.Tensor, torch.Tensor]) -> None:
y_pred, y = output[0].detach(), output[1].detach()
self._sum_of_y_preds += y_pred.sum()
self._sum_of_ys += y.sum()
self._sum_of_y_pred_squares += y_pred.square().sum()
self._sum_of_y_squares += y.square().sum()
self._sum_of_products += (y_pred * y).sum()
self._sum_of_y_preds += y_pred.sum().to(self._device)
self._sum_of_ys += y.sum().to(self._device)
self._sum_of_y_pred_squares += y_pred.square().sum().to(self._device)
self._sum_of_y_squares += y.square().sum().to(self._device)
self._sum_of_products += (y_pred * y).sum().to(self._device)
self._num_examples += y.shape[0]

@sync_all_reduce(
Expand Down