def _init_model(self, params): self.model_param = params self.alpha = params.alpha self.init_param_obj = params.init_param self.fit_intercept = self.init_param_obj.fit_intercept self.batch_size = params.batch_size self.max_iter = params.max_iter self.optimizer = optimizer_factory(params) self.converge_func = converge_func_factory(params.early_stop, params.tol) self.encrypted_calculator = None self.validation_freqs = params.validation_freqs
def _init_model(self, params): super(HomoFMBase, self)._init_model(params) # if params.encrypt_param.method == consts.PAILLIER: # self.cipher_operator = PaillierEncrypt() # else: # self.cipher_operator = FakeEncrypt() self.transfer_variable = HomoFMTransferVariable() self.aggregator.register_aggregator(self.transfer_variable) self.optimizer = optimizer_factory(params) self.aggregate_iters = params.aggregate_iters
def _init_model(self, params): super(HomoLRBase, self)._init_model(params) self.re_encrypt_batches = params.re_encrypt_batches if params.encrypt_param.method == consts.PAILLIER: self.cipher_operator = PaillierEncrypt() else: self.cipher_operator = FakeEncrypt() self.transfer_variable = HomoZclAlexTransferVariable() self.aggregator.register_aggregator(self.transfer_variable) self.optimizer = optimizer_factory(params) self.aggregate_iters = params.aggregate_iters self.max_iter = 50
def _init_model(self, params): self.model_param = params self.alpha = params.alpha self.init_param_obj = params.init_param # self.fit_intercept = self.init_param_obj.fit_intercept self.batch_size = params.batch_size self.max_iter = params.max_iter self.optimizer = optimizer_factory(params) self.converge_func = converge_func_factory(params.early_stop, params.tol) self.encrypted_calculator = None self.validation_freqs = params.validation_freqs self.validation_strategy = None self.early_stopping_rounds = params.early_stopping_rounds self.metrics = params.metrics self.use_first_metric_only = params.use_first_metric_only
def _init_model(self, params): self.model_param = params self.alpha = params.alpha self.init_param_obj = params.init_param # self.fit_intercept = self.init_param_obj.fit_intercept self.batch_size = params.batch_size if hasattr(params, "shuffle"): self.shuffle = params.shuffle if hasattr(params, "masked_rate"): self.masked_rate = params.masked_rate if hasattr(params, "batch_strategy"): self.batch_strategy = params.batch_strategy self.max_iter = params.max_iter self.optimizer = optimizer_factory(params) self.converge_func = converge_func_factory(params.early_stop, params.tol) self.validation_freqs = params.callback_param.validation_freqs self.validation_strategy = None self.early_stopping_rounds = params.callback_param.early_stopping_rounds self.metrics = params.callback_param.metrics self.use_first_metric_only = params.callback_param.use_first_metric_only