def __init__(self, name=None, max_iter=100, batch_size=-1, secure_aggregate=True, aggregate_every_n_epoch=1, early_stop="diff", encode_label=False, predict_param=None, cv_param=None, **kwargs): explicit_parameters = kwargs["explict_parameters"] explicit_parameters["optimizer"] = None explicit_parameters["loss"] = None explicit_parameters["metrics"] = None explicit_parameters["nn_define"] = None explicit_parameters["config_type"] = "keras" Component.__init__(self, **explicit_parameters) if "name" in explicit_parameters: del explicit_parameters["name"] for param_key, param_value in explicit_parameters.items(): setattr(self, param_key, param_value) self.optimizer = None self.loss = None self.metrics = None self.nn_define = None self.config_type = "keras" self.input = Input(self.name, data_type="multi") self.output = Output(self.name, data_type='single') self._module_name = "HomoNN" self._model = Sequential()
def __init__(self, **kwargs): Component.__init__(self, **kwargs) new_kwargs = self.erase_component_base_param(**kwargs) ReaderParam.__init__(self, **new_kwargs) self.output = Output(self.name, data_type='single', has_model=False) self._module_name = "Reader"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) # print(self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) SBTTransformerParam.__init__(self, **new_kwargs) self.input = Input(self.name, data_type="multi") self.output = Output(self.name) self._module_name = "SBTFeatureTransformer"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) new_kwargs = self.erase_component_base_param(**kwargs) SampleWeightParam.__init__(self, **new_kwargs) self.input = Input(self.name) self.output = Output(self.name, data_type='single', has_model=True) self._module_name = "SampleWeight"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) # print (self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) DataSplitParam.__init__(self, **new_kwargs) self.input = Input(self.name, ) self.output = Output(self.name, has_model=False, data_type="multi") self._module_name = "HeteroDataSplit"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) FeldmanVerifiableSumParam.__init__(self, **new_kwargs) self.input = Input(self.name) self.output = Output(self.name, has_model=False) self._module_name = "FeldmanVerifiableSum"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) ScorecardParam.__init__(self, **new_kwargs) self.input = Input(self.name) self.output = Output(self.name, data_type='single', has_model=False) self._module_name = "Scorecard"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) # print (self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) SampleParam.__init__(self, **new_kwargs) self.input = Input(self.name) self.output = Output(self.name, has_model=False) self._module_name = "FederatedSample"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) # print (self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) HomoOneHotParam.__init__(self, **new_kwargs) self.input = Input(self.name) self.output = Output(self.name) self._module_name = "HomoOneHotEncoder"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) # print(self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) HeteroFastSecureBoostParam.__init__(self, **new_kwargs) self.input = Input(self.name, data_type="multi") self.output = Output(self.name) self._module_name = "HeteroFastSecureBoost"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) # print (self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) FeatureBinningParam.__init__(self, **new_kwargs) self.input = Input(self.name) self.output = Output(self.name) self._module_name = "HeteroFeatureBinning"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) # print (self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) KmeansParam.__init__(self, **new_kwargs) self.input = Input(self.name, data_type="multi") self.output = Output(self.name, data_type="no_limit", output_unit=2) self._module_name = "HeteroKmeans"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) #print (self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) StatisticsParam.__init__(self, **new_kwargs) self.input = Input(self.name) self.output = Output(self.name, has_model=True) self._module_name = "DataStatistics"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) #print (self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) ColumnExpandParam.__init__(self, **new_kwargs) self.input = Input(self.name) self.output = Output(self.name, data_type='single', has_model=True) self._module_name = "ColumnExpand"
def __init__(self, **kwargs): Component.__init__(self, **kwargs) #print (self.name) LOGGER.debug(f"{self.name} component created") new_kwargs = self.erase_component_base_param(**kwargs) DataTransformParam.__init__(self, **new_kwargs) self.input = Input(self.name) self.output = Output(self.name, data_type='single') self._module_name = "DataTransform"
def __init__(self, task_type="classification", epochs=None, batch_size=-1, early_stop="diff", tol=1e-5, encrypt_param=None, predict_param=None, cv_param=None, interactive_layer_lr=0.1, validation_freqs=None, early_stopping_rounds=None, use_first_metric_only=None, floating_point_precision=23, drop_out_keep_rate=1, selector_param=None, **kwargs): explicit_parameters = kwargs["explict_parameters"] explicit_parameters["optimizer"] = None explicit_parameters["loss"] = None explicit_parameters["metrics"] = None explicit_parameters["bottom_nn_define"] = None explicit_parameters["top_nn_define"] = None explicit_parameters["interactive_layer_define"] = None explicit_parameters["config_type"] = "keras" Component.__init__(self, **explicit_parameters) if "name" in explicit_parameters: del explicit_parameters["name"] for param_key, param_value in explicit_parameters.items(): setattr(self, param_key, param_value) self.input = Input(self.name, data_type="multi") self.output = Output(self.name, data_type='single') self._module_name = "HeteroNN" self.optimizer = None self.loss = None self.config_type = "keras" self.metrics = None self.bottom_nn_define = None self.top_nn_define = None self.interactive_layer_define = None self._bottom_nn_model = Sequential() self._interactive_layer = Sequential() self._top_nn_model = Sequential()
def __init__(self, epochs=1, batch_size=-1, encrypt_param=None, predict_param=None, cv_param=None, intersect_param={'intersect_method': consts.RSA}, validation_freqs=None, early_stopping_rounds=None, use_first_metric_only=None, mode='plain', communication_efficient=False, n_iter_no_change=False, tol=1e-5, local_round=5, **kwargs): explicit_parameters = kwargs["explict_parameters"] explicit_parameters["optimizer"] = None # explicit_parameters["loss"] = None # explicit_parameters["metrics"] = None explicit_parameters["nn_define"] = None explicit_parameters["config_type"] = "keras" Component.__init__(self, **explicit_parameters) if "name" in explicit_parameters: del explicit_parameters["name"] for param_key, param_value in explicit_parameters.items(): setattr(self, param_key, param_value) self.input = Input(self.name, data_type="multi") self.output = Output(self.name, data_type='single') self._module_name = "FTL" self.optimizer = None self.loss = None self.config_type = "keras" self.metrics = None self.bottom_nn_define = None self.top_nn_define = None self.interactive_layer_define = None self._nn_model = Sequential() self.nn_define = None
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from pipeline.component.component_base import Component a = Component(name="test") b = a.get_party_instance(role='guest', party_id=1) bb = a.get_party_instance(role='guest', party_id=[1, 2, 3, 4]) c = Component() print(a.name) print(b.name) print(bb.name) print(c.name)