From 15910704acc90f95c34a810f3b23d4e19b723cc7 Mon Sep 17 00:00:00 2001 From: jeandut Date: Tue, 23 Jan 2024 18:06:25 +0100 Subject: [PATCH] getting rid of the bug of repeated calls --- fedeca/fedeca_core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fedeca/fedeca_core.py b/fedeca/fedeca_core.py index 9e3dd3cd..46ca95bd 100644 --- a/fedeca/fedeca_core.py +++ b/fedeca/fedeca_core.py @@ -1,4 +1,5 @@ """Federate causal inference on distributed data.""" +import copy import logging import sys import time @@ -181,7 +182,8 @@ def __init__( self.l1_ratio = l1_ratio self.initial_step_size = initial_step_size self.learning_rate_strategy = learning_rate_strategy - self.num_rounds_list = num_rounds_list + # Careful about mutable default args + self.num_rounds_list = copy.deepcopy(num_rounds_list) self.timeout = timeout self.sleep_time = sleep_time self.damping_factor_nr = damping_factor_nr