From 344e8abc608ab8add582bd79f967251196314a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Reboud?= Date: Mon, 5 Dec 2022 23:05:48 +0100 Subject: [PATCH] Activate DecorrelateRGB in test. --- Docs/Contributing/CHANGELOG.md | 3 ++- Tests/MATorchTests/Base/Model.swift | 7 ++----- Tests/MATorchTests/Base/python_lib/model.py | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Docs/Contributing/CHANGELOG.md b/Docs/Contributing/CHANGELOG.md index 3d968a2b..1936ff42 100644 --- a/Docs/Contributing/CHANGELOG.md +++ b/Docs/Contributing/CHANGELOG.md @@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file. ## [unreleased] +🚨 **integration**: activate DecorrelateRGB in test ([#29](https://github.com/owkin/MAKit/pull/29))\ 🚨 **integration**: test IDFT and complex numbers ([#28](https://github.com/owkin/MAKit/pull/28))\ -🚨 **layer_2d**: add tests for non dirty status ([#27](https://github.com/owkin/MAKit/pull/27))\ +🪜 **layer_2d**: add tests for non dirty status ([#27](https://github.com/owkin/MAKit/pull/27))\ 🔨 **tests**: factorize transform tests ([#26](https://github.com/owkin/MAKit/pull/26))\ 🪜 **layer_2d**: FTFrequences2D & Multiply2D ([#25](https://github.com/owkin/MAKit/pull/25))\ 🪜 **layer_2d**: LinearScale2D ([#24](https://github.com/owkin/MAKit/pull/24))\ diff --git a/Tests/MATorchTests/Base/Model.swift b/Tests/MATorchTests/Base/Model.swift index 1d3331fd..31745267 100644 --- a/Tests/MATorchTests/Base/Model.swift +++ b/Tests/MATorchTests/Base/Model.swift @@ -233,7 +233,7 @@ class ModelTest3 /// Principle features: /// - 2D Frequences & scale /// - IRDFT - /// - (Decorrelate color) + /// - Decorrelate color /// /// - Parameter size: The size of the input data. /// - Returns: The built model. @@ -269,18 +269,15 @@ class ModelTest3 params: params ) - /* - Introduces float rounding approximation issues! layer = DecorrelateRGB( layerPrev: layer, correlation: [ - 0.26, 0.26, 0.27, + 0.26, 0.27, 0.27, 0.09, 0.00, -0.09, 0.02, -0.05, 0.03 ].map { $0 / 0.4619524 }, params: params ) - */ layer = Activation2D( layerPrev: layer, diff --git a/Tests/MATorchTests/Base/python_lib/model.py b/Tests/MATorchTests/Base/python_lib/model.py index b467e120..c1e1337c 100644 --- a/Tests/MATorchTests/Base/python_lib/model.py +++ b/Tests/MATorchTests/Base/python_lib/model.py @@ -228,7 +228,7 @@ class ModelTest3(torch.nn.Module): Principle features: - 2D Frequences & scale - IRFFT - (- Decorrelate color) + - Decorrelate color """ def __init__(self, size): @@ -254,7 +254,7 @@ def forward(self, x: torch.Tensor) -> torch.Tensor: """ x = x * self.scale x = _irfft_image(x) - # x = _linear_decorrelate_color(x) + x = _linear_decorrelate_color(x) x = torch.nn.Sigmoid()(x) x = -1 + 2 * x x = x[None]