From 125cd7eaba0515dc9dcbc1696867d5e3c087e36e Mon Sep 17 00:00:00 2001 From: Pablo Olivares Date: Mon, 24 Jun 2024 21:59:15 +0200 Subject: [PATCH] Accept arguments in the optimizer advances #17 --- factories/loss_factory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/factories/loss_factory.py b/factories/loss_factory.py index 06fbb3d..efcf988 100644 --- a/factories/loss_factory.py +++ b/factories/loss_factory.py @@ -4,5 +4,5 @@ class LossFactory(Factory): def __init__(self): super().__init__() - self.register("CrossEntropyLoss", lambda: CrossEntropyLoss()) - self.register("MSELoss", lambda: MSELoss()) + self.register("CrossEntropyLoss", lambda **kwargs: CrossEntropyLoss(**kwargs)) + self.register("MSELoss", lambda **kwargs: MSELoss(**kwargs)) \ No newline at end of file