Пример #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()
Пример #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()
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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
Пример #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