From b85799a05c689d23ccbd36082af14821200ea4da Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 8 Dec 2023 11:49:52 +0100 Subject: [PATCH] fix dictionary key check in estimator --- inst/python/Estimator.py | 2 +- tests/testthat/test-MLP.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/python/Estimator.py b/inst/python/Estimator.py index d707a3d..1c04177 100644 --- a/inst/python/Estimator.py +++ b/inst/python/Estimator.py @@ -19,7 +19,7 @@ def __init__(self, model, model_parameters, estimator_settings): self.device = estimator_settings["device"] torch.manual_seed(seed=self.seed) - if estimator_settings["finetune"]: + if "finetune" in estimator_settings.keys() and estimator_settings["finetune"]: path = estimator_settings["finetune_model_path"] fitted_estimator = torch.load(path, map_location="cpu") fitted_parameters = fitted_estimator["model_parameters"] diff --git a/tests/testthat/test-MLP.R b/tests/testthat/test-MLP.R index a470664..876cb29 100644 --- a/tests/testthat/test-MLP.R +++ b/tests/testthat/test-MLP.R @@ -123,7 +123,7 @@ test_that("MLP nn-module works ", { activation = torch$nn$ReLU, normalization = torch$nn$BatchNorm1d, dropout = 0.3, - d_out = 1L + dim_out = 1L ) output <- model(input) # model works without numeric variables