示例#1
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"
        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()
示例#2
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()
示例#3
0
    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"
示例#4
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"
示例#5
0
    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"
示例#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)

        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"
示例#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)

        FeldmanVerifiableSumParam.__init__(self, **new_kwargs)

        self.input = Input(self.name)
        self.output = Output(self.name, has_model=False)
        self._module_name = "FeldmanVerifiableSum"
示例#9
0
    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"
示例#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)

        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"
示例#12
0
    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"
示例#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)

        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"
示例#14
0
    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)

        IntersectParam.__init__(self, **new_kwargs)
        self.input = Input(self.name)
        self.output = Output(self.name, has_model=False)
        self._module_name = "Intersection"
示例#15
0
    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"
示例#16
0
    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)

        LocalBaselineParam.__init__(self, **new_kwargs)
        self.input = Input(self.name, data_type="multi")
        self.output = Output(self.name)
        self._module_name = "LocalBaseline"
示例#17
0
    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):
        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"
示例#19
0
    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"
示例#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)

        HeteroLogisticParam.__init__(self, **new_kwargs)
        self.input = Input(self.name, data_type="multi")
        self.output = Output(self.name)
        self._module_name = "HeteroLR"
示例#21
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
示例#22
0
    def __init__(self, **kwargs):
        FateFlowComponent.__init__(self, **kwargs)

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

        new_kwargs = self.erase_component_base_param(**kwargs)

        CacheLoaderParam.__init__(self, **new_kwargs)
        self.input = Input(self.name)
        self.output = Output(self.name,
                             has_model=False,
                             has_cache=True,
                             has_data=False)
        self._module_name = "CacheLoader"
示例#23
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