diff --git a/Docs/Contributing/CHANGELOG.md b/Docs/Contributing/CHANGELOG.md index 98672541..6e0d1489 100644 --- a/Docs/Contributing/CHANGELOG.md +++ b/Docs/Contributing/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [unreleased] +🐛 **fix:** update correlation matrix coeffs ([#37](https://github.com/owkin/MAKit/pull/37))\ 🪜 **layer_2d:** ResizeBilinearCrop ([#36](https://github.com/owkin/MAKit/pull/36))\ 🚀 **perf:** enhance backwardGPU for ResizeBilinear ([#35](https://github.com/owkin/MAKit/pull/35))\ 🪜 **layer_2d:** Rotate2D ([#34](https://github.com/owkin/MAKit/pull/34))\ diff --git a/Tests/MATorchTests/Base/Model.swift b/Tests/MATorchTests/Base/Model.swift index 31745267..ef5d49cd 100644 --- a/Tests/MATorchTests/Base/Model.swift +++ b/Tests/MATorchTests/Base/Model.swift @@ -272,9 +272,9 @@ class ModelTest3 layer = DecorrelateRGB( layerPrev: layer, correlation: [ - 0.26, 0.27, 0.27, - 0.09, 0.00, -0.09, - 0.02, -0.05, 0.03 + 0.26, 0.09, 0.02, + 0.27, 0.00, -0.05, + 0.27, -0.09, 0.03 ].map { $0 / 0.4619524 }, params: params ) diff --git a/Tests/MATorchTests/Base/python_lib/model.py b/Tests/MATorchTests/Base/python_lib/model.py index c1e1337c..f1456ed1 100644 --- a/Tests/MATorchTests/Base/python_lib/model.py +++ b/Tests/MATorchTests/Base/python_lib/model.py @@ -213,7 +213,7 @@ def _linear_decorrelate_color(x): color_correlation_normalized = \ color_correlation_svd_sqrt / max_norm_svd_sqrt color_correlation_normalized = torch.Tensor( - color_correlation_normalized.astype("float32") + color_correlation_normalized.T.astype("float32") ) x_flat = torch.matmul(x_flat, color_correlation_normalized) x = torch.reshape(x_flat, x.shape)