Fix inversion between fine and coarse implicit_functions

Summary: Fine implicit function was called before the coarse implicit function.

Reviewed By: shapovalov

Differential Revision: D46224224

fbshipit-source-id: 6b1cc00cc823d3ea7a5b42774c9ec3b73a69edb5
This commit is contained in:
Emilien Garreau 2023-05-26 08:33:54 -07:00 committed by Facebook GitHub Bot
parent e0c3ca97ff
commit 35badc0892
2 changed files with 4 additions and 4 deletions

View File

@ -373,7 +373,7 @@ class OverfitModel(ImplicitronModelBase): # pyre-ignore: 13
self.implicit_function self.implicit_function
] ]
if self.coarse_implicit_function is not None: if self.coarse_implicit_function is not None:
implicit_functions += [self.coarse_implicit_function] implicit_functions = [self.coarse_implicit_function, self.implicit_function]
if self.global_encoder is not None: if self.global_encoder is not None:
global_code = self.global_encoder( # pyre-fixme[29] global_code = self.global_encoder( # pyre-fixme[29]

View File

@ -109,9 +109,9 @@ class TestOverfitModel(unittest.TestCase):
# Adapt the mapping from generic model to overfit model # Adapt the mapping from generic model to overfit model
mapping_om_from_gm = { mapping_om_from_gm = {
key.replace("_implicit_functions.0._fn", "implicit_function").replace( key.replace(
"_implicit_functions.1._fn", "coarse_implicit_function" "_implicit_functions.0._fn", "coarse_implicit_function"
): val ).replace("_implicit_functions.1._fn", "implicit_function"): val
for key, val in generic_model.state_dict().items() for key, val in generic_model.state_dict().items()
} }
# Copy parameters from generic_model to overfit_model # Copy parameters from generic_model to overfit_model