Exemple #1
0
 def _init_model(self, param):
     super(HomoNNClient, self)._init_model(param)
     self.batch_size = param.batch_size
     self.aggregate_every_n_epoch = 1
     self.nn_define = param.nn_define
     self.config_type = param.config_type
     self.optimizer = param.optimizer
     self.loss = param.loss
     self.metrics = param.metrics
     self.data_converter = nn_model.get_data_converter(self.config_type)
     self.model_builder = nn_model.get_nn_builder(config_type=self.config_type)
Exemple #2
0
    def _init_model(self, param: HomoNNParam):
        super()._init_model(param=param)
        self.batch_size = param.batch_size
        self.aggregate_every_n_epoch = param.aggregate_every_n_epoch
        self.nn_define = param.nn_define
        self.config_type = param.config_type
        self.optimizer = param.optimizer
        self.loss = param.loss
        self.metrics = param.metrics
        self.encode_label = param.encode_label

        self.data_converter = nn_model.get_data_converter(self.config_type)
        self.model_builder = nn_model.get_nn_builder(config_type=self.config_type)
Exemple #3
0
def client_set_params(self, param):
    self.nn_model = None
    self._summary = dict(loss_history=[], is_converged=False)
    self._header = []
    self._label_align_mapping = None

    self.param = param
    self.enable_secure_aggregate = param.secure_aggregate
    self.max_aggregate_iteration_num = param.max_iter
    self.batch_size = param.batch_size
    self.aggregate_every_n_epoch = param.aggregate_every_n_epoch
    self.nn_define = param.nn_define
    self.config_type = param.config_type
    self.optimizer = param.optimizer
    self.loss = param.loss
    self.metrics = param.metrics
    self.encode_label = param.encode_label

    self.data_converter = nn_model.get_data_converter(self.config_type)
    self.model_builder = nn_model.get_nn_builder(config_type=self.config_type)