Ejemplo n.º 1
0
    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["bottom_nn_define"] = None
        explicit_parameters["top_nn_define"] = None
        explicit_parameters["interactive_layer_define"] = None
        explicit_parameters["config_type"] = "keras"
        FateComponent.__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.config_type = "keras"
        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()
Ejemplo n.º 2
0
    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"
        FateComponent.__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()
Ejemplo n.º 3
0
    def __init__(self, **kwargs):
        FateComponent.__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"
Ejemplo n.º 4
0
    def __init__(self, **kwargs):
        FateComponent.__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"
Ejemplo n.º 5
0
    def __init__(self, **kwargs):
        FateComponent.__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"
Ejemplo n.º 6
0
    def __init__(self, **kwargs):
        FateComponent.__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"
Ejemplo n.º 7
0
    def __init__(self, **kwargs):
        FateComponent.__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"
Ejemplo n.º 8
0
    def __init__(self, **kwargs):
        FateComponent.__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"
Ejemplo n.º 9
0
    def __init__(self, **kwargs):
        FateComponent.__init__(self, **kwargs)

        # print (self.name)
        LOGGER.debug(f"{self.name} component created")

        new_kwargs = self.erase_component_base_param(**kwargs)

        SecureInformationRetrievalParam.__init__(self, **new_kwargs)
        self.input = Input(self.name, data_type="single")
        self.output = Output(self.name)
        self._module_name = "SecureInformationRetrieval"
Ejemplo n.º 10
0
    def __init__(self, **kwargs):
        FateComponent.__init__(self, **kwargs)

        #print (self.name)
        LOGGER.debug(f"{self.name} component created")

        new_kwargs = self.erase_component_base_param(**kwargs)

        FeatureImputationParam.__init__(self, **new_kwargs)
        self.input = Input(self.name)
        self.output = Output(self.name, has_model=True)
        self._module_name = "FeatureImputation"
Ejemplo n.º 11
0
    def __init__(self, **kwargs):
        FateComponent.__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"
Ejemplo n.º 12
0
    def __init__(self, **kwargs):
        FateComponent.__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"
Ejemplo n.º 13
0
    def __init__(self, **kwargs):
        FateComponent.__init__(self, **kwargs)

        #print (self.name)
        LOGGER.debug(f"{self.name} component created")
        new_kwargs = self.erase_component_base_param(**kwargs)

        DataIOParam.__init__(self, **new_kwargs)

        self.input = Input(self.name)
        self.output = Output(self.name, data_type='single')
        self._module_name = "DataIO"
Ejemplo n.º 14
0
    def __init__(self, **kwargs):
        FateComponent.__init__(self, **kwargs)

        #print (self.name)
        LOGGER.debug(f"{self.name} component created")
        new_kwargs = self.erase_component_base_param(**kwargs)

        LabelTransformParam.__init__(self, **new_kwargs)

        self.input = Input(self.name)
        self.output = Output(self.name, data_type='single', has_model=True)
        self._module_name = "LabelTransform"
Ejemplo n.º 15
0
    def __init__(self, **kwargs):
        FateComponent.__init__(self, **kwargs)

        # print (self.name)
        LOGGER.debug(f"{self.name} component created")

        new_kwargs = self.erase_component_base_param(**kwargs)

        IntersectParam.__init__(self, **new_kwargs)
        self.input = Input(self.name)
        self.output = Output(self.name, has_model=False, has_cache=True)
        self._module_name = "Intersection"
Ejemplo n.º 16
0
    def __init__(self, **kwargs):
        FateComponent.__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, has_data=False)
        self._module_name = "DataStatistics"
Ejemplo n.º 17
0
    def __init__(self, **kwargs):
        FateComponent.__init__(self, **kwargs)

        # print (self.name)
        LOGGER.debug(f"{self.name} component created")

        new_kwargs = self.erase_component_base_param(**kwargs)

        LogisticRegressionParam.__init__(self, **new_kwargs)
        self.input = Input(self.name, data_type="multi")
        self.output = Output(self.name)
        self._module_name = "HeteroSSHELR"
Ejemplo n.º 18
0
    def __init__(self, **kwargs):
        FateComponent.__init__(self, **kwargs)

        # print (self.name)
        LOGGER.debug(f"{self.name} component created")

        new_kwargs = self.erase_component_base_param(**kwargs)

        HeteroFeatureBinningParam.__init__(self, **new_kwargs)
        self.input = Input(self.name)
        self.output = Output(self.name)
        self._module_name = "HeteroFeatureBinning"
Ejemplo n.º 19
0
    def __init__(self, **kwargs):
        FateComponent.__init__(self, **kwargs)

        # print (self.name)
        LOGGER.debug(f"{self.name} component created")

        new_kwargs = self.erase_component_base_param(**kwargs)

        LocalBaselineParam.__init__(self, **new_kwargs)
        self.input = Input(self.name, data_type="multi")
        self.output = Output(self.name)
        self._module_name = "LocalBaseline"
Ejemplo n.º 20
0
    def __init__(self, **kwargs):
        FateComponent.__init__(self, **kwargs)

        # print(self.name)
        LOGGER.debug(f"{self.name} component created")

        new_kwargs = self.erase_component_base_param(**kwargs)

        HeteroSecureBoostParam.__init__(self, **new_kwargs)
        self.input = Input(self.name, data_type="multi")
        self.output = Output(self.name)
        self._module_name = "HeteroFastSecureBoost"
        self._source_provider = ProviderType.FATE
Ejemplo n.º 21
0
    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"
        FateComponent.__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