repo
stringlengths 2
99
| file
stringlengths 13
225
| code
stringlengths 0
18.3M
| file_length
int64 0
18.3M
| avg_line_length
float64 0
1.36M
| max_line_length
int64 0
4.26M
| extension_type
stringclasses 1
value |
---|---|---|---|---|---|---|
FATE
|
FATE-master/python/federatedml/protobuf/homo_model_convert/pytorch/__init__.py
|
#
# Copyright 2021 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.
#
| 616 | 37.5625 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/ftl_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ftl-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66tl-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"C\n\rFTLModelParam\x12\x13\n\x0bmodel_bytes\x18\x01 \x01(\x0c\x12\r\n\x05phi_a\x18\x02 \x03(\x01\x12\x0e\n\x06header\x18\x03 \x03(\tB\x14\x42\x12\x46TLModelParamProtob\x06proto3')
_FTLMODELPARAM = DESCRIPTOR.message_types_by_name['FTLModelParam']
FTLModelParam = _reflection.GeneratedProtocolMessageType('FTLModelParam', (_message.Message,), {
'DESCRIPTOR' : _FTLMODELPARAM,
'__module__' : 'ftl_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FTLModelParam)
})
_sym_db.RegisterMessage(FTLModelParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\022FTLModelParamProto'
_FTLMODELPARAM._serialized_start=65
_FTLMODELPARAM._serialized_end=132
# @@protoc_insertion_point(module_scope)
| 1,461 | 39.611111 | 314 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/data_io_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: data-io-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x64\x61ta-io-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xdc\x02\n\x0cImputerParam\x12l\n\x15missing_replace_value\x18\x01 \x03(\x0b\x32M.com.webank.ai.fate.core.mlmodel.buffer.ImputerParam.MissingReplaceValueEntry\x12h\n\x13missing_value_ratio\x18\x02 \x03(\x0b\x32K.com.webank.ai.fate.core.mlmodel.buffer.ImputerParam.MissingValueRatioEntry\x1a:\n\x18MissingReplaceValueEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16MissingValueRatioEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"\xdc\x02\n\x0cOutlierParam\x12l\n\x15outlier_replace_value\x18\x01 \x03(\x0b\x32M.com.webank.ai.fate.core.mlmodel.buffer.OutlierParam.OutlierReplaceValueEntry\x12h\n\x13outlier_value_ratio\x18\x02 \x03(\x0b\x32K.com.webank.ai.fate.core.mlmodel.buffer.OutlierParam.OutlierValueRatioEntry\x1a:\n\x18OutlierReplaceValueEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16OutlierValueRatioEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"\xdd\x01\n\x0b\x44\x61taIOParam\x12\x0e\n\x06header\x18\x01 \x03(\t\x12\x10\n\x08sid_name\x18\x02 \x01(\t\x12\x12\n\nlabel_name\x18\x03 \x01(\t\x12K\n\rimputer_param\x18\x04 \x01(\x0b\x32\x34.com.webank.ai.fate.core.mlmodel.buffer.ImputerParam\x12K\n\routlier_param\x18\x05 \x01(\x0b\x32\x34.com.webank.ai.fate.core.mlmodel.buffer.OutlierParamB\x12\x42\x10\x44\x61taIOParamProtob\x06proto3')
_IMPUTERPARAM = DESCRIPTOR.message_types_by_name['ImputerParam']
_IMPUTERPARAM_MISSINGREPLACEVALUEENTRY = _IMPUTERPARAM.nested_types_by_name['MissingReplaceValueEntry']
_IMPUTERPARAM_MISSINGVALUERATIOENTRY = _IMPUTERPARAM.nested_types_by_name['MissingValueRatioEntry']
_OUTLIERPARAM = DESCRIPTOR.message_types_by_name['OutlierParam']
_OUTLIERPARAM_OUTLIERREPLACEVALUEENTRY = _OUTLIERPARAM.nested_types_by_name['OutlierReplaceValueEntry']
_OUTLIERPARAM_OUTLIERVALUERATIOENTRY = _OUTLIERPARAM.nested_types_by_name['OutlierValueRatioEntry']
_DATAIOPARAM = DESCRIPTOR.message_types_by_name['DataIOParam']
ImputerParam = _reflection.GeneratedProtocolMessageType('ImputerParam', (_message.Message,), {
'MissingReplaceValueEntry' : _reflection.GeneratedProtocolMessageType('MissingReplaceValueEntry', (_message.Message,), {
'DESCRIPTOR' : _IMPUTERPARAM_MISSINGREPLACEVALUEENTRY,
'__module__' : 'data_io_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ImputerParam.MissingReplaceValueEntry)
})
,
'MissingValueRatioEntry' : _reflection.GeneratedProtocolMessageType('MissingValueRatioEntry', (_message.Message,), {
'DESCRIPTOR' : _IMPUTERPARAM_MISSINGVALUERATIOENTRY,
'__module__' : 'data_io_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ImputerParam.MissingValueRatioEntry)
})
,
'DESCRIPTOR' : _IMPUTERPARAM,
'__module__' : 'data_io_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ImputerParam)
})
_sym_db.RegisterMessage(ImputerParam)
_sym_db.RegisterMessage(ImputerParam.MissingReplaceValueEntry)
_sym_db.RegisterMessage(ImputerParam.MissingValueRatioEntry)
OutlierParam = _reflection.GeneratedProtocolMessageType('OutlierParam', (_message.Message,), {
'OutlierReplaceValueEntry' : _reflection.GeneratedProtocolMessageType('OutlierReplaceValueEntry', (_message.Message,), {
'DESCRIPTOR' : _OUTLIERPARAM_OUTLIERREPLACEVALUEENTRY,
'__module__' : 'data_io_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OutlierParam.OutlierReplaceValueEntry)
})
,
'OutlierValueRatioEntry' : _reflection.GeneratedProtocolMessageType('OutlierValueRatioEntry', (_message.Message,), {
'DESCRIPTOR' : _OUTLIERPARAM_OUTLIERVALUERATIOENTRY,
'__module__' : 'data_io_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OutlierParam.OutlierValueRatioEntry)
})
,
'DESCRIPTOR' : _OUTLIERPARAM,
'__module__' : 'data_io_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OutlierParam)
})
_sym_db.RegisterMessage(OutlierParam)
_sym_db.RegisterMessage(OutlierParam.OutlierReplaceValueEntry)
_sym_db.RegisterMessage(OutlierParam.OutlierValueRatioEntry)
DataIOParam = _reflection.GeneratedProtocolMessageType('DataIOParam', (_message.Message,), {
'DESCRIPTOR' : _DATAIOPARAM,
'__module__' : 'data_io_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataIOParam)
})
_sym_db.RegisterMessage(DataIOParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\020DataIOParamProto'
_IMPUTERPARAM_MISSINGREPLACEVALUEENTRY._options = None
_IMPUTERPARAM_MISSINGREPLACEVALUEENTRY._serialized_options = b'8\001'
_IMPUTERPARAM_MISSINGVALUERATIOENTRY._options = None
_IMPUTERPARAM_MISSINGVALUERATIOENTRY._serialized_options = b'8\001'
_OUTLIERPARAM_OUTLIERREPLACEVALUEENTRY._options = None
_OUTLIERPARAM_OUTLIERREPLACEVALUEENTRY._serialized_options = b'8\001'
_OUTLIERPARAM_OUTLIERVALUERATIOENTRY._options = None
_OUTLIERPARAM_OUTLIERVALUERATIOENTRY._serialized_options = b'8\001'
_IMPUTERPARAM._serialized_start=64
_IMPUTERPARAM._serialized_end=412
_IMPUTERPARAM_MISSINGREPLACEVALUEENTRY._serialized_start=296
_IMPUTERPARAM_MISSINGREPLACEVALUEENTRY._serialized_end=354
_IMPUTERPARAM_MISSINGVALUERATIOENTRY._serialized_start=356
_IMPUTERPARAM_MISSINGVALUERATIOENTRY._serialized_end=412
_OUTLIERPARAM._serialized_start=415
_OUTLIERPARAM._serialized_end=763
_OUTLIERPARAM_OUTLIERREPLACEVALUEENTRY._serialized_start=647
_OUTLIERPARAM_OUTLIERREPLACEVALUEENTRY._serialized_end=705
_OUTLIERPARAM_OUTLIERVALUERATIOENTRY._serialized_start=707
_OUTLIERPARAM_OUTLIERVALUERATIOENTRY._serialized_end=763
_DATAIOPARAM._serialized_start=766
_DATAIOPARAM._serialized_end=987
# @@protoc_insertion_point(module_scope)
| 6,622 | 60.324074 | 1,565 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/linr_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: linr-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
import sshe_cipher_param_pb2 as sshe__cipher__param__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16linr-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\x1a\x17sshe-cipher-param.proto\"\x9c\x04\n\x0eLinRModelParam\x12\r\n\x05iters\x18\x01 \x01(\x05\x12\x14\n\x0closs_history\x18\x02 \x03(\x01\x12\x14\n\x0cis_converged\x18\x03 \x01(\x08\x12R\n\x06weight\x18\x04 \x03(\x0b\x32\x42.com.webank.ai.fate.core.mlmodel.buffer.LinRModelParam.WeightEntry\x12\x11\n\tintercept\x18\x05 \x01(\x01\x12\x0e\n\x06header\x18\x06 \x03(\t\x12\x16\n\x0e\x62\x65st_iteration\x18\x07 \x01(\x05\x12\x65\n\x10\x65ncrypted_weight\x18\x08 \x03(\x0b\x32K.com.webank.ai.fate.core.mlmodel.buffer.LinRModelParam.EncryptedWeightEntry\x12>\n\x06\x63ipher\x18\t \x01(\x0b\x32..com.webank.ai.fate.core.mlmodel.buffer.Cipher\x1a-\n\x0bWeightEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1aj\n\x14\x45ncryptedWeightEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.com.webank.ai.fate.core.mlmodel.buffer.CipherText:\x02\x38\x01\x42\x15\x42\x13LinRModelParamProtob\x06proto3')
_LINRMODELPARAM = DESCRIPTOR.message_types_by_name['LinRModelParam']
_LINRMODELPARAM_WEIGHTENTRY = _LINRMODELPARAM.nested_types_by_name['WeightEntry']
_LINRMODELPARAM_ENCRYPTEDWEIGHTENTRY = _LINRMODELPARAM.nested_types_by_name['EncryptedWeightEntry']
LinRModelParam = _reflection.GeneratedProtocolMessageType('LinRModelParam', (_message.Message,), {
'WeightEntry' : _reflection.GeneratedProtocolMessageType('WeightEntry', (_message.Message,), {
'DESCRIPTOR' : _LINRMODELPARAM_WEIGHTENTRY,
'__module__' : 'linr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LinRModelParam.WeightEntry)
})
,
'EncryptedWeightEntry' : _reflection.GeneratedProtocolMessageType('EncryptedWeightEntry', (_message.Message,), {
'DESCRIPTOR' : _LINRMODELPARAM_ENCRYPTEDWEIGHTENTRY,
'__module__' : 'linr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LinRModelParam.EncryptedWeightEntry)
})
,
'DESCRIPTOR' : _LINRMODELPARAM,
'__module__' : 'linr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LinRModelParam)
})
_sym_db.RegisterMessage(LinRModelParam)
_sym_db.RegisterMessage(LinRModelParam.WeightEntry)
_sym_db.RegisterMessage(LinRModelParam.EncryptedWeightEntry)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\023LinRModelParamProto'
_LINRMODELPARAM_WEIGHTENTRY._options = None
_LINRMODELPARAM_WEIGHTENTRY._serialized_options = b'8\001'
_LINRMODELPARAM_ENCRYPTEDWEIGHTENTRY._options = None
_LINRMODELPARAM_ENCRYPTEDWEIGHTENTRY._serialized_options = b'8\001'
_LINRMODELPARAM._serialized_start=92
_LINRMODELPARAM._serialized_end=632
_LINRMODELPARAM_WEIGHTENTRY._serialized_start=479
_LINRMODELPARAM_WEIGHTENTRY._serialized_end=524
_LINRMODELPARAM_ENCRYPTEDWEIGHTENTRY._serialized_start=526
_LINRMODELPARAM_ENCRYPTEDWEIGHTENTRY._serialized_end=632
# @@protoc_insertion_point(module_scope)
| 3,714 | 57.968254 | 1,095 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/label_transform_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: label-transform-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1blabel-transform-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xfa\x03\n\x13LabelTransformParam\x12\x64\n\rlabel_encoder\x18\x01 \x03(\x0b\x32M.com.webank.ai.fate.core.mlmodel.buffer.LabelTransformParam.LabelEncoderEntry\x12i\n\x10\x65ncoder_key_type\x18\x02 \x03(\x0b\x32O.com.webank.ai.fate.core.mlmodel.buffer.LabelTransformParam.EncoderKeyTypeEntry\x12m\n\x12\x65ncoder_value_type\x18\x03 \x03(\x0b\x32Q.com.webank.ai.fate.core.mlmodel.buffer.LabelTransformParam.EncoderValueTypeEntry\x1a\x33\n\x11LabelEncoderEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13\x45ncoderKeyTypeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x37\n\x15\x45ncoderValueTypeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x1a\x42\x18LabelTransformParamProtob\x06proto3')
_LABELTRANSFORMPARAM = DESCRIPTOR.message_types_by_name['LabelTransformParam']
_LABELTRANSFORMPARAM_LABELENCODERENTRY = _LABELTRANSFORMPARAM.nested_types_by_name['LabelEncoderEntry']
_LABELTRANSFORMPARAM_ENCODERKEYTYPEENTRY = _LABELTRANSFORMPARAM.nested_types_by_name['EncoderKeyTypeEntry']
_LABELTRANSFORMPARAM_ENCODERVALUETYPEENTRY = _LABELTRANSFORMPARAM.nested_types_by_name['EncoderValueTypeEntry']
LabelTransformParam = _reflection.GeneratedProtocolMessageType('LabelTransformParam', (_message.Message,), {
'LabelEncoderEntry' : _reflection.GeneratedProtocolMessageType('LabelEncoderEntry', (_message.Message,), {
'DESCRIPTOR' : _LABELTRANSFORMPARAM_LABELENCODERENTRY,
'__module__' : 'label_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LabelTransformParam.LabelEncoderEntry)
})
,
'EncoderKeyTypeEntry' : _reflection.GeneratedProtocolMessageType('EncoderKeyTypeEntry', (_message.Message,), {
'DESCRIPTOR' : _LABELTRANSFORMPARAM_ENCODERKEYTYPEENTRY,
'__module__' : 'label_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LabelTransformParam.EncoderKeyTypeEntry)
})
,
'EncoderValueTypeEntry' : _reflection.GeneratedProtocolMessageType('EncoderValueTypeEntry', (_message.Message,), {
'DESCRIPTOR' : _LABELTRANSFORMPARAM_ENCODERVALUETYPEENTRY,
'__module__' : 'label_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LabelTransformParam.EncoderValueTypeEntry)
})
,
'DESCRIPTOR' : _LABELTRANSFORMPARAM,
'__module__' : 'label_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LabelTransformParam)
})
_sym_db.RegisterMessage(LabelTransformParam)
_sym_db.RegisterMessage(LabelTransformParam.LabelEncoderEntry)
_sym_db.RegisterMessage(LabelTransformParam.EncoderKeyTypeEntry)
_sym_db.RegisterMessage(LabelTransformParam.EncoderValueTypeEntry)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\030LabelTransformParamProto'
_LABELTRANSFORMPARAM_LABELENCODERENTRY._options = None
_LABELTRANSFORMPARAM_LABELENCODERENTRY._serialized_options = b'8\001'
_LABELTRANSFORMPARAM_ENCODERKEYTYPEENTRY._options = None
_LABELTRANSFORMPARAM_ENCODERKEYTYPEENTRY._serialized_options = b'8\001'
_LABELTRANSFORMPARAM_ENCODERVALUETYPEENTRY._options = None
_LABELTRANSFORMPARAM_ENCODERVALUETYPEENTRY._serialized_options = b'8\001'
_LABELTRANSFORMPARAM._serialized_start=72
_LABELTRANSFORMPARAM._serialized_end=578
_LABELTRANSFORMPARAM_LABELENCODERENTRY._serialized_start=415
_LABELTRANSFORMPARAM_LABELENCODERENTRY._serialized_end=466
_LABELTRANSFORMPARAM_ENCODERKEYTYPEENTRY._serialized_start=468
_LABELTRANSFORMPARAM_ENCODERKEYTYPEENTRY._serialized_end=521
_LABELTRANSFORMPARAM_ENCODERVALUETYPEENTRY._serialized_start=523
_LABELTRANSFORMPARAM_ENCODERVALUETYPEENTRY._serialized_end=578
# @@protoc_insertion_point(module_scope)
| 4,548 | 59.653333 | 959 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/sir_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sir-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fsir-param.proto\x12(com.webank.ai.fate.common.mlmodel.buffer\"F\n\x1fSecureInformationRetrievalParam\x12\x10\n\x08\x63overage\x18\x01 \x01(\x01\x12\x11\n\tblock_num\x18\x02 \x01(\x03\x42\x0f\x42\rSIRParamProtob\x06proto3')
_SECUREINFORMATIONRETRIEVALPARAM = DESCRIPTOR.message_types_by_name['SecureInformationRetrievalParam']
SecureInformationRetrievalParam = _reflection.GeneratedProtocolMessageType('SecureInformationRetrievalParam', (_message.Message,), {
'DESCRIPTOR' : _SECUREINFORMATIONRETRIEVALPARAM,
'__module__' : 'sir_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.common.mlmodel.buffer.SecureInformationRetrievalParam)
})
_sym_db.RegisterMessage(SecureInformationRetrievalParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\rSIRParamProto'
_SECUREINFORMATIONRETRIEVALPARAM._serialized_start=61
_SECUREINFORMATIONRETRIEVALPARAM._serialized_end=131
# @@protoc_insertion_point(module_scope)
| 1,580 | 42.916667 | 288 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/poisson_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: poisson-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18poisson-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xd4\x01\n\x10PoissonModelMeta\x12\x0f\n\x07penalty\x18\x01 \x01(\t\x12\x0b\n\x03tol\x18\x02 \x01(\x01\x12\r\n\x05\x61lpha\x18\x03 \x01(\x01\x12\x11\n\toptimizer\x18\x04 \x01(\t\x12\x12\n\nbatch_size\x18\x05 \x01(\x03\x12\x15\n\rlearning_rate\x18\x06 \x01(\x01\x12\x10\n\x08max_iter\x18\x07 \x01(\x03\x12\x12\n\nearly_stop\x18\x08 \x01(\t\x12\x15\n\rfit_intercept\x18\t \x01(\x08\x12\x18\n\x10\x65xposure_colname\x18\n \x01(\tB\x17\x42\x15PoissonModelMetaProtob\x06proto3')
_POISSONMODELMETA = DESCRIPTOR.message_types_by_name['PoissonModelMeta']
PoissonModelMeta = _reflection.GeneratedProtocolMessageType('PoissonModelMeta', (_message.Message,), {
'DESCRIPTOR' : _POISSONMODELMETA,
'__module__' : 'poisson_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PoissonModelMeta)
})
_sym_db.RegisterMessage(PoissonModelMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\025PoissonModelMetaProto'
_POISSONMODELMETA._serialized_start=69
_POISSONMODELMETA._serialized_end=281
# @@protoc_insertion_point(module_scope)
| 1,791 | 48.777778 | 608 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/ftl_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ftl-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x66tl-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"6\n\x11\x46TLOptimizerParam\x12\x11\n\toptimizer\x18\x01 \x01(\t\x12\x0e\n\x06kwargs\x18\x02 \x01(\t\"$\n\x0f\x46TLPredictParam\x12\x11\n\tthreshold\x18\x01 \x01(\x01\"\x9e\x02\n\x0c\x46TLModelMeta\x12\x13\n\x0b\x63onfig_type\x18\x01 \x01(\t\x12\x11\n\tnn_define\x18\x02 \x01(\t\x12\x12\n\nbatch_size\x18\x03 \x01(\x05\x12\x0e\n\x06\x65pochs\x18\x04 \x01(\x05\x12\x0b\n\x03tol\x18\x05 \x01(\x01\x12R\n\x0foptimizer_param\x18\x06 \x01(\x0b\x32\x39.com.webank.ai.fate.core.mlmodel.buffer.FTLOptimizerParam\x12N\n\rpredict_param\x18\x07 \x01(\x0b\x32\x37.com.webank.ai.fate.core.mlmodel.buffer.FTLPredictParam\x12\x11\n\tinput_dim\x18\x08 \x01(\x05\x42\x13\x42\x11\x46TLModelMetaProtob\x06proto3')
_FTLOPTIMIZERPARAM = DESCRIPTOR.message_types_by_name['FTLOptimizerParam']
_FTLPREDICTPARAM = DESCRIPTOR.message_types_by_name['FTLPredictParam']
_FTLMODELMETA = DESCRIPTOR.message_types_by_name['FTLModelMeta']
FTLOptimizerParam = _reflection.GeneratedProtocolMessageType('FTLOptimizerParam', (_message.Message,), {
'DESCRIPTOR' : _FTLOPTIMIZERPARAM,
'__module__' : 'ftl_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FTLOptimizerParam)
})
_sym_db.RegisterMessage(FTLOptimizerParam)
FTLPredictParam = _reflection.GeneratedProtocolMessageType('FTLPredictParam', (_message.Message,), {
'DESCRIPTOR' : _FTLPREDICTPARAM,
'__module__' : 'ftl_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FTLPredictParam)
})
_sym_db.RegisterMessage(FTLPredictParam)
FTLModelMeta = _reflection.GeneratedProtocolMessageType('FTLModelMeta', (_message.Message,), {
'DESCRIPTOR' : _FTLMODELMETA,
'__module__' : 'ftl_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FTLModelMeta)
})
_sym_db.RegisterMessage(FTLModelMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\021FTLModelMetaProto'
_FTLOPTIMIZERPARAM._serialized_start=64
_FTLOPTIMIZERPARAM._serialized_end=118
_FTLPREDICTPARAM._serialized_start=120
_FTLPREDICTPARAM._serialized_end=156
_FTLMODELMETA._serialized_start=159
_FTLMODELMETA._serialized_end=445
# @@protoc_insertion_point(module_scope)
| 2,919 | 51.142857 | 828 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/column_expand_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: column-expand-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x63olumn-expand-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"_\n\x10\x43olumnExpandMeta\x12\x15\n\rappend_header\x18\x01 \x03(\t\x12\x0e\n\x06method\x18\x02 \x01(\t\x12\x12\n\nfill_value\x18\x03 \x03(\t\x12\x10\n\x08need_run\x18\x04 \x01(\x08\x42\x17\x42\x15\x43olumnExpandMetaProtob\x06proto3')
_COLUMNEXPANDMETA = DESCRIPTOR.message_types_by_name['ColumnExpandMeta']
ColumnExpandMeta = _reflection.GeneratedProtocolMessageType('ColumnExpandMeta', (_message.Message,), {
'DESCRIPTOR' : _COLUMNEXPANDMETA,
'__module__' : 'column_expand_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ColumnExpandMeta)
})
_sym_db.RegisterMessage(ColumnExpandMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\025ColumnExpandMetaProto'
_COLUMNEXPANDMETA._serialized_start=68
_COLUMNEXPANDMETA._serialized_end=163
# @@protoc_insertion_point(module_scope)
| 1,555 | 42.222222 | 372 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/lr_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lr-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13lr-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\" \n\x0bPredictMeta\x12\x11\n\tthreshold\x18\x01 \x01(\x01\"\xf6\x02\n\x0bLRModelMeta\x12\x0f\n\x07penalty\x18\x01 \x01(\t\x12\x0b\n\x03tol\x18\x02 \x01(\x01\x12\r\n\x05\x61lpha\x18\x03 \x01(\x01\x12\x11\n\toptimizer\x18\x04 \x01(\t\x12\x14\n\x0cparty_weight\x18\x05 \x01(\x01\x12\x12\n\nbatch_size\x18\x06 \x01(\x03\x12\x15\n\rlearning_rate\x18\x07 \x01(\x01\x12\x10\n\x08max_iter\x18\x08 \x01(\x03\x12\x12\n\nearly_stop\x18\t \x01(\t\x12\x1a\n\x12re_encrypt_batches\x18\n \x01(\x03\x12\x15\n\rfit_intercept\x18\x0b \x01(\x08\x12\x18\n\x10need_one_vs_rest\x18\x0c \x01(\x08\x12J\n\rpredict_param\x18\r \x01(\x0b\x32\x33.com.webank.ai.fate.core.mlmodel.buffer.PredictMeta\x12\x17\n\x0freveal_strategy\x18\x0e \x01(\t\x12\x0e\n\x06module\x18\x0f \x01(\tB\x12\x42\x10LRModelMetaProtob\x06proto3')
_PREDICTMETA = DESCRIPTOR.message_types_by_name['PredictMeta']
_LRMODELMETA = DESCRIPTOR.message_types_by_name['LRModelMeta']
PredictMeta = _reflection.GeneratedProtocolMessageType('PredictMeta', (_message.Message,), {
'DESCRIPTOR' : _PREDICTMETA,
'__module__' : 'lr_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PredictMeta)
})
_sym_db.RegisterMessage(PredictMeta)
LRModelMeta = _reflection.GeneratedProtocolMessageType('LRModelMeta', (_message.Message,), {
'DESCRIPTOR' : _LRMODELMETA,
'__module__' : 'lr_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LRModelMeta)
})
_sym_db.RegisterMessage(LRModelMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\020LRModelMetaProto'
_PREDICTMETA._serialized_start=63
_PREDICTMETA._serialized_end=95
_LRMODELMETA._serialized_start=98
_LRMODELMETA._serialized_end=472
# @@protoc_insertion_point(module_scope)
| 2,476 | 52.847826 | 923 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/feature_selection_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feature-selection-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x66\x65\x61ture-selection-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xda\x06\n\x14\x46\x65\x61tureSelectionMeta\x12\x16\n\x0e\x66ilter_methods\x18\x01 \x03(\t\x12\x0c\n\x04\x63ols\x18\x03 \x03(\t\x12L\n\x0bunique_meta\x18\x04 \x01(\x0b\x32\x37.com.webank.ai.fate.core.mlmodel.buffer.UniqueValueMeta\x12S\n\riv_value_meta\x18\x05 \x01(\x0b\x32<.com.webank.ai.fate.core.mlmodel.buffer.IVValueSelectionMeta\x12]\n\x12iv_percentile_meta\x18\x06 \x01(\x0b\x32\x41.com.webank.ai.fate.core.mlmodel.buffer.IVPercentileSelectionMeta\x12]\n\x11variance_coe_meta\x18\x07 \x01(\x0b\x32\x42.com.webank.ai.fate.core.mlmodel.buffer.VarianceOfCoeSelectionMeta\x12V\n\x0coutlier_meta\x18\x08 \x01(\x0b\x32@.com.webank.ai.fate.core.mlmodel.buffer.OutlierColsSelectionMeta\x12Q\n\rmanually_meta\x18\t \x01(\x0b\x32:.com.webank.ai.fate.core.mlmodel.buffer.ManuallyFilterMeta\x12\x10\n\x08need_run\x18\n \x01(\x08\x12`\n\x15pencentage_value_meta\x18\x0b \x01(\x0b\x32\x41.com.webank.ai.fate.core.mlmodel.buffer.PercentageValueFilterMeta\x12R\n\riv_top_k_meta\x18\x0c \x01(\x0b\x32;.com.webank.ai.fate.core.mlmodel.buffer.IVTopKSelectionMeta\x12H\n\x0c\x66ilter_metas\x18\r \x03(\x0b\x32\x32.com.webank.ai.fate.core.mlmodel.buffer.FilterMeta\"\x8c\x01\n\nFilterMeta\x12\x0f\n\x07metrics\x18\x01 \x01(\t\x12\x13\n\x0b\x66ilter_type\x18\x02 \x01(\t\x12\x11\n\ttake_high\x18\x03 \x01(\x08\x12\x11\n\tthreshold\x18\x04 \x01(\x01\x12\x18\n\x10select_federated\x18\x05 \x01(\x08\x12\x18\n\x10\x66ilter_out_names\x18\x06 \x01(\t\"\x1e\n\x0fUniqueValueMeta\x12\x0b\n\x03\x65ps\x18\x01 \x01(\x01\"C\n\x14IVValueSelectionMeta\x12\x17\n\x0fvalue_threshold\x18\x01 \x01(\x01\x12\x12\n\nlocal_only\x18\x02 \x01(\x08\"M\n\x19IVPercentileSelectionMeta\x12\x1c\n\x14percentile_threshold\x18\x01 \x01(\x01\x12\x12\n\nlocal_only\x18\x02 \x01(\x08\"4\n\x13IVTopKSelectionMeta\x12\t\n\x01k\x18\x01 \x01(\x03\x12\x12\n\nlocal_only\x18\x02 \x01(\x08\"5\n\x1aVarianceOfCoeSelectionMeta\x12\x17\n\x0fvalue_threshold\x18\x01 \x01(\x01\"G\n\x18OutlierColsSelectionMeta\x12\x12\n\npercentile\x18\x01 \x01(\x01\x12\x17\n\x0fupper_threshold\x18\x02 \x01(\x01\".\n\x12ManuallyFilterMeta\x12\x18\n\x10\x66ilter_out_names\x18\x01 \x03(\t\".\n\x19PercentageValueFilterMeta\x12\x11\n\tupper_pct\x18\x01 \x01(\x01\x42\x1b\x42\x19\x46\x65\x61tureSelectionMetaProtob\x06proto3')
_FEATURESELECTIONMETA = DESCRIPTOR.message_types_by_name['FeatureSelectionMeta']
_FILTERMETA = DESCRIPTOR.message_types_by_name['FilterMeta']
_UNIQUEVALUEMETA = DESCRIPTOR.message_types_by_name['UniqueValueMeta']
_IVVALUESELECTIONMETA = DESCRIPTOR.message_types_by_name['IVValueSelectionMeta']
_IVPERCENTILESELECTIONMETA = DESCRIPTOR.message_types_by_name['IVPercentileSelectionMeta']
_IVTOPKSELECTIONMETA = DESCRIPTOR.message_types_by_name['IVTopKSelectionMeta']
_VARIANCEOFCOESELECTIONMETA = DESCRIPTOR.message_types_by_name['VarianceOfCoeSelectionMeta']
_OUTLIERCOLSSELECTIONMETA = DESCRIPTOR.message_types_by_name['OutlierColsSelectionMeta']
_MANUALLYFILTERMETA = DESCRIPTOR.message_types_by_name['ManuallyFilterMeta']
_PERCENTAGEVALUEFILTERMETA = DESCRIPTOR.message_types_by_name['PercentageValueFilterMeta']
FeatureSelectionMeta = _reflection.GeneratedProtocolMessageType('FeatureSelectionMeta', (_message.Message,), {
'DESCRIPTOR' : _FEATURESELECTIONMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureSelectionMeta)
})
_sym_db.RegisterMessage(FeatureSelectionMeta)
FilterMeta = _reflection.GeneratedProtocolMessageType('FilterMeta', (_message.Message,), {
'DESCRIPTOR' : _FILTERMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FilterMeta)
})
_sym_db.RegisterMessage(FilterMeta)
UniqueValueMeta = _reflection.GeneratedProtocolMessageType('UniqueValueMeta', (_message.Message,), {
'DESCRIPTOR' : _UNIQUEVALUEMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.UniqueValueMeta)
})
_sym_db.RegisterMessage(UniqueValueMeta)
IVValueSelectionMeta = _reflection.GeneratedProtocolMessageType('IVValueSelectionMeta', (_message.Message,), {
'DESCRIPTOR' : _IVVALUESELECTIONMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.IVValueSelectionMeta)
})
_sym_db.RegisterMessage(IVValueSelectionMeta)
IVPercentileSelectionMeta = _reflection.GeneratedProtocolMessageType('IVPercentileSelectionMeta', (_message.Message,), {
'DESCRIPTOR' : _IVPERCENTILESELECTIONMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.IVPercentileSelectionMeta)
})
_sym_db.RegisterMessage(IVPercentileSelectionMeta)
IVTopKSelectionMeta = _reflection.GeneratedProtocolMessageType('IVTopKSelectionMeta', (_message.Message,), {
'DESCRIPTOR' : _IVTOPKSELECTIONMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.IVTopKSelectionMeta)
})
_sym_db.RegisterMessage(IVTopKSelectionMeta)
VarianceOfCoeSelectionMeta = _reflection.GeneratedProtocolMessageType('VarianceOfCoeSelectionMeta', (_message.Message,), {
'DESCRIPTOR' : _VARIANCEOFCOESELECTIONMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.VarianceOfCoeSelectionMeta)
})
_sym_db.RegisterMessage(VarianceOfCoeSelectionMeta)
OutlierColsSelectionMeta = _reflection.GeneratedProtocolMessageType('OutlierColsSelectionMeta', (_message.Message,), {
'DESCRIPTOR' : _OUTLIERCOLSSELECTIONMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OutlierColsSelectionMeta)
})
_sym_db.RegisterMessage(OutlierColsSelectionMeta)
ManuallyFilterMeta = _reflection.GeneratedProtocolMessageType('ManuallyFilterMeta', (_message.Message,), {
'DESCRIPTOR' : _MANUALLYFILTERMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ManuallyFilterMeta)
})
_sym_db.RegisterMessage(ManuallyFilterMeta)
PercentageValueFilterMeta = _reflection.GeneratedProtocolMessageType('PercentageValueFilterMeta', (_message.Message,), {
'DESCRIPTOR' : _PERCENTAGEVALUEFILTERMETA,
'__module__' : 'feature_selection_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PercentageValueFilterMeta)
})
_sym_db.RegisterMessage(PercentageValueFilterMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\031FeatureSelectionMetaProto'
_FEATURESELECTIONMETA._serialized_start=73
_FEATURESELECTIONMETA._serialized_end=931
_FILTERMETA._serialized_start=934
_FILTERMETA._serialized_end=1074
_UNIQUEVALUEMETA._serialized_start=1076
_UNIQUEVALUEMETA._serialized_end=1106
_IVVALUESELECTIONMETA._serialized_start=1108
_IVVALUESELECTIONMETA._serialized_end=1175
_IVPERCENTILESELECTIONMETA._serialized_start=1177
_IVPERCENTILESELECTIONMETA._serialized_end=1254
_IVTOPKSELECTIONMETA._serialized_start=1256
_IVTOPKSELECTIONMETA._serialized_end=1308
_VARIANCEOFCOESELECTIONMETA._serialized_start=1310
_VARIANCEOFCOESELECTIONMETA._serialized_end=1363
_OUTLIERCOLSSELECTIONMETA._serialized_start=1365
_OUTLIERCOLSSELECTIONMETA._serialized_end=1436
_MANUALLYFILTERMETA._serialized_start=1438
_MANUALLYFILTERMETA._serialized_end=1484
_PERCENTAGEVALUEFILTERMETA._serialized_start=1486
_PERCENTAGEVALUEFILTERMETA._serialized_end=1532
# @@protoc_insertion_point(module_scope)
| 8,363 | 65.380952 | 2,399 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/data_transform_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: data-transform-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19\x64\x61ta-transform-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"W\n\x18\x44\x61taTransformImputerMeta\x12\x12\n\nis_imputer\x18\x01 \x01(\x08\x12\x10\n\x08strategy\x18\x02 \x01(\t\x12\x15\n\rmissing_value\x18\x03 \x03(\t\"W\n\x18\x44\x61taTransformOutlierMeta\x12\x12\n\nis_outlier\x18\x01 \x01(\x08\x12\x10\n\x08strategy\x18\x02 \x01(\t\x12\x15\n\routlier_value\x18\x03 \x03(\t\"\xd9\x04\n\x11\x44\x61taTransformMeta\x12\x14\n\x0cinput_format\x18\x01 \x01(\t\x12\x11\n\tdelimitor\x18\x02 \x01(\t\x12\x11\n\tdata_type\x18\x03 \x01(\t\x12\x16\n\x0etag_with_value\x18\x04 \x01(\x08\x12\x1b\n\x13tag_value_delimitor\x18\x05 \x01(\t\x12\x12\n\nwith_label\x18\x06 \x01(\x08\x12\x12\n\nlabel_name\x18\x07 \x01(\t\x12\x12\n\nlabel_type\x18\x08 \x01(\t\x12\x15\n\routput_format\x18\t \x01(\t\x12V\n\x0cimputer_meta\x18\n \x01(\x0b\x32@.com.webank.ai.fate.core.mlmodel.buffer.DataTransformImputerMeta\x12V\n\x0coutlier_meta\x18\x0b \x01(\x0b\x32@.com.webank.ai.fate.core.mlmodel.buffer.DataTransformOutlierMeta\x12\x10\n\x08need_run\x18\x0c \x01(\x08\x12m\n\x13\x65xclusive_data_type\x18\r \x03(\x0b\x32P.com.webank.ai.fate.core.mlmodel.buffer.DataTransformMeta.ExclusiveDataTypeEntry\x12\x15\n\rwith_match_id\x18\x0e \x01(\x08\x1a\x38\n\x16\x45xclusiveDataTypeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x11\x42\x0f\x44\x61taIOMetaProtob\x06proto3')
_DATATRANSFORMIMPUTERMETA = DESCRIPTOR.message_types_by_name['DataTransformImputerMeta']
_DATATRANSFORMOUTLIERMETA = DESCRIPTOR.message_types_by_name['DataTransformOutlierMeta']
_DATATRANSFORMMETA = DESCRIPTOR.message_types_by_name['DataTransformMeta']
_DATATRANSFORMMETA_EXCLUSIVEDATATYPEENTRY = _DATATRANSFORMMETA.nested_types_by_name['ExclusiveDataTypeEntry']
DataTransformImputerMeta = _reflection.GeneratedProtocolMessageType('DataTransformImputerMeta', (_message.Message,), {
'DESCRIPTOR' : _DATATRANSFORMIMPUTERMETA,
'__module__' : 'data_transform_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformImputerMeta)
})
_sym_db.RegisterMessage(DataTransformImputerMeta)
DataTransformOutlierMeta = _reflection.GeneratedProtocolMessageType('DataTransformOutlierMeta', (_message.Message,), {
'DESCRIPTOR' : _DATATRANSFORMOUTLIERMETA,
'__module__' : 'data_transform_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformOutlierMeta)
})
_sym_db.RegisterMessage(DataTransformOutlierMeta)
DataTransformMeta = _reflection.GeneratedProtocolMessageType('DataTransformMeta', (_message.Message,), {
'ExclusiveDataTypeEntry' : _reflection.GeneratedProtocolMessageType('ExclusiveDataTypeEntry', (_message.Message,), {
'DESCRIPTOR' : _DATATRANSFORMMETA_EXCLUSIVEDATATYPEENTRY,
'__module__' : 'data_transform_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformMeta.ExclusiveDataTypeEntry)
})
,
'DESCRIPTOR' : _DATATRANSFORMMETA,
'__module__' : 'data_transform_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformMeta)
})
_sym_db.RegisterMessage(DataTransformMeta)
_sym_db.RegisterMessage(DataTransformMeta.ExclusiveDataTypeEntry)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\017DataIOMetaProto'
_DATATRANSFORMMETA_EXCLUSIVEDATATYPEENTRY._options = None
_DATATRANSFORMMETA_EXCLUSIVEDATATYPEENTRY._serialized_options = b'8\001'
_DATATRANSFORMIMPUTERMETA._serialized_start=69
_DATATRANSFORMIMPUTERMETA._serialized_end=156
_DATATRANSFORMOUTLIERMETA._serialized_start=158
_DATATRANSFORMOUTLIERMETA._serialized_end=245
_DATATRANSFORMMETA._serialized_start=248
_DATATRANSFORMMETA._serialized_end=849
_DATATRANSFORMMETA_EXCLUSIVEDATATYPEENTRY._serialized_start=793
_DATATRANSFORMMETA_EXCLUSIVEDATATYPEENTRY._serialized_end=849
# @@protoc_insertion_point(module_scope)
| 4,565 | 65.173913 | 1,464 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/boosting_tree_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: boosting-tree-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1e\x62oosting-tree-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"1\n\rObjectiveMeta\x12\x11\n\tobjective\x18\x01 \x01(\t\x12\r\n\x05param\x18\x02 \x03(\x01\"B\n\rCriterionMeta\x12\x18\n\x10\x63riterion_method\x18\x01 \x01(\t\x12\x17\n\x0f\x63riterion_param\x18\x02 \x03(\x01\"\xf4\x01\n\x15\x44\x65\x63isionTreeModelMeta\x12M\n\x0e\x63riterion_meta\x18\x01 \x01(\x0b\x32\x35.com.webank.ai.fate.core.mlmodel.buffer.CriterionMeta\x12\x11\n\tmax_depth\x18\x02 \x01(\x05\x12\x18\n\x10min_sample_split\x18\x03 \x01(\x05\x12\x1a\n\x12min_impurity_split\x18\x04 \x01(\x01\x12\x15\n\rmin_leaf_node\x18\x05 \x01(\x05\x12\x13\n\x0buse_missing\x18\x06 \x01(\x08\x12\x17\n\x0fzero_as_missing\x18\x07 \x01(\x08\"8\n\x0cQuantileMeta\x12\x17\n\x0fquantile_method\x18\x01 \x01(\t\x12\x0f\n\x07\x62in_num\x18\x02 \x01(\x05\"\xd5\x03\n\x15\x42oostingTreeModelMeta\x12P\n\ttree_meta\x18\x01 \x01(\x0b\x32=.com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelMeta\x12\x15\n\rlearning_rate\x18\x02 \x01(\x01\x12\x11\n\tnum_trees\x18\x03 \x01(\x05\x12K\n\rquantile_meta\x18\x04 \x01(\x0b\x32\x34.com.webank.ai.fate.core.mlmodel.buffer.QuantileMeta\x12M\n\x0eobjective_meta\x18\x05 \x01(\x0b\x32\x35.com.webank.ai.fate.core.mlmodel.buffer.ObjectiveMeta\x12\x11\n\ttask_type\x18\x06 \x01(\t\x12\x18\n\x10n_iter_no_change\x18\x07 \x01(\x08\x12\x0b\n\x03tol\x18\x08 \x01(\x01\x12\x13\n\x0buse_missing\x18\t \x01(\x08\x12\x17\n\x0fzero_as_missing\x18\n \x01(\x08\x12\x11\n\twork_mode\x18\x0b \x01(\t\x12\x0e\n\x06module\x18\x0c \x01(\t\x12\x19\n\x11\x62oosting_strategy\x18\r \x01(\t\"w\n\x0fTransformerMeta\x12P\n\ttree_meta\x18\x01 \x01(\x0b\x32=.com.webank.ai.fate.core.mlmodel.buffer.BoostingTreeModelMeta\x12\x12\n\nmodel_name\x18\x02 \x01(\tB\x19\x42\x17\x42oostTreeModelMetaProtob\x06proto3')
_OBJECTIVEMETA = DESCRIPTOR.message_types_by_name['ObjectiveMeta']
_CRITERIONMETA = DESCRIPTOR.message_types_by_name['CriterionMeta']
_DECISIONTREEMODELMETA = DESCRIPTOR.message_types_by_name['DecisionTreeModelMeta']
_QUANTILEMETA = DESCRIPTOR.message_types_by_name['QuantileMeta']
_BOOSTINGTREEMODELMETA = DESCRIPTOR.message_types_by_name['BoostingTreeModelMeta']
_TRANSFORMERMETA = DESCRIPTOR.message_types_by_name['TransformerMeta']
ObjectiveMeta = _reflection.GeneratedProtocolMessageType('ObjectiveMeta', (_message.Message,), {
'DESCRIPTOR' : _OBJECTIVEMETA,
'__module__' : 'boosting_tree_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ObjectiveMeta)
})
_sym_db.RegisterMessage(ObjectiveMeta)
CriterionMeta = _reflection.GeneratedProtocolMessageType('CriterionMeta', (_message.Message,), {
'DESCRIPTOR' : _CRITERIONMETA,
'__module__' : 'boosting_tree_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.CriterionMeta)
})
_sym_db.RegisterMessage(CriterionMeta)
DecisionTreeModelMeta = _reflection.GeneratedProtocolMessageType('DecisionTreeModelMeta', (_message.Message,), {
'DESCRIPTOR' : _DECISIONTREEMODELMETA,
'__module__' : 'boosting_tree_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelMeta)
})
_sym_db.RegisterMessage(DecisionTreeModelMeta)
QuantileMeta = _reflection.GeneratedProtocolMessageType('QuantileMeta', (_message.Message,), {
'DESCRIPTOR' : _QUANTILEMETA,
'__module__' : 'boosting_tree_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.QuantileMeta)
})
_sym_db.RegisterMessage(QuantileMeta)
BoostingTreeModelMeta = _reflection.GeneratedProtocolMessageType('BoostingTreeModelMeta', (_message.Message,), {
'DESCRIPTOR' : _BOOSTINGTREEMODELMETA,
'__module__' : 'boosting_tree_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.BoostingTreeModelMeta)
})
_sym_db.RegisterMessage(BoostingTreeModelMeta)
TransformerMeta = _reflection.GeneratedProtocolMessageType('TransformerMeta', (_message.Message,), {
'DESCRIPTOR' : _TRANSFORMERMETA,
'__module__' : 'boosting_tree_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.TransformerMeta)
})
_sym_db.RegisterMessage(TransformerMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\027BoostTreeModelMetaProto'
_OBJECTIVEMETA._serialized_start=74
_OBJECTIVEMETA._serialized_end=123
_CRITERIONMETA._serialized_start=125
_CRITERIONMETA._serialized_end=191
_DECISIONTREEMODELMETA._serialized_start=194
_DECISIONTREEMODELMETA._serialized_end=438
_QUANTILEMETA._serialized_start=440
_QUANTILEMETA._serialized_end=496
_BOOSTINGTREEMODELMETA._serialized_start=499
_BOOSTINGTREEMODELMETA._serialized_end=968
_TRANSFORMERMETA._serialized_start=970
_TRANSFORMERMETA._serialized_end=1089
# @@protoc_insertion_point(module_scope)
| 5,484 | 62.77907 | 1,855 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/pearson_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pearson-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18pearson-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\"\n\x10PearsonModelMeta\x12\x0e\n\x06shapes\x18\x01 \x03(\x05\x42\x17\x42\x15PearsonModelMetaProtob\x06proto3')
_PEARSONMODELMETA = DESCRIPTOR.message_types_by_name['PearsonModelMeta']
PearsonModelMeta = _reflection.GeneratedProtocolMessageType('PearsonModelMeta', (_message.Message,), {
'DESCRIPTOR' : _PEARSONMODELMETA,
'__module__' : 'pearson_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PearsonModelMeta)
})
_sym_db.RegisterMessage(PearsonModelMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\025PearsonModelMetaProto'
_PEARSONMODELMETA._serialized_start=68
_PEARSONMODELMETA._serialized_end=102
# @@protoc_insertion_point(module_scope)
| 1,430 | 38.75 | 247 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/data_transform_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: data-transform-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x64\x61ta-transform-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\x83\x03\n\x19\x44\x61taTransformImputerParam\x12y\n\x15missing_replace_value\x18\x01 \x03(\x0b\x32Z.com.webank.ai.fate.core.mlmodel.buffer.DataTransformImputerParam.MissingReplaceValueEntry\x12u\n\x13missing_value_ratio\x18\x02 \x03(\x0b\x32X.com.webank.ai.fate.core.mlmodel.buffer.DataTransformImputerParam.MissingValueRatioEntry\x1a:\n\x18MissingReplaceValueEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16MissingValueRatioEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"\x83\x03\n\x19\x44\x61taTransformOutlierParam\x12y\n\x15outlier_replace_value\x18\x01 \x03(\x0b\x32Z.com.webank.ai.fate.core.mlmodel.buffer.DataTransformOutlierParam.OutlierReplaceValueEntry\x12u\n\x13outlier_value_ratio\x18\x02 \x03(\x0b\x32X.com.webank.ai.fate.core.mlmodel.buffer.DataTransformOutlierParam.OutlierValueRatioEntry\x1a:\n\x18OutlierReplaceValueEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16OutlierValueRatioEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"\x98\x02\n\x12\x44\x61taTransformParam\x12\x0e\n\x06header\x18\x01 \x03(\t\x12\x10\n\x08sid_name\x18\x02 \x01(\t\x12\x12\n\nlabel_name\x18\x03 \x01(\t\x12X\n\rimputer_param\x18\x04 \x01(\x0b\x32\x41.com.webank.ai.fate.core.mlmodel.buffer.DataTransformImputerParam\x12X\n\routlier_param\x18\x05 \x01(\x0b\x32\x41.com.webank.ai.fate.core.mlmodel.buffer.DataTransformOutlierParam\x12\x18\n\x10\x61nonymous_header\x18\x06 \x03(\tB\x12\x42\x10\x44\x61taIOParamProtob\x06proto3')
_DATATRANSFORMIMPUTERPARAM = DESCRIPTOR.message_types_by_name['DataTransformImputerParam']
_DATATRANSFORMIMPUTERPARAM_MISSINGREPLACEVALUEENTRY = _DATATRANSFORMIMPUTERPARAM.nested_types_by_name['MissingReplaceValueEntry']
_DATATRANSFORMIMPUTERPARAM_MISSINGVALUERATIOENTRY = _DATATRANSFORMIMPUTERPARAM.nested_types_by_name['MissingValueRatioEntry']
_DATATRANSFORMOUTLIERPARAM = DESCRIPTOR.message_types_by_name['DataTransformOutlierParam']
_DATATRANSFORMOUTLIERPARAM_OUTLIERREPLACEVALUEENTRY = _DATATRANSFORMOUTLIERPARAM.nested_types_by_name['OutlierReplaceValueEntry']
_DATATRANSFORMOUTLIERPARAM_OUTLIERVALUERATIOENTRY = _DATATRANSFORMOUTLIERPARAM.nested_types_by_name['OutlierValueRatioEntry']
_DATATRANSFORMPARAM = DESCRIPTOR.message_types_by_name['DataTransformParam']
DataTransformImputerParam = _reflection.GeneratedProtocolMessageType('DataTransformImputerParam', (_message.Message,), {
'MissingReplaceValueEntry' : _reflection.GeneratedProtocolMessageType('MissingReplaceValueEntry', (_message.Message,), {
'DESCRIPTOR' : _DATATRANSFORMIMPUTERPARAM_MISSINGREPLACEVALUEENTRY,
'__module__' : 'data_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformImputerParam.MissingReplaceValueEntry)
})
,
'MissingValueRatioEntry' : _reflection.GeneratedProtocolMessageType('MissingValueRatioEntry', (_message.Message,), {
'DESCRIPTOR' : _DATATRANSFORMIMPUTERPARAM_MISSINGVALUERATIOENTRY,
'__module__' : 'data_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformImputerParam.MissingValueRatioEntry)
})
,
'DESCRIPTOR' : _DATATRANSFORMIMPUTERPARAM,
'__module__' : 'data_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformImputerParam)
})
_sym_db.RegisterMessage(DataTransformImputerParam)
_sym_db.RegisterMessage(DataTransformImputerParam.MissingReplaceValueEntry)
_sym_db.RegisterMessage(DataTransformImputerParam.MissingValueRatioEntry)
DataTransformOutlierParam = _reflection.GeneratedProtocolMessageType('DataTransformOutlierParam', (_message.Message,), {
'OutlierReplaceValueEntry' : _reflection.GeneratedProtocolMessageType('OutlierReplaceValueEntry', (_message.Message,), {
'DESCRIPTOR' : _DATATRANSFORMOUTLIERPARAM_OUTLIERREPLACEVALUEENTRY,
'__module__' : 'data_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformOutlierParam.OutlierReplaceValueEntry)
})
,
'OutlierValueRatioEntry' : _reflection.GeneratedProtocolMessageType('OutlierValueRatioEntry', (_message.Message,), {
'DESCRIPTOR' : _DATATRANSFORMOUTLIERPARAM_OUTLIERVALUERATIOENTRY,
'__module__' : 'data_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformOutlierParam.OutlierValueRatioEntry)
})
,
'DESCRIPTOR' : _DATATRANSFORMOUTLIERPARAM,
'__module__' : 'data_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformOutlierParam)
})
_sym_db.RegisterMessage(DataTransformOutlierParam)
_sym_db.RegisterMessage(DataTransformOutlierParam.OutlierReplaceValueEntry)
_sym_db.RegisterMessage(DataTransformOutlierParam.OutlierValueRatioEntry)
DataTransformParam = _reflection.GeneratedProtocolMessageType('DataTransformParam', (_message.Message,), {
'DESCRIPTOR' : _DATATRANSFORMPARAM,
'__module__' : 'data_transform_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataTransformParam)
})
_sym_db.RegisterMessage(DataTransformParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\020DataIOParamProto'
_DATATRANSFORMIMPUTERPARAM_MISSINGREPLACEVALUEENTRY._options = None
_DATATRANSFORMIMPUTERPARAM_MISSINGREPLACEVALUEENTRY._serialized_options = b'8\001'
_DATATRANSFORMIMPUTERPARAM_MISSINGVALUERATIOENTRY._options = None
_DATATRANSFORMIMPUTERPARAM_MISSINGVALUERATIOENTRY._serialized_options = b'8\001'
_DATATRANSFORMOUTLIERPARAM_OUTLIERREPLACEVALUEENTRY._options = None
_DATATRANSFORMOUTLIERPARAM_OUTLIERREPLACEVALUEENTRY._serialized_options = b'8\001'
_DATATRANSFORMOUTLIERPARAM_OUTLIERVALUERATIOENTRY._options = None
_DATATRANSFORMOUTLIERPARAM_OUTLIERVALUERATIOENTRY._serialized_options = b'8\001'
_DATATRANSFORMIMPUTERPARAM._serialized_start=71
_DATATRANSFORMIMPUTERPARAM._serialized_end=458
_DATATRANSFORMIMPUTERPARAM_MISSINGREPLACEVALUEENTRY._serialized_start=342
_DATATRANSFORMIMPUTERPARAM_MISSINGREPLACEVALUEENTRY._serialized_end=400
_DATATRANSFORMIMPUTERPARAM_MISSINGVALUERATIOENTRY._serialized_start=402
_DATATRANSFORMIMPUTERPARAM_MISSINGVALUERATIOENTRY._serialized_end=458
_DATATRANSFORMOUTLIERPARAM._serialized_start=461
_DATATRANSFORMOUTLIERPARAM._serialized_end=848
_DATATRANSFORMOUTLIERPARAM_OUTLIERREPLACEVALUEENTRY._serialized_start=732
_DATATRANSFORMOUTLIERPARAM_OUTLIERREPLACEVALUEENTRY._serialized_end=790
_DATATRANSFORMOUTLIERPARAM_OUTLIERVALUERATIOENTRY._serialized_start=792
_DATATRANSFORMOUTLIERPARAM_OUTLIERVALUERATIOENTRY._serialized_end=848
_DATATRANSFORMPARAM._serialized_start=851
_DATATRANSFORMPARAM._serialized_end=1131
# @@protoc_insertion_point(module_scope)
| 7,623 | 69.592593 | 1,744 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/sample_weight_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sample-weight-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1esample-weight-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"X\n\x15SampleWeightModelMeta\x12\x1a\n\x12sample_weight_name\x18\x01 \x01(\t\x12\x11\n\tnormalize\x18\x02 \x01(\x08\x12\x10\n\x08need_run\x18\x03 \x01(\x08\x42\x1c\x42\x1aSampleWeightModelMetaProtob\x06proto3')
_SAMPLEWEIGHTMODELMETA = DESCRIPTOR.message_types_by_name['SampleWeightModelMeta']
SampleWeightModelMeta = _reflection.GeneratedProtocolMessageType('SampleWeightModelMeta', (_message.Message,), {
'DESCRIPTOR' : _SAMPLEWEIGHTMODELMETA,
'__module__' : 'sample_weight_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.SampleWeightModelMeta)
})
_sym_db.RegisterMessage(SampleWeightModelMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\032SampleWeightModelMetaProto'
_SAMPLEWEIGHTMODELMETA._serialized_start=74
_SAMPLEWEIGHTMODELMETA._serialized_end=162
# @@protoc_insertion_point(module_scope)
| 1,596 | 43.361111 | 351 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/hetero_nn_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hetero-nn-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bhetero-nn-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xb8\x01\n\x15InteractiveLayerParam\x12\x11\n\tacc_noise\x18\x01 \x01(\x0c\x12+\n#interactive_guest_saved_model_bytes\x18\x02 \x01(\x0c\x12*\n\"interactive_host_saved_model_bytes\x18\x03 \x03(\x0c\x12\x18\n\x10host_input_shape\x18\x04 \x03(\x05\x12\x19\n\x11guest_input_shape\x18\x05 \x01(\x05\"\x9c\x02\n\x12HeteroNNModelParam\x12 \n\x18\x62ottom_saved_model_bytes\x18\x01 \x01(\x0c\x12^\n\x17interactive_layer_param\x18\x02 \x01(\x0b\x32=.com.webank.ai.fate.core.mlmodel.buffer.InteractiveLayerParam\x12\x1d\n\x15top_saved_model_bytes\x18\x03 \x01(\x0c\x12\x10\n\x08is_empty\x18\x04 \x01(\x08\x12 \n\x18\x62ottom_model_input_shape\x18\x05 \x01(\x05\x12\x1d\n\x15top_model_input_shape\x18\x06 \x01(\x05\x12\x12\n\ncoae_bytes\x18\x07 \x01(\x0c\"\xe5\x01\n\rHeteroNNParam\x12Y\n\x15hetero_nn_model_param\x18\x01 \x01(\x0b\x32:.com.webank.ai.fate.core.mlmodel.buffer.HeteroNNModelParam\x12\x12\n\niter_epoch\x18\x02 \x01(\x05\x12\x14\n\x0chistory_loss\x18\x03 \x03(\x01\x12\x14\n\x0cis_converged\x18\x04 \x01(\x08\x12\x0e\n\x06header\x18\x05 \x03(\t\x12\x11\n\tnum_label\x18\x06 \x01(\x05\x12\x16\n\x0e\x62\x65st_iteration\x18\x07 \x01(\x05\x42\x19\x42\x17HeteroNNModelParamProtob\x06proto3')
_INTERACTIVELAYERPARAM = DESCRIPTOR.message_types_by_name['InteractiveLayerParam']
_HETERONNMODELPARAM = DESCRIPTOR.message_types_by_name['HeteroNNModelParam']
_HETERONNPARAM = DESCRIPTOR.message_types_by_name['HeteroNNParam']
InteractiveLayerParam = _reflection.GeneratedProtocolMessageType('InteractiveLayerParam', (_message.Message,), {
'DESCRIPTOR' : _INTERACTIVELAYERPARAM,
'__module__' : 'hetero_nn_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.InteractiveLayerParam)
})
_sym_db.RegisterMessage(InteractiveLayerParam)
HeteroNNModelParam = _reflection.GeneratedProtocolMessageType('HeteroNNModelParam', (_message.Message,), {
'DESCRIPTOR' : _HETERONNMODELPARAM,
'__module__' : 'hetero_nn_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.HeteroNNModelParam)
})
_sym_db.RegisterMessage(HeteroNNModelParam)
HeteroNNParam = _reflection.GeneratedProtocolMessageType('HeteroNNParam', (_message.Message,), {
'DESCRIPTOR' : _HETERONNPARAM,
'__module__' : 'hetero_nn_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.HeteroNNParam)
})
_sym_db.RegisterMessage(HeteroNNParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\027HeteroNNModelParamProto'
_INTERACTIVELAYERPARAM._serialized_start=72
_INTERACTIVELAYERPARAM._serialized_end=256
_HETERONNMODELPARAM._serialized_start=259
_HETERONNMODELPARAM._serialized_end=543
_HETERONNPARAM._serialized_start=546
_HETERONNPARAM._serialized_end=775
# @@protoc_insertion_point(module_scope)
| 3,525 | 61.964286 | 1,328 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/poisson_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: poisson-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19poisson-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\x8f\x02\n\x11PoissonModelParam\x12\r\n\x05iters\x18\x01 \x01(\x05\x12\x14\n\x0closs_history\x18\x02 \x03(\x01\x12\x14\n\x0cis_converged\x18\x03 \x01(\x08\x12U\n\x06weight\x18\x04 \x03(\x0b\x32\x45.com.webank.ai.fate.core.mlmodel.buffer.PoissonModelParam.WeightEntry\x12\x11\n\tintercept\x18\x05 \x01(\x01\x12\x0e\n\x06header\x18\x06 \x03(\t\x12\x16\n\x0e\x62\x65st_iteration\x18\x07 \x01(\x05\x1a-\n\x0bWeightEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x42\x18\x42\x16PoissonModelParamProtob\x06proto3')
_POISSONMODELPARAM = DESCRIPTOR.message_types_by_name['PoissonModelParam']
_POISSONMODELPARAM_WEIGHTENTRY = _POISSONMODELPARAM.nested_types_by_name['WeightEntry']
PoissonModelParam = _reflection.GeneratedProtocolMessageType('PoissonModelParam', (_message.Message,), {
'WeightEntry' : _reflection.GeneratedProtocolMessageType('WeightEntry', (_message.Message,), {
'DESCRIPTOR' : _POISSONMODELPARAM_WEIGHTENTRY,
'__module__' : 'poisson_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PoissonModelParam.WeightEntry)
})
,
'DESCRIPTOR' : _POISSONMODELPARAM,
'__module__' : 'poisson_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PoissonModelParam)
})
_sym_db.RegisterMessage(PoissonModelParam)
_sym_db.RegisterMessage(PoissonModelParam.WeightEntry)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\026PoissonModelParamProto'
_POISSONMODELPARAM_WEIGHTENTRY._options = None
_POISSONMODELPARAM_WEIGHTENTRY._serialized_options = b'8\001'
_POISSONMODELPARAM._serialized_start=70
_POISSONMODELPARAM._serialized_end=341
_POISSONMODELPARAM_WEIGHTENTRY._serialized_start=296
_POISSONMODELPARAM_WEIGHTENTRY._serialized_end=341
# @@protoc_insertion_point(module_scope)
| 2,560 | 51.265306 | 683 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/sample_weight_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sample-weight-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fsample-weight-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xd8\x01\n\x16SampleWeightModelParam\x12\x0e\n\x06header\x18\x01 \x03(\t\x12\x13\n\x0bweight_mode\x18\x02 \x01(\t\x12\x65\n\x0c\x63lass_weight\x18\x03 \x03(\x0b\x32O.com.webank.ai.fate.core.mlmodel.buffer.SampleWeightModelParam.ClassWeightEntry\x1a\x32\n\x10\x43lassWeightEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x42\x1d\x42\x1bSampleWeightModelParamProtob\x06proto3')
_SAMPLEWEIGHTMODELPARAM = DESCRIPTOR.message_types_by_name['SampleWeightModelParam']
_SAMPLEWEIGHTMODELPARAM_CLASSWEIGHTENTRY = _SAMPLEWEIGHTMODELPARAM.nested_types_by_name['ClassWeightEntry']
SampleWeightModelParam = _reflection.GeneratedProtocolMessageType('SampleWeightModelParam', (_message.Message,), {
'ClassWeightEntry' : _reflection.GeneratedProtocolMessageType('ClassWeightEntry', (_message.Message,), {
'DESCRIPTOR' : _SAMPLEWEIGHTMODELPARAM_CLASSWEIGHTENTRY,
'__module__' : 'sample_weight_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.SampleWeightModelParam.ClassWeightEntry)
})
,
'DESCRIPTOR' : _SAMPLEWEIGHTMODELPARAM,
'__module__' : 'sample_weight_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.SampleWeightModelParam)
})
_sym_db.RegisterMessage(SampleWeightModelParam)
_sym_db.RegisterMessage(SampleWeightModelParam.ClassWeightEntry)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\033SampleWeightModelParamProto'
_SAMPLEWEIGHTMODELPARAM_CLASSWEIGHTENTRY._options = None
_SAMPLEWEIGHTMODELPARAM_CLASSWEIGHTENTRY._serialized_options = b'8\001'
_SAMPLEWEIGHTMODELPARAM._serialized_start=76
_SAMPLEWEIGHTMODELPARAM._serialized_end=292
_SAMPLEWEIGHTMODELPARAM_CLASSWEIGHTENTRY._serialized_start=242
_SAMPLEWEIGHTMODELPARAM_CLASSWEIGHTENTRY._serialized_end=292
# @@protoc_insertion_point(module_scope)
| 2,601 | 52.102041 | 556 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/feature_imputation_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feature-imputation-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x66\x65\x61ture-imputation-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\x87\x02\n\x12\x46\x65\x61tureImputerMeta\x12\x12\n\nis_imputer\x18\x01 \x01(\x08\x12\x10\n\x08strategy\x18\x02 \x01(\t\x12\x15\n\rmissing_value\x18\x03 \x03(\t\x12\x1a\n\x12missing_value_type\x18\x04 \x03(\t\x12\x63\n\rcols_strategy\x18\x05 \x03(\x0b\x32L.com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerMeta.ColsStrategyEntry\x1a\x33\n\x11\x43olsStrategyEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"{\n\x15\x46\x65\x61tureImputationMeta\x12P\n\x0cimputer_meta\x18\x01 \x01(\x0b\x32:.com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerMeta\x12\x10\n\x08need_run\x18\x02 \x01(\x08\x42\x1c\x42\x1a\x46\x65\x61tureImputationMetaProtob\x06proto3')
_FEATUREIMPUTERMETA = DESCRIPTOR.message_types_by_name['FeatureImputerMeta']
_FEATUREIMPUTERMETA_COLSSTRATEGYENTRY = _FEATUREIMPUTERMETA.nested_types_by_name['ColsStrategyEntry']
_FEATUREIMPUTATIONMETA = DESCRIPTOR.message_types_by_name['FeatureImputationMeta']
FeatureImputerMeta = _reflection.GeneratedProtocolMessageType('FeatureImputerMeta', (_message.Message,), {
'ColsStrategyEntry' : _reflection.GeneratedProtocolMessageType('ColsStrategyEntry', (_message.Message,), {
'DESCRIPTOR' : _FEATUREIMPUTERMETA_COLSSTRATEGYENTRY,
'__module__' : 'feature_imputation_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerMeta.ColsStrategyEntry)
})
,
'DESCRIPTOR' : _FEATUREIMPUTERMETA,
'__module__' : 'feature_imputation_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerMeta)
})
_sym_db.RegisterMessage(FeatureImputerMeta)
_sym_db.RegisterMessage(FeatureImputerMeta.ColsStrategyEntry)
FeatureImputationMeta = _reflection.GeneratedProtocolMessageType('FeatureImputationMeta', (_message.Message,), {
'DESCRIPTOR' : _FEATUREIMPUTATIONMETA,
'__module__' : 'feature_imputation_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImputationMeta)
})
_sym_db.RegisterMessage(FeatureImputationMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\032FeatureImputationMetaProto'
_FEATUREIMPUTERMETA_COLSSTRATEGYENTRY._options = None
_FEATUREIMPUTERMETA_COLSSTRATEGYENTRY._serialized_options = b'8\001'
_FEATUREIMPUTERMETA._serialized_start=74
_FEATUREIMPUTERMETA._serialized_end=337
_FEATUREIMPUTERMETA_COLSSTRATEGYENTRY._serialized_start=286
_FEATUREIMPUTERMETA_COLSSTRATEGYENTRY._serialized_end=337
_FEATUREIMPUTATIONMETA._serialized_start=339
_FEATUREIMPUTATIONMETA._serialized_end=462
# @@protoc_insertion_point(module_scope)
| 3,350 | 55.79661 | 841 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/one_vs_rest_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: one-vs-rest-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17one-vs-rest-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"u\n\x0eOneVsRestParam\x12\x0f\n\x07\x63lasses\x18\x01 \x03(\t\x12R\n\x11\x63lassifier_models\x18\x02 \x03(\x0b\x32\x37.com.webank.ai.fate.core.mlmodel.buffer.ClassifierModel\"2\n\x0f\x43lassifierModel\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\tB\x15\x42\x13OneVsRestParamProtob\x06proto3')
_ONEVSRESTPARAM = DESCRIPTOR.message_types_by_name['OneVsRestParam']
_CLASSIFIERMODEL = DESCRIPTOR.message_types_by_name['ClassifierModel']
OneVsRestParam = _reflection.GeneratedProtocolMessageType('OneVsRestParam', (_message.Message,), {
'DESCRIPTOR' : _ONEVSRESTPARAM,
'__module__' : 'one_vs_rest_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OneVsRestParam)
})
_sym_db.RegisterMessage(OneVsRestParam)
ClassifierModel = _reflection.GeneratedProtocolMessageType('ClassifierModel', (_message.Message,), {
'DESCRIPTOR' : _CLASSIFIERMODEL,
'__module__' : 'one_vs_rest_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ClassifierModel)
})
_sym_db.RegisterMessage(ClassifierModel)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\023OneVsRestParamProto'
_ONEVSRESTPARAM._serialized_start=67
_ONEVSRESTPARAM._serialized_end=184
_CLASSIFIERMODEL._serialized_start=186
_CLASSIFIERMODEL._serialized_end=236
# @@protoc_insertion_point(module_scope)
| 2,083 | 44.304348 | 450 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/hetero_kmeans_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hetero-kmeans-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19hetero-kmeans-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\x88\x02\n\x10KmeansModelParam\x12\x19\n\x11\x63ount_of_clusters\x18\x01 \x01(\x03\x12\x16\n\x0emax_interation\x18\x02 \x01(\x03\x12\x11\n\tconverged\x18\x03 \x01(\x08\x12M\n\x0e\x63luster_detail\x18\x04 \x03(\x0b\x32\x35.com.webank.ai.fate.core.mlmodel.buffer.Clusterdetail\x12O\n\x0f\x63\x65ntroid_detail\x18\x05 \x03(\x0b\x32\x36.com.webank.ai.fate.core.mlmodel.buffer.Centroiddetail\x12\x0e\n\x06header\x18\x06 \x03(\t\" \n\rClusterdetail\x12\x0f\n\x07\x63luster\x18\x01 \x03(\x01\"\"\n\x0e\x43\x65ntroiddetail\x12\x10\n\x08\x63\x65ntroid\x18\x01 \x03(\x01\x42\x17\x42\x15KmeansModelParamProtob\x06proto3')
_KMEANSMODELPARAM = DESCRIPTOR.message_types_by_name['KmeansModelParam']
_CLUSTERDETAIL = DESCRIPTOR.message_types_by_name['Clusterdetail']
_CENTROIDDETAIL = DESCRIPTOR.message_types_by_name['Centroiddetail']
KmeansModelParam = _reflection.GeneratedProtocolMessageType('KmeansModelParam', (_message.Message,), {
'DESCRIPTOR' : _KMEANSMODELPARAM,
'__module__' : 'hetero_kmeans_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.KmeansModelParam)
})
_sym_db.RegisterMessage(KmeansModelParam)
Clusterdetail = _reflection.GeneratedProtocolMessageType('Clusterdetail', (_message.Message,), {
'DESCRIPTOR' : _CLUSTERDETAIL,
'__module__' : 'hetero_kmeans_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.Clusterdetail)
})
_sym_db.RegisterMessage(Clusterdetail)
Centroiddetail = _reflection.GeneratedProtocolMessageType('Centroiddetail', (_message.Message,), {
'DESCRIPTOR' : _CENTROIDDETAIL,
'__module__' : 'hetero_kmeans_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.Centroiddetail)
})
_sym_db.RegisterMessage(Centroiddetail)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\025KmeansModelParamProto'
_KMEANSMODELPARAM._serialized_start=70
_KMEANSMODELPARAM._serialized_end=334
_CLUSTERDETAIL._serialized_start=336
_CLUSTERDETAIL._serialized_end=368
_CENTROIDDETAIL._serialized_start=370
_CENTROIDDETAIL._serialized_end=404
# @@protoc_insertion_point(module_scope)
| 2,852 | 49.946429 | 746 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/psi_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: psi-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15psi-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"k\n\nFeaturePsi\x12\x14\n\x0c\x66\x65\x61ture_name\x18\x01 \x01(\t\x12\x0b\n\x03psi\x18\x02 \x03(\x01\x12\x10\n\x08interval\x18\x03 \x03(\t\x12\x13\n\x0b\x65xpect_perc\x18\x04 \x03(\x01\x12\x13\n\x0b\x61\x63tual_perc\x18\x05 \x03(\x01\"\xf5\x01\n\nPsiSummary\x12W\n\x0btotal_score\x18\x01 \x03(\x0b\x32\x42.com.webank.ai.fate.core.mlmodel.buffer.PsiSummary.TotalScoreEntry\x12G\n\x0b\x66\x65\x61ture_psi\x18\x02 \x03(\x0b\x32\x32.com.webank.ai.fate.core.mlmodel.buffer.FeaturePsi\x12\x12\n\nmodel_name\x18\x03 \x01(\t\x1a\x31\n\x0fTotalScoreEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x42\x1a\x42\x18\x42oostTreeModelParamProtob\x06proto3')
_FEATUREPSI = DESCRIPTOR.message_types_by_name['FeaturePsi']
_PSISUMMARY = DESCRIPTOR.message_types_by_name['PsiSummary']
_PSISUMMARY_TOTALSCOREENTRY = _PSISUMMARY.nested_types_by_name['TotalScoreEntry']
FeaturePsi = _reflection.GeneratedProtocolMessageType('FeaturePsi', (_message.Message,), {
'DESCRIPTOR' : _FEATUREPSI,
'__module__' : 'psi_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeaturePsi)
})
_sym_db.RegisterMessage(FeaturePsi)
PsiSummary = _reflection.GeneratedProtocolMessageType('PsiSummary', (_message.Message,), {
'TotalScoreEntry' : _reflection.GeneratedProtocolMessageType('TotalScoreEntry', (_message.Message,), {
'DESCRIPTOR' : _PSISUMMARY_TOTALSCOREENTRY,
'__module__' : 'psi_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PsiSummary.TotalScoreEntry)
})
,
'DESCRIPTOR' : _PSISUMMARY,
'__module__' : 'psi_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PsiSummary)
})
_sym_db.RegisterMessage(PsiSummary)
_sym_db.RegisterMessage(PsiSummary.TotalScoreEntry)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\030BoostTreeModelParamProto'
_PSISUMMARY_TOTALSCOREENTRY._options = None
_PSISUMMARY_TOTALSCOREENTRY._serialized_options = b'8\001'
_FEATUREPSI._serialized_start=65
_FEATUREPSI._serialized_end=172
_PSISUMMARY._serialized_start=175
_PSISUMMARY._serialized_end=420
_PSISUMMARY_TOTALSCOREENTRY._serialized_start=371
_PSISUMMARY_TOTALSCOREENTRY._serialized_end=420
# @@protoc_insertion_point(module_scope)
| 3,025 | 50.288136 | 815 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/column_expand_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: column-expand-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19\x63olumn-expand-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"#\n\x11\x43olumnExpandParam\x12\x0e\n\x06header\x18\x01 \x03(\tB\x13\x42\x11\x43olumnExpandProtob\x06proto3')
_COLUMNEXPANDPARAM = DESCRIPTOR.message_types_by_name['ColumnExpandParam']
ColumnExpandParam = _reflection.GeneratedProtocolMessageType('ColumnExpandParam', (_message.Message,), {
'DESCRIPTOR' : _COLUMNEXPANDPARAM,
'__module__' : 'column_expand_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ColumnExpandParam)
})
_sym_db.RegisterMessage(ColumnExpandParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\021ColumnExpandProto'
_COLUMNEXPANDPARAM._serialized_start=69
_COLUMNEXPANDPARAM._serialized_end=104
# @@protoc_insertion_point(module_scope)
| 1,438 | 38.972222 | 248 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/pipeline_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pipeline.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0epipeline.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xbf\x02\n\x08Pipeline\x12\x15\n\rinference_dsl\x18\x01 \x01(\x0c\x12\x11\n\ttrain_dsl\x18\x02 \x01(\x0c\x12\x1a\n\x12train_runtime_conf\x18\x03 \x01(\x0c\x12\x14\n\x0c\x66\x61te_version\x18\x04 \x01(\t\x12\x10\n\x08model_id\x18\x05 \x01(\t\x12\x15\n\rmodel_version\x18\x06 \x01(\t\x12\x0e\n\x06parent\x18\x07 \x01(\x08\x12\x14\n\x0cloaded_times\x18\x08 \x01(\x05\x12\r\n\x05roles\x18\t \x01(\x0c\x12\x11\n\twork_mode\x18\n \x01(\x05\x12\x16\n\x0einitiator_role\x18\x0b \x01(\t\x12\x1a\n\x12initiator_party_id\x18\x0c \x01(\x05\x12\x1d\n\x15runtime_conf_on_party\x18\r \x01(\x0c\x12\x13\n\x0bparent_info\x18\x0e \x01(\x0c\x42\x0f\x42\rPipelineProtob\x06proto3')
_PIPELINE = DESCRIPTOR.message_types_by_name['Pipeline']
Pipeline = _reflection.GeneratedProtocolMessageType('Pipeline', (_message.Message,), {
'DESCRIPTOR' : _PIPELINE,
'__module__' : 'pipeline_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.Pipeline)
})
_sym_db.RegisterMessage(Pipeline)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\rPipelineProto'
_PIPELINE._serialized_start=59
_PIPELINE._serialized_end=378
# @@protoc_insertion_point(module_scope)
| 1,867 | 50.888889 | 786 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/statistic_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: statistic-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15statistic-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"T\n\x1bStatisticSingleFeatureValue\x12\x0e\n\x06values\x18\x01 \x03(\x01\x12\x11\n\tcol_names\x18\x02 \x03(\t\x12\x12\n\nvalue_name\x18\x03 \x01(\t\"o\n\x17StatisticOnePartyResult\x12T\n\x07results\x18\x01 \x03(\x0b\x32\x43.com.webank.ai.fate.core.mlmodel.buffer.StatisticSingleFeatureValue\"\xc3\x02\n\nModelParam\x12T\n\x0bself_values\x18\x01 \x01(\x0b\x32?.com.webank.ai.fate.core.mlmodel.buffer.StatisticOnePartyResult\x12W\n\x0bhost_values\x18\x02 \x03(\x0b\x32\x42.com.webank.ai.fate.core.mlmodel.buffer.ModelParam.HostValuesEntry\x12\x12\n\nmodel_name\x18\x03 \x01(\t\x1ar\n\x0fHostValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12N\n\x05value\x18\x02 \x01(\x0b\x32?.com.webank.ai.fate.core.mlmodel.buffer.StatisticOnePartyResult:\x02\x38\x01\x42\x15\x42\x13StatisticParamProtob\x06proto3')
_STATISTICSINGLEFEATUREVALUE = DESCRIPTOR.message_types_by_name['StatisticSingleFeatureValue']
_STATISTICONEPARTYRESULT = DESCRIPTOR.message_types_by_name['StatisticOnePartyResult']
_MODELPARAM = DESCRIPTOR.message_types_by_name['ModelParam']
_MODELPARAM_HOSTVALUESENTRY = _MODELPARAM.nested_types_by_name['HostValuesEntry']
StatisticSingleFeatureValue = _reflection.GeneratedProtocolMessageType('StatisticSingleFeatureValue', (_message.Message,), {
'DESCRIPTOR' : _STATISTICSINGLEFEATUREVALUE,
'__module__' : 'statistic_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.StatisticSingleFeatureValue)
})
_sym_db.RegisterMessage(StatisticSingleFeatureValue)
StatisticOnePartyResult = _reflection.GeneratedProtocolMessageType('StatisticOnePartyResult', (_message.Message,), {
'DESCRIPTOR' : _STATISTICONEPARTYRESULT,
'__module__' : 'statistic_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.StatisticOnePartyResult)
})
_sym_db.RegisterMessage(StatisticOnePartyResult)
ModelParam = _reflection.GeneratedProtocolMessageType('ModelParam', (_message.Message,), {
'HostValuesEntry' : _reflection.GeneratedProtocolMessageType('HostValuesEntry', (_message.Message,), {
'DESCRIPTOR' : _MODELPARAM_HOSTVALUESENTRY,
'__module__' : 'statistic_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ModelParam.HostValuesEntry)
})
,
'DESCRIPTOR' : _MODELPARAM,
'__module__' : 'statistic_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ModelParam)
})
_sym_db.RegisterMessage(ModelParam)
_sym_db.RegisterMessage(ModelParam.HostValuesEntry)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\023StatisticParamProto'
_MODELPARAM_HOSTVALUESENTRY._options = None
_MODELPARAM_HOSTVALUESENTRY._serialized_options = b'8\001'
_STATISTICSINGLEFEATUREVALUE._serialized_start=65
_STATISTICSINGLEFEATUREVALUE._serialized_end=149
_STATISTICONEPARTYRESULT._serialized_start=151
_STATISTICONEPARTYRESULT._serialized_end=262
_MODELPARAM._serialized_start=265
_MODELPARAM._serialized_end=588
_MODELPARAM_HOSTVALUESENTRY._serialized_start=474
_MODELPARAM_HOSTVALUESENTRY._serialized_end=588
# @@protoc_insertion_point(module_scope)
| 3,828 | 54.492754 | 928 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/label_transform_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: label-transform-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1alabel-transform-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"&\n\x12LabelTransformMeta\x12\x10\n\x08need_run\x18\x01 \x01(\x08\x42\x19\x42\x17LabelTransformMetaProtob\x06proto3')
_LABELTRANSFORMMETA = DESCRIPTOR.message_types_by_name['LabelTransformMeta']
LabelTransformMeta = _reflection.GeneratedProtocolMessageType('LabelTransformMeta', (_message.Message,), {
'DESCRIPTOR' : _LABELTRANSFORMMETA,
'__module__' : 'label_transform_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LabelTransformMeta)
})
_sym_db.RegisterMessage(LabelTransformMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\027LabelTransformMetaProto'
_LABELTRANSFORMMETA._serialized_start=70
_LABELTRANSFORMMETA._serialized_end=108
# @@protoc_insertion_point(module_scope)
| 1,461 | 39.611111 | 254 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/data_io_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: data-io-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x64\x61ta-io-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"J\n\x0bImputerMeta\x12\x12\n\nis_imputer\x18\x01 \x01(\x08\x12\x10\n\x08strategy\x18\x02 \x01(\t\x12\x15\n\rmissing_value\x18\x03 \x03(\t\"J\n\x0bOutlierMeta\x12\x12\n\nis_outlier\x18\x01 \x01(\x08\x12\x10\n\x08strategy\x18\x02 \x01(\t\x12\x15\n\routlier_value\x18\x03 \x03(\t\"\x9a\x04\n\nDataIOMeta\x12\x14\n\x0cinput_format\x18\x01 \x01(\t\x12\x11\n\tdelimitor\x18\x02 \x01(\t\x12\x11\n\tdata_type\x18\x03 \x01(\t\x12\x16\n\x0etag_with_value\x18\x04 \x01(\x08\x12\x1b\n\x13tag_value_delimitor\x18\x05 \x01(\t\x12\x12\n\nwith_label\x18\x06 \x01(\x08\x12\x12\n\nlabel_name\x18\x07 \x01(\t\x12\x12\n\nlabel_type\x18\x08 \x01(\t\x12\x15\n\routput_format\x18\t \x01(\t\x12I\n\x0cimputer_meta\x18\n \x01(\x0b\x32\x33.com.webank.ai.fate.core.mlmodel.buffer.ImputerMeta\x12I\n\x0coutlier_meta\x18\x0b \x01(\x0b\x32\x33.com.webank.ai.fate.core.mlmodel.buffer.OutlierMeta\x12\x10\n\x08need_run\x18\x0c \x01(\x08\x12\x66\n\x13\x65xclusive_data_type\x18\r \x03(\x0b\x32I.com.webank.ai.fate.core.mlmodel.buffer.DataIOMeta.ExclusiveDataTypeEntry\x1a\x38\n\x16\x45xclusiveDataTypeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x11\x42\x0f\x44\x61taIOMetaProtob\x06proto3')
_IMPUTERMETA = DESCRIPTOR.message_types_by_name['ImputerMeta']
_OUTLIERMETA = DESCRIPTOR.message_types_by_name['OutlierMeta']
_DATAIOMETA = DESCRIPTOR.message_types_by_name['DataIOMeta']
_DATAIOMETA_EXCLUSIVEDATATYPEENTRY = _DATAIOMETA.nested_types_by_name['ExclusiveDataTypeEntry']
ImputerMeta = _reflection.GeneratedProtocolMessageType('ImputerMeta', (_message.Message,), {
'DESCRIPTOR' : _IMPUTERMETA,
'__module__' : 'data_io_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ImputerMeta)
})
_sym_db.RegisterMessage(ImputerMeta)
OutlierMeta = _reflection.GeneratedProtocolMessageType('OutlierMeta', (_message.Message,), {
'DESCRIPTOR' : _OUTLIERMETA,
'__module__' : 'data_io_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OutlierMeta)
})
_sym_db.RegisterMessage(OutlierMeta)
DataIOMeta = _reflection.GeneratedProtocolMessageType('DataIOMeta', (_message.Message,), {
'ExclusiveDataTypeEntry' : _reflection.GeneratedProtocolMessageType('ExclusiveDataTypeEntry', (_message.Message,), {
'DESCRIPTOR' : _DATAIOMETA_EXCLUSIVEDATATYPEENTRY,
'__module__' : 'data_io_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataIOMeta.ExclusiveDataTypeEntry)
})
,
'DESCRIPTOR' : _DATAIOMETA,
'__module__' : 'data_io_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DataIOMeta)
})
_sym_db.RegisterMessage(DataIOMeta)
_sym_db.RegisterMessage(DataIOMeta.ExclusiveDataTypeEntry)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\017DataIOMetaProto'
_DATAIOMETA_EXCLUSIVEDATATYPEENTRY._options = None
_DATAIOMETA_EXCLUSIVEDATATYPEENTRY._serialized_options = b'8\001'
_IMPUTERMETA._serialized_start=62
_IMPUTERMETA._serialized_end=136
_OUTLIERMETA._serialized_start=138
_OUTLIERMETA._serialized_end=212
_DATAIOMETA._serialized_start=215
_DATAIOMETA._serialized_end=753
_DATAIOMETA_EXCLUSIVEDATATYPEENTRY._serialized_start=697
_DATAIOMETA_EXCLUSIVEDATATYPEENTRY._serialized_end=753
# @@protoc_insertion_point(module_scope)
| 4,043 | 57.608696 | 1,337 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/onehot_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: onehot-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11onehot-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"K\n\nOneHotMeta\x12\x1b\n\x13transform_col_names\x18\x01 \x03(\t\x12\x0e\n\x06header\x18\x02 \x03(\t\x12\x10\n\x08need_run\x18\x03 \x01(\x08\x42\x11\x42\x0fOneHotMetaProtob\x06proto3')
_ONEHOTMETA = DESCRIPTOR.message_types_by_name['OneHotMeta']
OneHotMeta = _reflection.GeneratedProtocolMessageType('OneHotMeta', (_message.Message,), {
'DESCRIPTOR' : _ONEHOTMETA,
'__module__' : 'onehot_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OneHotMeta)
})
_sym_db.RegisterMessage(OneHotMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\017OneHotMetaProto'
_ONEHOTMETA._serialized_start=61
_ONEHOTMETA._serialized_end=136
# @@protoc_insertion_point(module_scope)
| 1,421 | 38.5 | 312 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/feature_selection_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feature-selection-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x66\x65\x61ture-selection-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xa5\x01\n\x0c\x46\x65\x61tureValue\x12_\n\x0e\x66\x65\x61ture_values\x18\x01 \x03(\x0b\x32G.com.webank.ai.fate.core.mlmodel.buffer.FeatureValue.FeatureValuesEntry\x1a\x34\n\x12\x46\x65\x61tureValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"\xa5\x01\n\x08LeftCols\x12\x15\n\roriginal_cols\x18\x01 \x03(\t\x12Q\n\tleft_cols\x18\x02 \x03(\x0b\x32>.com.webank.ai.fate.core.mlmodel.buffer.LeftCols.LeftColsEntry\x1a/\n\rLeftColsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\"\xba\x03\n\x1b\x46\x65\x61tureSelectionFilterParam\x12n\n\x0e\x66\x65\x61ture_values\x18\x01 \x03(\x0b\x32V.com.webank.ai.fate.core.mlmodel.buffer.FeatureSelectionFilterParam.FeatureValuesEntry\x12Q\n\x13host_feature_values\x18\x02 \x03(\x0b\x32\x34.com.webank.ai.fate.core.mlmodel.buffer.FeatureValue\x12\x43\n\tleft_cols\x18\x03 \x01(\x0b\x32\x30.com.webank.ai.fate.core.mlmodel.buffer.LeftCols\x12H\n\x0ehost_left_cols\x18\x04 \x03(\x0b\x32\x30.com.webank.ai.fate.core.mlmodel.buffer.LeftCols\x12\x13\n\x0b\x66ilter_name\x18\x05 \x01(\t\x1a\x34\n\x12\x46\x65\x61tureValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"\xde\x03\n\x15\x46\x65\x61tureSelectionParam\x12T\n\x07results\x18\x01 \x03(\x0b\x32\x43.com.webank.ai.fate.core.mlmodel.buffer.FeatureSelectionFilterParam\x12I\n\x0f\x66inal_left_cols\x18\x02 \x01(\x0b\x32\x30.com.webank.ai.fate.core.mlmodel.buffer.LeftCols\x12\x11\n\tcol_names\x18\x03 \x03(\t\x12L\n\x0ehost_col_names\x18\x04 \x03(\x0b\x32\x34.com.webank.ai.fate.core.mlmodel.buffer.HostColNames\x12\x0e\n\x06header\x18\x05 \x03(\t\x12w\n\x17\x63ol_name_to_anonym_dict\x18\x06 \x03(\x0b\x32V.com.webank.ai.fate.core.mlmodel.buffer.FeatureSelectionParam.ColNameToAnonymDictEntry\x1a:\n\x18\x43olNameToAnonymDictEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"3\n\x0cHostColNames\x12\x11\n\tcol_names\x18\x01 \x03(\t\x12\x10\n\x08party_id\x18\x02 \x01(\tB\x1c\x42\x1a\x46\x65\x61tureSelectionParamProtob\x06proto3')
_FEATUREVALUE = DESCRIPTOR.message_types_by_name['FeatureValue']
_FEATUREVALUE_FEATUREVALUESENTRY = _FEATUREVALUE.nested_types_by_name['FeatureValuesEntry']
_LEFTCOLS = DESCRIPTOR.message_types_by_name['LeftCols']
_LEFTCOLS_LEFTCOLSENTRY = _LEFTCOLS.nested_types_by_name['LeftColsEntry']
_FEATURESELECTIONFILTERPARAM = DESCRIPTOR.message_types_by_name['FeatureSelectionFilterParam']
_FEATURESELECTIONFILTERPARAM_FEATUREVALUESENTRY = _FEATURESELECTIONFILTERPARAM.nested_types_by_name['FeatureValuesEntry']
_FEATURESELECTIONPARAM = DESCRIPTOR.message_types_by_name['FeatureSelectionParam']
_FEATURESELECTIONPARAM_COLNAMETOANONYMDICTENTRY = _FEATURESELECTIONPARAM.nested_types_by_name['ColNameToAnonymDictEntry']
_HOSTCOLNAMES = DESCRIPTOR.message_types_by_name['HostColNames']
FeatureValue = _reflection.GeneratedProtocolMessageType('FeatureValue', (_message.Message,), {
'FeatureValuesEntry' : _reflection.GeneratedProtocolMessageType('FeatureValuesEntry', (_message.Message,), {
'DESCRIPTOR' : _FEATUREVALUE_FEATUREVALUESENTRY,
'__module__' : 'feature_selection_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureValue.FeatureValuesEntry)
})
,
'DESCRIPTOR' : _FEATUREVALUE,
'__module__' : 'feature_selection_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureValue)
})
_sym_db.RegisterMessage(FeatureValue)
_sym_db.RegisterMessage(FeatureValue.FeatureValuesEntry)
LeftCols = _reflection.GeneratedProtocolMessageType('LeftCols', (_message.Message,), {
'LeftColsEntry' : _reflection.GeneratedProtocolMessageType('LeftColsEntry', (_message.Message,), {
'DESCRIPTOR' : _LEFTCOLS_LEFTCOLSENTRY,
'__module__' : 'feature_selection_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LeftCols.LeftColsEntry)
})
,
'DESCRIPTOR' : _LEFTCOLS,
'__module__' : 'feature_selection_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LeftCols)
})
_sym_db.RegisterMessage(LeftCols)
_sym_db.RegisterMessage(LeftCols.LeftColsEntry)
FeatureSelectionFilterParam = _reflection.GeneratedProtocolMessageType('FeatureSelectionFilterParam', (_message.Message,), {
'FeatureValuesEntry' : _reflection.GeneratedProtocolMessageType('FeatureValuesEntry', (_message.Message,), {
'DESCRIPTOR' : _FEATURESELECTIONFILTERPARAM_FEATUREVALUESENTRY,
'__module__' : 'feature_selection_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureSelectionFilterParam.FeatureValuesEntry)
})
,
'DESCRIPTOR' : _FEATURESELECTIONFILTERPARAM,
'__module__' : 'feature_selection_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureSelectionFilterParam)
})
_sym_db.RegisterMessage(FeatureSelectionFilterParam)
_sym_db.RegisterMessage(FeatureSelectionFilterParam.FeatureValuesEntry)
FeatureSelectionParam = _reflection.GeneratedProtocolMessageType('FeatureSelectionParam', (_message.Message,), {
'ColNameToAnonymDictEntry' : _reflection.GeneratedProtocolMessageType('ColNameToAnonymDictEntry', (_message.Message,), {
'DESCRIPTOR' : _FEATURESELECTIONPARAM_COLNAMETOANONYMDICTENTRY,
'__module__' : 'feature_selection_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureSelectionParam.ColNameToAnonymDictEntry)
})
,
'DESCRIPTOR' : _FEATURESELECTIONPARAM,
'__module__' : 'feature_selection_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureSelectionParam)
})
_sym_db.RegisterMessage(FeatureSelectionParam)
_sym_db.RegisterMessage(FeatureSelectionParam.ColNameToAnonymDictEntry)
HostColNames = _reflection.GeneratedProtocolMessageType('HostColNames', (_message.Message,), {
'DESCRIPTOR' : _HOSTCOLNAMES,
'__module__' : 'feature_selection_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.HostColNames)
})
_sym_db.RegisterMessage(HostColNames)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\032FeatureSelectionParamProto'
_FEATUREVALUE_FEATUREVALUESENTRY._options = None
_FEATUREVALUE_FEATUREVALUESENTRY._serialized_options = b'8\001'
_LEFTCOLS_LEFTCOLSENTRY._options = None
_LEFTCOLS_LEFTCOLSENTRY._serialized_options = b'8\001'
_FEATURESELECTIONFILTERPARAM_FEATUREVALUESENTRY._options = None
_FEATURESELECTIONFILTERPARAM_FEATUREVALUESENTRY._serialized_options = b'8\001'
_FEATURESELECTIONPARAM_COLNAMETOANONYMDICTENTRY._options = None
_FEATURESELECTIONPARAM_COLNAMETOANONYMDICTENTRY._serialized_options = b'8\001'
_FEATUREVALUE._serialized_start=74
_FEATUREVALUE._serialized_end=239
_FEATUREVALUE_FEATUREVALUESENTRY._serialized_start=187
_FEATUREVALUE_FEATUREVALUESENTRY._serialized_end=239
_LEFTCOLS._serialized_start=242
_LEFTCOLS._serialized_end=407
_LEFTCOLS_LEFTCOLSENTRY._serialized_start=360
_LEFTCOLS_LEFTCOLSENTRY._serialized_end=407
_FEATURESELECTIONFILTERPARAM._serialized_start=410
_FEATURESELECTIONFILTERPARAM._serialized_end=852
_FEATURESELECTIONFILTERPARAM_FEATUREVALUESENTRY._serialized_start=187
_FEATURESELECTIONFILTERPARAM_FEATUREVALUESENTRY._serialized_end=239
_FEATURESELECTIONPARAM._serialized_start=855
_FEATURESELECTIONPARAM._serialized_end=1333
_FEATURESELECTIONPARAM_COLNAMETOANONYMDICTENTRY._serialized_start=1275
_FEATURESELECTIONPARAM_COLNAMETOANONYMDICTENTRY._serialized_end=1333
_HOSTCOLNAMES._serialized_start=1335
_HOSTCOLNAMES._serialized_end=1386
# @@protoc_insertion_point(module_scope)
| 8,438 | 64.929688 | 2,224 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/boosting_tree_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: boosting-tree-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1f\x62oosting-tree-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xb7\x01\n\tNodeParam\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x10\n\x08sitename\x18\x02 \x01(\t\x12\x0b\n\x03\x66id\x18\x03 \x01(\x05\x12\x0b\n\x03\x62id\x18\x04 \x01(\x01\x12\x0e\n\x06weight\x18\x05 \x01(\x01\x12\x0f\n\x07is_leaf\x18\x06 \x01(\x08\x12\x13\n\x0bleft_nodeid\x18\x07 \x01(\x05\x12\x14\n\x0cright_nodeid\x18\x08 \x01(\x05\x12\x13\n\x0bmissing_dir\x18\t \x01(\x05\x12\x11\n\tmo_weight\x18\n \x03(\x01\"\xc1\x04\n\x16\x44\x65\x63isionTreeModelParam\x12@\n\x05tree_\x18\x01 \x03(\x0b\x32\x31.com.webank.ai.fate.core.mlmodel.buffer.NodeParam\x12i\n\x0esplit_maskdict\x18\x02 \x03(\x0b\x32Q.com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelParam.SplitMaskdictEntry\x12t\n\x14missing_dir_maskdict\x18\x03 \x03(\x0b\x32V.com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelParam.MissingDirMaskdictEntry\x12\x61\n\nleaf_count\x18\x04 \x03(\x0b\x32M.com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelParam.LeafCountEntry\x1a\x34\n\x12SplitMaskdictEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x39\n\x17MissingDirMaskdictEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1a\x30\n\x0eLeafCountEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"\x7f\n\x15\x46\x65\x61tureImportanceInfo\x12\x10\n\x08sitename\x18\x01 \x01(\t\x12\x0b\n\x03\x66id\x18\x02 \x01(\x05\x12\x12\n\nimportance\x18\x03 \x01(\x01\x12\x10\n\x08\x66ullname\x18\x04 \x01(\t\x12\x13\n\x0bimportance2\x18\x05 \x01(\x01\x12\x0c\n\x04main\x18\x06 \x01(\t\"\xe4\x05\n\x16\x42oostingTreeModelParam\x12\x10\n\x08tree_num\x18\x01 \x01(\x05\x12N\n\x06trees_\x18\x02 \x03(\x0b\x32>.com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelParam\x12\x12\n\ninit_score\x18\x03 \x03(\x01\x12\x0e\n\x06losses\x18\x04 \x03(\x01\x12\x10\n\x08tree_dim\x18\x05 \x01(\x05\x12\x13\n\x0bnum_classes\x18\x06 \x01(\x05\x12\x10\n\x08\x63lasses_\x18\x07 \x03(\t\x12Z\n\x13\x66\x65\x61ture_importances\x18\x08 \x03(\x0b\x32=.com.webank.ai.fate.core.mlmodel.buffer.FeatureImportanceInfo\x12{\n\x18\x66\x65\x61ture_name_fid_mapping\x18\t \x03(\x0b\x32Y.com.webank.ai.fate.core.mlmodel.buffer.BoostingTreeModelParam.FeatureNameFidMappingEntry\x12\x16\n\x0e\x62\x65st_iteration\x18\n \x01(\x05\x12\x11\n\ttree_plan\x18\x0b \x03(\t\x12\x12\n\nmodel_name\x18\x0c \x01(\t\x12x\n\x16\x61nonymous_name_mapping\x18\r \x03(\x0b\x32X.com.webank.ai.fate.core.mlmodel.buffer.BoostingTreeModelParam.AnonymousNameMappingEntry\x1a<\n\x1a\x46\x65\x61tureNameFidMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a;\n\x19\x41nonymousNameMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"z\n\x10TransformerParam\x12R\n\ntree_param\x18\x01 \x01(\x0b\x32>.com.webank.ai.fate.core.mlmodel.buffer.BoostingTreeModelParam\x12\x12\n\nmodel_name\x18\x02 \x01(\tB\x1a\x42\x18\x42oostTreeModelParamProtob\x06proto3')
_NODEPARAM = DESCRIPTOR.message_types_by_name['NodeParam']
_DECISIONTREEMODELPARAM = DESCRIPTOR.message_types_by_name['DecisionTreeModelParam']
_DECISIONTREEMODELPARAM_SPLITMASKDICTENTRY = _DECISIONTREEMODELPARAM.nested_types_by_name['SplitMaskdictEntry']
_DECISIONTREEMODELPARAM_MISSINGDIRMASKDICTENTRY = _DECISIONTREEMODELPARAM.nested_types_by_name['MissingDirMaskdictEntry']
_DECISIONTREEMODELPARAM_LEAFCOUNTENTRY = _DECISIONTREEMODELPARAM.nested_types_by_name['LeafCountEntry']
_FEATUREIMPORTANCEINFO = DESCRIPTOR.message_types_by_name['FeatureImportanceInfo']
_BOOSTINGTREEMODELPARAM = DESCRIPTOR.message_types_by_name['BoostingTreeModelParam']
_BOOSTINGTREEMODELPARAM_FEATURENAMEFIDMAPPINGENTRY = _BOOSTINGTREEMODELPARAM.nested_types_by_name['FeatureNameFidMappingEntry']
_BOOSTINGTREEMODELPARAM_ANONYMOUSNAMEMAPPINGENTRY = _BOOSTINGTREEMODELPARAM.nested_types_by_name['AnonymousNameMappingEntry']
_TRANSFORMERPARAM = DESCRIPTOR.message_types_by_name['TransformerParam']
NodeParam = _reflection.GeneratedProtocolMessageType('NodeParam', (_message.Message,), {
'DESCRIPTOR' : _NODEPARAM,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.NodeParam)
})
_sym_db.RegisterMessage(NodeParam)
DecisionTreeModelParam = _reflection.GeneratedProtocolMessageType('DecisionTreeModelParam', (_message.Message,), {
'SplitMaskdictEntry' : _reflection.GeneratedProtocolMessageType('SplitMaskdictEntry', (_message.Message,), {
'DESCRIPTOR' : _DECISIONTREEMODELPARAM_SPLITMASKDICTENTRY,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelParam.SplitMaskdictEntry)
})
,
'MissingDirMaskdictEntry' : _reflection.GeneratedProtocolMessageType('MissingDirMaskdictEntry', (_message.Message,), {
'DESCRIPTOR' : _DECISIONTREEMODELPARAM_MISSINGDIRMASKDICTENTRY,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelParam.MissingDirMaskdictEntry)
})
,
'LeafCountEntry' : _reflection.GeneratedProtocolMessageType('LeafCountEntry', (_message.Message,), {
'DESCRIPTOR' : _DECISIONTREEMODELPARAM_LEAFCOUNTENTRY,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelParam.LeafCountEntry)
})
,
'DESCRIPTOR' : _DECISIONTREEMODELPARAM,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.DecisionTreeModelParam)
})
_sym_db.RegisterMessage(DecisionTreeModelParam)
_sym_db.RegisterMessage(DecisionTreeModelParam.SplitMaskdictEntry)
_sym_db.RegisterMessage(DecisionTreeModelParam.MissingDirMaskdictEntry)
_sym_db.RegisterMessage(DecisionTreeModelParam.LeafCountEntry)
FeatureImportanceInfo = _reflection.GeneratedProtocolMessageType('FeatureImportanceInfo', (_message.Message,), {
'DESCRIPTOR' : _FEATUREIMPORTANCEINFO,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImportanceInfo)
})
_sym_db.RegisterMessage(FeatureImportanceInfo)
BoostingTreeModelParam = _reflection.GeneratedProtocolMessageType('BoostingTreeModelParam', (_message.Message,), {
'FeatureNameFidMappingEntry' : _reflection.GeneratedProtocolMessageType('FeatureNameFidMappingEntry', (_message.Message,), {
'DESCRIPTOR' : _BOOSTINGTREEMODELPARAM_FEATURENAMEFIDMAPPINGENTRY,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.BoostingTreeModelParam.FeatureNameFidMappingEntry)
})
,
'AnonymousNameMappingEntry' : _reflection.GeneratedProtocolMessageType('AnonymousNameMappingEntry', (_message.Message,), {
'DESCRIPTOR' : _BOOSTINGTREEMODELPARAM_ANONYMOUSNAMEMAPPINGENTRY,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.BoostingTreeModelParam.AnonymousNameMappingEntry)
})
,
'DESCRIPTOR' : _BOOSTINGTREEMODELPARAM,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.BoostingTreeModelParam)
})
_sym_db.RegisterMessage(BoostingTreeModelParam)
_sym_db.RegisterMessage(BoostingTreeModelParam.FeatureNameFidMappingEntry)
_sym_db.RegisterMessage(BoostingTreeModelParam.AnonymousNameMappingEntry)
TransformerParam = _reflection.GeneratedProtocolMessageType('TransformerParam', (_message.Message,), {
'DESCRIPTOR' : _TRANSFORMERPARAM,
'__module__' : 'boosting_tree_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.TransformerParam)
})
_sym_db.RegisterMessage(TransformerParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\030BoostTreeModelParamProto'
_DECISIONTREEMODELPARAM_SPLITMASKDICTENTRY._options = None
_DECISIONTREEMODELPARAM_SPLITMASKDICTENTRY._serialized_options = b'8\001'
_DECISIONTREEMODELPARAM_MISSINGDIRMASKDICTENTRY._options = None
_DECISIONTREEMODELPARAM_MISSINGDIRMASKDICTENTRY._serialized_options = b'8\001'
_DECISIONTREEMODELPARAM_LEAFCOUNTENTRY._options = None
_DECISIONTREEMODELPARAM_LEAFCOUNTENTRY._serialized_options = b'8\001'
_BOOSTINGTREEMODELPARAM_FEATURENAMEFIDMAPPINGENTRY._options = None
_BOOSTINGTREEMODELPARAM_FEATURENAMEFIDMAPPINGENTRY._serialized_options = b'8\001'
_BOOSTINGTREEMODELPARAM_ANONYMOUSNAMEMAPPINGENTRY._options = None
_BOOSTINGTREEMODELPARAM_ANONYMOUSNAMEMAPPINGENTRY._serialized_options = b'8\001'
_NODEPARAM._serialized_start=76
_NODEPARAM._serialized_end=259
_DECISIONTREEMODELPARAM._serialized_start=262
_DECISIONTREEMODELPARAM._serialized_end=839
_DECISIONTREEMODELPARAM_SPLITMASKDICTENTRY._serialized_start=678
_DECISIONTREEMODELPARAM_SPLITMASKDICTENTRY._serialized_end=730
_DECISIONTREEMODELPARAM_MISSINGDIRMASKDICTENTRY._serialized_start=732
_DECISIONTREEMODELPARAM_MISSINGDIRMASKDICTENTRY._serialized_end=789
_DECISIONTREEMODELPARAM_LEAFCOUNTENTRY._serialized_start=791
_DECISIONTREEMODELPARAM_LEAFCOUNTENTRY._serialized_end=839
_FEATUREIMPORTANCEINFO._serialized_start=841
_FEATUREIMPORTANCEINFO._serialized_end=968
_BOOSTINGTREEMODELPARAM._serialized_start=971
_BOOSTINGTREEMODELPARAM._serialized_end=1711
_BOOSTINGTREEMODELPARAM_FEATURENAMEFIDMAPPINGENTRY._serialized_start=1590
_BOOSTINGTREEMODELPARAM_FEATURENAMEFIDMAPPINGENTRY._serialized_end=1650
_BOOSTINGTREEMODELPARAM_ANONYMOUSNAMEMAPPINGENTRY._serialized_start=1652
_BOOSTINGTREEMODELPARAM_ANONYMOUSNAMEMAPPINGENTRY._serialized_end=1711
_TRANSFORMERPARAM._serialized_start=1713
_TRANSFORMERPARAM._serialized_end=1835
# @@protoc_insertion_point(module_scope)
| 10,581 | 74.049645 | 3,102 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/feature_scale_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feature-scale-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19\x66\x65\x61ture-scale-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xec\x01\n\nScaleParam\x12^\n\x0f\x63ol_scale_param\x18\x01 \x03(\x0b\x32\x45.com.webank.ai.fate.core.mlmodel.buffer.ScaleParam.ColScaleParamEntry\x12\x0e\n\x06header\x18\x02 \x03(\t\x1an\n\x12\x43olScaleParamEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x05value\x18\x02 \x01(\x0b\x32\x38.com.webank.ai.fate.core.mlmodel.buffer.ColumnScaleParam:\x02\x38\x01\"Y\n\x10\x43olumnScaleParam\x12\x14\n\x0c\x63olumn_upper\x18\x03 \x01(\x01\x12\x14\n\x0c\x63olumn_lower\x18\x04 \x01(\x01\x12\x0c\n\x04mean\x18\x05 \x01(\x01\x12\x0b\n\x03std\x18\x06 \x01(\x01\x42\x11\x42\x0fScaleParamProtob\x06proto3')
_SCALEPARAM = DESCRIPTOR.message_types_by_name['ScaleParam']
_SCALEPARAM_COLSCALEPARAMENTRY = _SCALEPARAM.nested_types_by_name['ColScaleParamEntry']
_COLUMNSCALEPARAM = DESCRIPTOR.message_types_by_name['ColumnScaleParam']
ScaleParam = _reflection.GeneratedProtocolMessageType('ScaleParam', (_message.Message,), {
'ColScaleParamEntry' : _reflection.GeneratedProtocolMessageType('ColScaleParamEntry', (_message.Message,), {
'DESCRIPTOR' : _SCALEPARAM_COLSCALEPARAMENTRY,
'__module__' : 'feature_scale_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ScaleParam.ColScaleParamEntry)
})
,
'DESCRIPTOR' : _SCALEPARAM,
'__module__' : 'feature_scale_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ScaleParam)
})
_sym_db.RegisterMessage(ScaleParam)
_sym_db.RegisterMessage(ScaleParam.ColScaleParamEntry)
ColumnScaleParam = _reflection.GeneratedProtocolMessageType('ColumnScaleParam', (_message.Message,), {
'DESCRIPTOR' : _COLUMNSCALEPARAM,
'__module__' : 'feature_scale_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ColumnScaleParam)
})
_sym_db.RegisterMessage(ColumnScaleParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\017ScaleParamProto'
_SCALEPARAM_COLSCALEPARAMENTRY._options = None
_SCALEPARAM_COLSCALEPARAMENTRY._serialized_options = b'8\001'
_SCALEPARAM._serialized_start=70
_SCALEPARAM._serialized_end=306
_SCALEPARAM_COLSCALEPARAMENTRY._serialized_start=196
_SCALEPARAM_COLSCALEPARAMENTRY._serialized_end=306
_COLUMNSCALEPARAM._serialized_start=308
_COLUMNSCALEPARAM._serialized_end=397
# @@protoc_insertion_point(module_scope)
| 3,044 | 50.610169 | 740 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/feature_imputation_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feature-imputation-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1e\x66\x65\x61ture-imputation-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xed\x05\n\x13\x46\x65\x61tureImputerParam\x12s\n\x15missing_replace_value\x18\x01 \x03(\x0b\x32T.com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParam.MissingReplaceValueEntry\x12o\n\x13missing_value_ratio\x18\x02 \x03(\x0b\x32R.com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParam.MissingValueRatioEntry\x12|\n\x1amissing_replace_value_type\x18\x03 \x03(\x0b\x32X.com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParam.MissingReplaceValueTypeEntry\x12\x11\n\tskip_cols\x18\x04 \x03(\t\x12o\n\x13\x63ols_replace_method\x18\x05 \x03(\x0b\x32R.com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParam.ColsReplaceMethodEntry\x1a:\n\x18MissingReplaceValueEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16MissingValueRatioEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a>\n\x1cMissingReplaceValueTypeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16\x43olsReplaceMethodEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"|\n\x16\x46\x65\x61tureImputationParam\x12\x0e\n\x06header\x18\x01 \x03(\t\x12R\n\rimputer_param\x18\x02 \x01(\x0b\x32;.com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParamB\x1d\x42\x1b\x46\x65\x61tureImputationParamProtob\x06proto3')
_FEATUREIMPUTERPARAM = DESCRIPTOR.message_types_by_name['FeatureImputerParam']
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUEENTRY = _FEATUREIMPUTERPARAM.nested_types_by_name['MissingReplaceValueEntry']
_FEATUREIMPUTERPARAM_MISSINGVALUERATIOENTRY = _FEATUREIMPUTERPARAM.nested_types_by_name['MissingValueRatioEntry']
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUETYPEENTRY = _FEATUREIMPUTERPARAM.nested_types_by_name['MissingReplaceValueTypeEntry']
_FEATUREIMPUTERPARAM_COLSREPLACEMETHODENTRY = _FEATUREIMPUTERPARAM.nested_types_by_name['ColsReplaceMethodEntry']
_FEATUREIMPUTATIONPARAM = DESCRIPTOR.message_types_by_name['FeatureImputationParam']
FeatureImputerParam = _reflection.GeneratedProtocolMessageType('FeatureImputerParam', (_message.Message,), {
'MissingReplaceValueEntry' : _reflection.GeneratedProtocolMessageType('MissingReplaceValueEntry', (_message.Message,), {
'DESCRIPTOR' : _FEATUREIMPUTERPARAM_MISSINGREPLACEVALUEENTRY,
'__module__' : 'feature_imputation_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParam.MissingReplaceValueEntry)
})
,
'MissingValueRatioEntry' : _reflection.GeneratedProtocolMessageType('MissingValueRatioEntry', (_message.Message,), {
'DESCRIPTOR' : _FEATUREIMPUTERPARAM_MISSINGVALUERATIOENTRY,
'__module__' : 'feature_imputation_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParam.MissingValueRatioEntry)
})
,
'MissingReplaceValueTypeEntry' : _reflection.GeneratedProtocolMessageType('MissingReplaceValueTypeEntry', (_message.Message,), {
'DESCRIPTOR' : _FEATUREIMPUTERPARAM_MISSINGREPLACEVALUETYPEENTRY,
'__module__' : 'feature_imputation_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParam.MissingReplaceValueTypeEntry)
})
,
'ColsReplaceMethodEntry' : _reflection.GeneratedProtocolMessageType('ColsReplaceMethodEntry', (_message.Message,), {
'DESCRIPTOR' : _FEATUREIMPUTERPARAM_COLSREPLACEMETHODENTRY,
'__module__' : 'feature_imputation_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParam.ColsReplaceMethodEntry)
})
,
'DESCRIPTOR' : _FEATUREIMPUTERPARAM,
'__module__' : 'feature_imputation_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImputerParam)
})
_sym_db.RegisterMessage(FeatureImputerParam)
_sym_db.RegisterMessage(FeatureImputerParam.MissingReplaceValueEntry)
_sym_db.RegisterMessage(FeatureImputerParam.MissingValueRatioEntry)
_sym_db.RegisterMessage(FeatureImputerParam.MissingReplaceValueTypeEntry)
_sym_db.RegisterMessage(FeatureImputerParam.ColsReplaceMethodEntry)
FeatureImputationParam = _reflection.GeneratedProtocolMessageType('FeatureImputationParam', (_message.Message,), {
'DESCRIPTOR' : _FEATUREIMPUTATIONPARAM,
'__module__' : 'feature_imputation_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureImputationParam)
})
_sym_db.RegisterMessage(FeatureImputationParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\033FeatureImputationParamProto'
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUEENTRY._options = None
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUEENTRY._serialized_options = b'8\001'
_FEATUREIMPUTERPARAM_MISSINGVALUERATIOENTRY._options = None
_FEATUREIMPUTERPARAM_MISSINGVALUERATIOENTRY._serialized_options = b'8\001'
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUETYPEENTRY._options = None
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUETYPEENTRY._serialized_options = b'8\001'
_FEATUREIMPUTERPARAM_COLSREPLACEMETHODENTRY._options = None
_FEATUREIMPUTERPARAM_COLSREPLACEMETHODENTRY._serialized_options = b'8\001'
_FEATUREIMPUTERPARAM._serialized_start=75
_FEATUREIMPUTERPARAM._serialized_end=824
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUEENTRY._serialized_start=586
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUEENTRY._serialized_end=644
_FEATUREIMPUTERPARAM_MISSINGVALUERATIOENTRY._serialized_start=646
_FEATUREIMPUTERPARAM_MISSINGVALUERATIOENTRY._serialized_end=702
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUETYPEENTRY._serialized_start=704
_FEATUREIMPUTERPARAM_MISSINGREPLACEVALUETYPEENTRY._serialized_end=766
_FEATUREIMPUTERPARAM_COLSREPLACEMETHODENTRY._serialized_start=768
_FEATUREIMPUTERPARAM_COLSREPLACEMETHODENTRY._serialized_end=824
_FEATUREIMPUTATIONPARAM._serialized_start=826
_FEATUREIMPUTATIONPARAM._serialized_end=950
# @@protoc_insertion_point(module_scope)
| 6,660 | 66.969388 | 1,498 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/homo_nn_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: homo-nn-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18homo-nn-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"S\n\nHomoNNMeta\x12\x11\n\tnn_define\x18\x01 \x03(\t\x12\x18\n\x10optimizer_define\x18\x02 \x03(\t\x12\x18\n\x10loss_func_define\x18\x03 \x03(\tB\x11\x42\x0fHomoNNMetaProtob\x06proto3')
_HOMONNMETA = DESCRIPTOR.message_types_by_name['HomoNNMeta']
HomoNNMeta = _reflection.GeneratedProtocolMessageType('HomoNNMeta', (_message.Message,), {
'DESCRIPTOR' : _HOMONNMETA,
'__module__' : 'homo_nn_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.HomoNNMeta)
})
_sym_db.RegisterMessage(HomoNNMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\017HomoNNMetaProto'
_HOMONNMETA._serialized_start=68
_HOMONNMETA._serialized_end=151
# @@protoc_insertion_point(module_scope)
| 1,443 | 39.111111 | 320 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/sshe_cipher_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sshe-cipher-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17sshe-cipher-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xa4\x01\n\x06\x43ipher\x12K\n\npublic_key\x18\x01 \x01(\x0b\x32\x37.com.webank.ai.fate.core.mlmodel.buffer.CipherPublicKey\x12M\n\x0bprivate_key\x18\x02 \x01(\x0b\x32\x38.com.webank.ai.fate.core.mlmodel.buffer.CipherPrivateKey\"\x1c\n\x0f\x43ipherPublicKey\x12\t\n\x01n\x18\x01 \x01(\t\"(\n\x10\x43ipherPrivateKey\x12\t\n\x01p\x18\x01 \x01(\t\x12\t\n\x01q\x18\x02 \x01(\t\"\x97\x01\n\nCipherText\x12K\n\npublic_key\x18\x01 \x01(\x0b\x32\x37.com.webank.ai.fate.core.mlmodel.buffer.CipherPublicKey\x12\x13\n\x0b\x63ipher_text\x18\x02 \x01(\t\x12\x10\n\x08\x65xponent\x18\x03 \x01(\t\x12\x15\n\ris_obfuscator\x18\x04 \x01(\x08\x42\x12\x42\x10\x43ipherParamProtob\x06proto3')
_CIPHER = DESCRIPTOR.message_types_by_name['Cipher']
_CIPHERPUBLICKEY = DESCRIPTOR.message_types_by_name['CipherPublicKey']
_CIPHERPRIVATEKEY = DESCRIPTOR.message_types_by_name['CipherPrivateKey']
_CIPHERTEXT = DESCRIPTOR.message_types_by_name['CipherText']
Cipher = _reflection.GeneratedProtocolMessageType('Cipher', (_message.Message,), {
'DESCRIPTOR' : _CIPHER,
'__module__' : 'sshe_cipher_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.Cipher)
})
_sym_db.RegisterMessage(Cipher)
CipherPublicKey = _reflection.GeneratedProtocolMessageType('CipherPublicKey', (_message.Message,), {
'DESCRIPTOR' : _CIPHERPUBLICKEY,
'__module__' : 'sshe_cipher_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.CipherPublicKey)
})
_sym_db.RegisterMessage(CipherPublicKey)
CipherPrivateKey = _reflection.GeneratedProtocolMessageType('CipherPrivateKey', (_message.Message,), {
'DESCRIPTOR' : _CIPHERPRIVATEKEY,
'__module__' : 'sshe_cipher_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.CipherPrivateKey)
})
_sym_db.RegisterMessage(CipherPrivateKey)
CipherText = _reflection.GeneratedProtocolMessageType('CipherText', (_message.Message,), {
'DESCRIPTOR' : _CIPHERTEXT,
'__module__' : 'sshe_cipher_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.CipherText)
})
_sym_db.RegisterMessage(CipherText)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\020CipherParamProto'
_CIPHER._serialized_start=68
_CIPHER._serialized_end=232
_CIPHERPUBLICKEY._serialized_start=234
_CIPHERPUBLICKEY._serialized_end=262
_CIPHERPRIVATEKEY._serialized_start=264
_CIPHERPRIVATEKEY._serialized_end=304
_CIPHERTEXT._serialized_start=307
_CIPHERTEXT._serialized_end=458
# @@protoc_insertion_point(module_scope)
| 3,272 | 48.590909 | 806 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/hetero_kmeans_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hetero-kmeans-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18hetero-kmeans-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\";\n\x0fKmeansModelMeta\x12\t\n\x01k\x18\x01 \x01(\x03\x12\x0b\n\x03tol\x18\x02 \x01(\x01\x12\x10\n\x08max_iter\x18\x03 \x01(\x03\x42\x16\x42\x14KmeansModelMetaProtob\x06proto3')
_KMEANSMODELMETA = DESCRIPTOR.message_types_by_name['KmeansModelMeta']
KmeansModelMeta = _reflection.GeneratedProtocolMessageType('KmeansModelMeta', (_message.Message,), {
'DESCRIPTOR' : _KMEANSMODELMETA,
'__module__' : 'hetero_kmeans_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.KmeansModelMeta)
})
_sym_db.RegisterMessage(KmeansModelMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\024KmeansModelMetaProto'
_KMEANSMODELMETA._serialized_start=68
_KMEANSMODELMETA._serialized_end=127
# @@protoc_insertion_point(module_scope)
| 1,485 | 40.277778 | 312 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/__init__.py
|
import os
import sys
sys.path.append(os.path.dirname(__file__))
| 65 | 12.2 | 42 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/pearson_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pearson-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19pearson-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\x16\n\x05Names\x12\r\n\x05names\x18\x01 \x03(\t\"/\n\x0c\x41nonymousMap\x12\x11\n\tanonymous\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"\xb9\x02\n\x11PearsonModelParam\x12\r\n\x05party\x18\x01 \x01(\t\x12\x0f\n\x07parties\x18\x02 \x03(\t\x12\r\n\x05shape\x18\x03 \x01(\x05\x12\x0e\n\x06shapes\x18\x04 \x03(\x05\x12\r\n\x05names\x18\x05 \x03(\t\x12\x0c\n\x04\x63orr\x18\x06 \x03(\x01\x12\x12\n\nlocal_corr\x18\x07 \x03(\x01\x12@\n\tall_names\x18\x08 \x03(\x0b\x32-.com.webank.ai.fate.core.mlmodel.buffer.Names\x12K\n\ranonymous_map\x18\t \x03(\x0b\x32\x34.com.webank.ai.fate.core.mlmodel.buffer.AnonymousMap\x12\x12\n\nmodel_name\x18\n \x01(\t\x12\x11\n\tlocal_vif\x18\x0b \x03(\x01\x42\x18\x42\x16PearsonModelParamProtob\x06proto3')
_NAMES = DESCRIPTOR.message_types_by_name['Names']
_ANONYMOUSMAP = DESCRIPTOR.message_types_by_name['AnonymousMap']
_PEARSONMODELPARAM = DESCRIPTOR.message_types_by_name['PearsonModelParam']
Names = _reflection.GeneratedProtocolMessageType('Names', (_message.Message,), {
'DESCRIPTOR' : _NAMES,
'__module__' : 'pearson_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.Names)
})
_sym_db.RegisterMessage(Names)
AnonymousMap = _reflection.GeneratedProtocolMessageType('AnonymousMap', (_message.Message,), {
'DESCRIPTOR' : _ANONYMOUSMAP,
'__module__' : 'pearson_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.AnonymousMap)
})
_sym_db.RegisterMessage(AnonymousMap)
PearsonModelParam = _reflection.GeneratedProtocolMessageType('PearsonModelParam', (_message.Message,), {
'DESCRIPTOR' : _PEARSONMODELPARAM,
'__module__' : 'pearson_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PearsonModelParam)
})
_sym_db.RegisterMessage(PearsonModelParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\026PearsonModelParamProto'
_NAMES._serialized_start=69
_NAMES._serialized_end=91
_ANONYMOUSMAP._serialized_start=93
_ANONYMOUSMAP._serialized_end=140
_PEARSONMODELPARAM._serialized_start=143
_PEARSONMODELPARAM._serialized_end=456
# @@protoc_insertion_point(module_scope)
| 2,901 | 50.821429 | 877 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/feature_scale_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feature-scale-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x66\x65\x61ture-scale-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xac\x01\n\tScaleMeta\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x0c\n\x04mode\x18\x02 \x01(\t\x12\x0c\n\x04\x61rea\x18\x03 \x01(\t\x12\x14\n\x0cscale_column\x18\x04 \x03(\t\x12\x12\n\nfeat_upper\x18\x05 \x03(\t\x12\x12\n\nfeat_lower\x18\x06 \x03(\t\x12\x11\n\twith_mean\x18\x07 \x01(\x08\x12\x10\n\x08with_std\x18\x08 \x01(\x08\x12\x10\n\x08need_run\x18\t \x01(\x08\x42\x10\x42\x0eScaleMetaProtob\x06proto3')
_SCALEMETA = DESCRIPTOR.message_types_by_name['ScaleMeta']
ScaleMeta = _reflection.GeneratedProtocolMessageType('ScaleMeta', (_message.Message,), {
'DESCRIPTOR' : _SCALEMETA,
'__module__' : 'feature_scale_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ScaleMeta)
})
_sym_db.RegisterMessage(ScaleMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\016ScaleMetaProto'
_SCALEMETA._serialized_start=69
_SCALEMETA._serialized_end=241
# @@protoc_insertion_point(module_scope)
| 1,663 | 45.222222 | 550 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/feature_binning_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feature-binning-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x66\x65\x61ture-binning-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"?\n\rTransformMeta\x12\x16\n\x0etransform_cols\x18\x01 \x03(\x03\x12\x16\n\x0etransform_type\x18\x02 \x01(\t\"\xc2\x02\n\x12\x46\x65\x61tureBinningMeta\x12\x10\n\x08need_run\x18\x01 \x01(\x08\x12\x0e\n\x06method\x18\n \x01(\t\x12\x16\n\x0e\x63ompress_thres\x18\x02 \x01(\x03\x12\x11\n\thead_size\x18\x03 \x01(\x03\x12\r\n\x05\x65rror\x18\x04 \x01(\x01\x12\x0f\n\x07\x62in_num\x18\x05 \x01(\x03\x12\x0c\n\x04\x63ols\x18\x06 \x03(\t\x12\x19\n\x11\x61\x64justment_factor\x18\x07 \x01(\x01\x12\x12\n\nlocal_only\x18\x08 \x01(\x08\x12N\n\x0ftransform_param\x18\t \x01(\x0b\x32\x35.com.webank.ai.fate.core.mlmodel.buffer.TransformMeta\x12\x13\n\x0bskip_static\x18\x0b \x01(\x08\x12\x1d\n\x15optimal_metric_method\x18\x0c \x01(\tB\x19\x42\x17\x46\x65\x61tureBinningMetaProtob\x06proto3')
_TRANSFORMMETA = DESCRIPTOR.message_types_by_name['TransformMeta']
_FEATUREBINNINGMETA = DESCRIPTOR.message_types_by_name['FeatureBinningMeta']
TransformMeta = _reflection.GeneratedProtocolMessageType('TransformMeta', (_message.Message,), {
'DESCRIPTOR' : _TRANSFORMMETA,
'__module__' : 'feature_binning_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.TransformMeta)
})
_sym_db.RegisterMessage(TransformMeta)
FeatureBinningMeta = _reflection.GeneratedProtocolMessageType('FeatureBinningMeta', (_message.Message,), {
'DESCRIPTOR' : _FEATUREBINNINGMETA,
'__module__' : 'feature_binning_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningMeta)
})
_sym_db.RegisterMessage(FeatureBinningMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\027FeatureBinningMetaProto'
_TRANSFORMMETA._serialized_start=70
_TRANSFORMMETA._serialized_end=133
_FEATUREBINNINGMETA._serialized_start=136
_FEATUREBINNINGMETA._serialized_end=458
# @@protoc_insertion_point(module_scope)
| 2,590 | 55.326087 | 926 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/sir_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sir-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0esir-meta.proto\x12(com.webank.ai.fate.common.mlmodel.buffer\"\xc9\x01\n\x1eSecureInformationRetrievalMeta\x12\x16\n\x0esecurity_level\x18\x01 \x01(\x01\x12#\n\x1boblivious_transfer_protocol\x18\x02 \x01(\t\x12\x1e\n\x16\x63ommutative_encryption\x18\x03 \x01(\t\x12!\n\x19non_committing_encryption\x18\x04 \x01(\t\x12\x10\n\x08key_size\x18\x05 \x01(\x03\x12\x15\n\rraw_retrieval\x18\x06 \x01(\x08\x42\x0e\x42\x0cSIRMetaProtob\x06proto3')
_SECUREINFORMATIONRETRIEVALMETA = DESCRIPTOR.message_types_by_name['SecureInformationRetrievalMeta']
SecureInformationRetrievalMeta = _reflection.GeneratedProtocolMessageType('SecureInformationRetrievalMeta', (_message.Message,), {
'DESCRIPTOR' : _SECUREINFORMATIONRETRIEVALMETA,
'__module__' : 'sir_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.common.mlmodel.buffer.SecureInformationRetrievalMeta)
})
_sym_db.RegisterMessage(SecureInformationRetrievalMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\014SIRMetaProto'
_SECUREINFORMATIONRETRIEVALMETA._serialized_start=61
_SECUREINFORMATIONRETRIEVALMETA._serialized_end=262
# @@protoc_insertion_point(module_scope)
| 1,784 | 48.583333 | 502 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/statistic_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: statistic-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14statistic-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"e\n\rStatisticMeta\x12\x12\n\nstatistics\x18\x01 \x03(\t\x12\x16\n\x0estatic_columns\x18\x02 \x03(\t\x12\x16\n\x0equantile_error\x18\x03 \x01(\x01\x12\x10\n\x08need_run\x18\x04 \x01(\x08\x42\x14\x42\x12StatisticMetaProtob\x06proto3')
_STATISTICMETA = DESCRIPTOR.message_types_by_name['StatisticMeta']
StatisticMeta = _reflection.GeneratedProtocolMessageType('StatisticMeta', (_message.Message,), {
'DESCRIPTOR' : _STATISTICMETA,
'__module__' : 'statistic_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.StatisticMeta)
})
_sym_db.RegisterMessage(StatisticMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\022StatisticMetaProto'
_STATISTICMETA._serialized_start=64
_STATISTICMETA._serialized_end=165
# @@protoc_insertion_point(module_scope)
| 1,509 | 40.944444 | 364 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/feature_binning_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feature-binning-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x66\x65\x61ture-binning-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xa3\x02\n\x07IVParam\x12\x11\n\twoe_array\x18\x01 \x03(\x01\x12\x10\n\x08iv_array\x18\x02 \x03(\x01\x12\x19\n\x11\x65vent_count_array\x18\x03 \x03(\x03\x12\x1d\n\x15non_event_count_array\x18\x04 \x03(\x03\x12\x18\n\x10\x65vent_rate_array\x18\x05 \x03(\x01\x12\x1c\n\x14non_event_rate_array\x18\x06 \x03(\x01\x12\x14\n\x0csplit_points\x18\x07 \x03(\x01\x12\n\n\x02iv\x18\x08 \x01(\x01\x12\x18\n\x10is_woe_monotonic\x18\t \x01(\x08\x12\x10\n\x08\x62in_nums\x18\n \x01(\x03\x12\x15\n\rbin_anonymous\x18\x0b \x03(\t\x12\x1c\n\x14optimal_metric_array\x18\x0c \x03(\x01\"\x86\x02\n\x14\x46\x65\x61tureBinningResult\x12g\n\x0e\x62inning_result\x18\x01 \x03(\x0b\x32O.com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningResult.BinningResultEntry\x12\x0c\n\x04role\x18\x02 \x01(\t\x12\x10\n\x08party_id\x18\x03 \x01(\t\x1a\x65\n\x12\x42inningResultEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12>\n\x05value\x18\x02 \x01(\x0b\x32/.com.webank.ai.fate.core.mlmodel.buffer.IVParam:\x02\x38\x01\"\xf6\x01\n\x10MultiClassResult\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningResult\x12\x0e\n\x06labels\x18\x02 \x03(\t\x12R\n\x0chost_results\x18\x03 \x03(\x0b\x32<.com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningResult\x12\x16\n\x0ehost_party_ids\x18\x04 \x03(\t\x12\x17\n\x0fhas_host_result\x18\x05 \x01(\x08\"R\n\x19\x42inningSingleFeatureValue\x12\x0e\n\x06values\x18\x01 \x03(\x01\x12\x11\n\tcol_names\x18\x02 \x03(\t\x12\x12\n\nvalue_name\x18\x03 \x01(\t\"\xf1\x04\n\x13\x46\x65\x61tureBinningParam\x12T\n\x0e\x62inning_result\x18\x01 \x01(\x0b\x32<.com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningResult\x12R\n\x0chost_results\x18\x02 \x03(\x0b\x32<.com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningResult\x12\x0e\n\x06header\x18\x03 \x03(\t\x12\x18\n\x10header_anonymous\x18\x04 \x03(\t\x12\x12\n\nmodel_name\x18\x05 \x01(\t\x12T\n\x12multi_class_result\x18\x06 \x01(\x0b\x32\x38.com.webank.ai.fate.core.mlmodel.buffer.MultiClassResult\x12^\n\x18transform_binning_result\x18\x07 \x01(\x0b\x32<.com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningResult\x12\\\n\x16transform_host_results\x18\x08 \x03(\x0b\x32<.com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningResult\x12^\n\x1ctransform_multi_class_result\x18\t \x01(\x0b\x32\x38.com.webank.ai.fate.core.mlmodel.buffer.MultiClassResultB\x1a\x42\x18\x46\x65\x61tureBinningParamProtob\x06proto3')
_IVPARAM = DESCRIPTOR.message_types_by_name['IVParam']
_FEATUREBINNINGRESULT = DESCRIPTOR.message_types_by_name['FeatureBinningResult']
_FEATUREBINNINGRESULT_BINNINGRESULTENTRY = _FEATUREBINNINGRESULT.nested_types_by_name['BinningResultEntry']
_MULTICLASSRESULT = DESCRIPTOR.message_types_by_name['MultiClassResult']
_BINNINGSINGLEFEATUREVALUE = DESCRIPTOR.message_types_by_name['BinningSingleFeatureValue']
_FEATUREBINNINGPARAM = DESCRIPTOR.message_types_by_name['FeatureBinningParam']
IVParam = _reflection.GeneratedProtocolMessageType('IVParam', (_message.Message,), {
'DESCRIPTOR' : _IVPARAM,
'__module__' : 'feature_binning_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.IVParam)
})
_sym_db.RegisterMessage(IVParam)
FeatureBinningResult = _reflection.GeneratedProtocolMessageType('FeatureBinningResult', (_message.Message,), {
'BinningResultEntry' : _reflection.GeneratedProtocolMessageType('BinningResultEntry', (_message.Message,), {
'DESCRIPTOR' : _FEATUREBINNINGRESULT_BINNINGRESULTENTRY,
'__module__' : 'feature_binning_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningResult.BinningResultEntry)
})
,
'DESCRIPTOR' : _FEATUREBINNINGRESULT,
'__module__' : 'feature_binning_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningResult)
})
_sym_db.RegisterMessage(FeatureBinningResult)
_sym_db.RegisterMessage(FeatureBinningResult.BinningResultEntry)
MultiClassResult = _reflection.GeneratedProtocolMessageType('MultiClassResult', (_message.Message,), {
'DESCRIPTOR' : _MULTICLASSRESULT,
'__module__' : 'feature_binning_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.MultiClassResult)
})
_sym_db.RegisterMessage(MultiClassResult)
BinningSingleFeatureValue = _reflection.GeneratedProtocolMessageType('BinningSingleFeatureValue', (_message.Message,), {
'DESCRIPTOR' : _BINNINGSINGLEFEATUREVALUE,
'__module__' : 'feature_binning_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.BinningSingleFeatureValue)
})
_sym_db.RegisterMessage(BinningSingleFeatureValue)
FeatureBinningParam = _reflection.GeneratedProtocolMessageType('FeatureBinningParam', (_message.Message,), {
'DESCRIPTOR' : _FEATUREBINNINGPARAM,
'__module__' : 'feature_binning_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.FeatureBinningParam)
})
_sym_db.RegisterMessage(FeatureBinningParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\030FeatureBinningParamProto'
_FEATUREBINNINGRESULT_BINNINGRESULTENTRY._options = None
_FEATUREBINNINGRESULT_BINNINGRESULTENTRY._serialized_options = b'8\001'
_IVPARAM._serialized_start=72
_IVPARAM._serialized_end=363
_FEATUREBINNINGRESULT._serialized_start=366
_FEATUREBINNINGRESULT._serialized_end=628
_FEATUREBINNINGRESULT_BINNINGRESULTENTRY._serialized_start=527
_FEATUREBINNINGRESULT_BINNINGRESULTENTRY._serialized_end=628
_MULTICLASSRESULT._serialized_start=631
_MULTICLASSRESULT._serialized_end=877
_BINNINGSINGLEFEATUREVALUE._serialized_start=879
_BINNINGSINGLEFEATUREVALUE._serialized_end=961
_FEATUREBINNINGPARAM._serialized_start=964
_FEATUREBINNINGPARAM._serialized_end=1589
# @@protoc_insertion_point(module_scope)
| 6,530 | 72.382022 | 2,546 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/lr_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lr-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
import sshe_cipher_param_pb2 as sshe__cipher__param__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14lr-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\x1a\x17sshe-cipher-param.proto\"\x85\x05\n\x0cLRModelParam\x12\r\n\x05iters\x18\x01 \x01(\x05\x12\x14\n\x0closs_history\x18\x02 \x03(\x01\x12\x14\n\x0cis_converged\x18\x03 \x01(\x08\x12P\n\x06weight\x18\x04 \x03(\x0b\x32@.com.webank.ai.fate.core.mlmodel.buffer.LRModelParam.WeightEntry\x12\x11\n\tintercept\x18\x05 \x01(\x01\x12\x0e\n\x06header\x18\x06 \x03(\t\x12S\n\x12one_vs_rest_result\x18\x07 \x01(\x0b\x32\x37.com.webank.ai.fate.core.mlmodel.buffer.OneVsRestResult\x12\x18\n\x10need_one_vs_rest\x18\x08 \x01(\x08\x12\x16\n\x0e\x62\x65st_iteration\x18\t \x01(\x05\x12\x63\n\x10\x65ncrypted_weight\x18\n \x03(\x0b\x32I.com.webank.ai.fate.core.mlmodel.buffer.LRModelParam.EncryptedWeightEntry\x12>\n\x06\x63ipher\x18\x0b \x01(\x0b\x32..com.webank.ai.fate.core.mlmodel.buffer.Cipher\x1a-\n\x0bWeightEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1aj\n\x14\x45ncryptedWeightEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.com.webank.ai.fate.core.mlmodel.buffer.CipherText:\x02\x38\x01\"\x93\x04\n\x0bSingleModel\x12\r\n\x05iters\x18\x01 \x01(\x05\x12\x14\n\x0closs_history\x18\x02 \x03(\x01\x12\x14\n\x0cis_converged\x18\x03 \x01(\x08\x12O\n\x06weight\x18\x04 \x03(\x0b\x32?.com.webank.ai.fate.core.mlmodel.buffer.SingleModel.WeightEntry\x12\x11\n\tintercept\x18\x05 \x01(\x01\x12\x0e\n\x06header\x18\x06 \x03(\t\x12\x16\n\x0e\x62\x65st_iteration\x18\x07 \x01(\x05\x12\x62\n\x10\x65ncrypted_weight\x18\x08 \x03(\x0b\x32H.com.webank.ai.fate.core.mlmodel.buffer.SingleModel.EncryptedWeightEntry\x12>\n\x06\x63ipher\x18\t \x01(\x0b\x32..com.webank.ai.fate.core.mlmodel.buffer.Cipher\x1a-\n\x0bWeightEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1aj\n\x14\x45ncryptedWeightEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.com.webank.ai.fate.core.mlmodel.buffer.CipherText:\x02\x38\x01\"}\n\x0fOneVsRestResult\x12M\n\x10\x63ompleted_models\x18\x01 \x03(\x0b\x32\x33.com.webank.ai.fate.core.mlmodel.buffer.SingleModel\x12\x1b\n\x13one_vs_rest_classes\x18\x02 \x03(\tB\x13\x42\x11LRModelParamProtob\x06proto3')
_LRMODELPARAM = DESCRIPTOR.message_types_by_name['LRModelParam']
_LRMODELPARAM_WEIGHTENTRY = _LRMODELPARAM.nested_types_by_name['WeightEntry']
_LRMODELPARAM_ENCRYPTEDWEIGHTENTRY = _LRMODELPARAM.nested_types_by_name['EncryptedWeightEntry']
_SINGLEMODEL = DESCRIPTOR.message_types_by_name['SingleModel']
_SINGLEMODEL_WEIGHTENTRY = _SINGLEMODEL.nested_types_by_name['WeightEntry']
_SINGLEMODEL_ENCRYPTEDWEIGHTENTRY = _SINGLEMODEL.nested_types_by_name['EncryptedWeightEntry']
_ONEVSRESTRESULT = DESCRIPTOR.message_types_by_name['OneVsRestResult']
LRModelParam = _reflection.GeneratedProtocolMessageType('LRModelParam', (_message.Message,), {
'WeightEntry' : _reflection.GeneratedProtocolMessageType('WeightEntry', (_message.Message,), {
'DESCRIPTOR' : _LRMODELPARAM_WEIGHTENTRY,
'__module__' : 'lr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LRModelParam.WeightEntry)
})
,
'EncryptedWeightEntry' : _reflection.GeneratedProtocolMessageType('EncryptedWeightEntry', (_message.Message,), {
'DESCRIPTOR' : _LRMODELPARAM_ENCRYPTEDWEIGHTENTRY,
'__module__' : 'lr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LRModelParam.EncryptedWeightEntry)
})
,
'DESCRIPTOR' : _LRMODELPARAM,
'__module__' : 'lr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LRModelParam)
})
_sym_db.RegisterMessage(LRModelParam)
_sym_db.RegisterMessage(LRModelParam.WeightEntry)
_sym_db.RegisterMessage(LRModelParam.EncryptedWeightEntry)
SingleModel = _reflection.GeneratedProtocolMessageType('SingleModel', (_message.Message,), {
'WeightEntry' : _reflection.GeneratedProtocolMessageType('WeightEntry', (_message.Message,), {
'DESCRIPTOR' : _SINGLEMODEL_WEIGHTENTRY,
'__module__' : 'lr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.SingleModel.WeightEntry)
})
,
'EncryptedWeightEntry' : _reflection.GeneratedProtocolMessageType('EncryptedWeightEntry', (_message.Message,), {
'DESCRIPTOR' : _SINGLEMODEL_ENCRYPTEDWEIGHTENTRY,
'__module__' : 'lr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.SingleModel.EncryptedWeightEntry)
})
,
'DESCRIPTOR' : _SINGLEMODEL,
'__module__' : 'lr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.SingleModel)
})
_sym_db.RegisterMessage(SingleModel)
_sym_db.RegisterMessage(SingleModel.WeightEntry)
_sym_db.RegisterMessage(SingleModel.EncryptedWeightEntry)
OneVsRestResult = _reflection.GeneratedProtocolMessageType('OneVsRestResult', (_message.Message,), {
'DESCRIPTOR' : _ONEVSRESTRESULT,
'__module__' : 'lr_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OneVsRestResult)
})
_sym_db.RegisterMessage(OneVsRestResult)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\021LRModelParamProto'
_LRMODELPARAM_WEIGHTENTRY._options = None
_LRMODELPARAM_WEIGHTENTRY._serialized_options = b'8\001'
_LRMODELPARAM_ENCRYPTEDWEIGHTENTRY._options = None
_LRMODELPARAM_ENCRYPTEDWEIGHTENTRY._serialized_options = b'8\001'
_SINGLEMODEL_WEIGHTENTRY._options = None
_SINGLEMODEL_WEIGHTENTRY._serialized_options = b'8\001'
_SINGLEMODEL_ENCRYPTEDWEIGHTENTRY._options = None
_SINGLEMODEL_ENCRYPTEDWEIGHTENTRY._serialized_options = b'8\001'
_LRMODELPARAM._serialized_start=90
_LRMODELPARAM._serialized_end=735
_LRMODELPARAM_WEIGHTENTRY._serialized_start=582
_LRMODELPARAM_WEIGHTENTRY._serialized_end=627
_LRMODELPARAM_ENCRYPTEDWEIGHTENTRY._serialized_start=629
_LRMODELPARAM_ENCRYPTEDWEIGHTENTRY._serialized_end=735
_SINGLEMODEL._serialized_start=738
_SINGLEMODEL._serialized_end=1269
_SINGLEMODEL_WEIGHTENTRY._serialized_start=582
_SINGLEMODEL_WEIGHTENTRY._serialized_end=627
_SINGLEMODEL_ENCRYPTEDWEIGHTENTRY._serialized_start=629
_SINGLEMODEL_ENCRYPTEDWEIGHTENTRY._serialized_end=735
_ONEVSRESTRESULT._serialized_start=1271
_ONEVSRESTRESULT._serialized_end=1396
# @@protoc_insertion_point(module_scope)
| 7,093 | 64.082569 | 2,288 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/hetero_nn_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hetero-nn-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ahetero-nn-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"3\n\x0eOptimizerParam\x12\x11\n\toptimizer\x18\x01 \x01(\t\x12\x0e\n\x06kwargs\x18\x02 \x01(\t\"!\n\x0cPredictParam\x12\x11\n\tthreshold\x18\x01 \x01(\x01\"\x89\x02\n\x11HeteroNNModelMeta\x12\x13\n\x0b\x63onfig_type\x18\x01 \x01(\t\x12\x18\n\x10\x62ottom_nn_define\x18\x02 \x03(\t\x12 \n\x18interactive_layer_define\x18\x03 \x01(\t\x12\x15\n\rtop_nn_define\x18\x04 \x03(\t\x12\x0f\n\x07metrics\x18\x05 \x03(\t\x12O\n\x0foptimizer_param\x18\x06 \x01(\x0b\x32\x36.com.webank.ai.fate.core.mlmodel.buffer.OptimizerParam\x12\x0c\n\x04loss\x18\x07 \x01(\t\x12\x1c\n\x14interactive_layer_lr\x18\x08 \x01(\x01\"\xcf\x01\n\x0cHeteroNNMeta\x12W\n\x14hetero_nn_model_meta\x18\x01 \x01(\x0b\x32\x39.com.webank.ai.fate.core.mlmodel.buffer.HeteroNNModelMeta\x12\x11\n\ttask_type\x18\x02 \x01(\t\x12\x12\n\nbatch_size\x18\x03 \x01(\x05\x12\x0e\n\x06\x65pochs\x18\x04 \x01(\x05\x12\x12\n\nearly_stop\x18\x05 \x01(\t\x12\x0b\n\x03tol\x18\x06 \x01(\x01\x12\x0e\n\x06module\x18\x07 \x01(\tB\x18\x42\x16HeteroNNModelMetaProtob\x06proto3')
_OPTIMIZERPARAM = DESCRIPTOR.message_types_by_name['OptimizerParam']
_PREDICTPARAM = DESCRIPTOR.message_types_by_name['PredictParam']
_HETERONNMODELMETA = DESCRIPTOR.message_types_by_name['HeteroNNModelMeta']
_HETERONNMETA = DESCRIPTOR.message_types_by_name['HeteroNNMeta']
OptimizerParam = _reflection.GeneratedProtocolMessageType('OptimizerParam', (_message.Message,), {
'DESCRIPTOR' : _OPTIMIZERPARAM,
'__module__' : 'hetero_nn_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OptimizerParam)
})
_sym_db.RegisterMessage(OptimizerParam)
PredictParam = _reflection.GeneratedProtocolMessageType('PredictParam', (_message.Message,), {
'DESCRIPTOR' : _PREDICTPARAM,
'__module__' : 'hetero_nn_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PredictParam)
})
_sym_db.RegisterMessage(PredictParam)
HeteroNNModelMeta = _reflection.GeneratedProtocolMessageType('HeteroNNModelMeta', (_message.Message,), {
'DESCRIPTOR' : _HETERONNMODELMETA,
'__module__' : 'hetero_nn_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.HeteroNNModelMeta)
})
_sym_db.RegisterMessage(HeteroNNModelMeta)
HeteroNNMeta = _reflection.GeneratedProtocolMessageType('HeteroNNMeta', (_message.Message,), {
'DESCRIPTOR' : _HETERONNMETA,
'__module__' : 'hetero_nn_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.HeteroNNMeta)
})
_sym_db.RegisterMessage(HeteroNNMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\026HeteroNNModelMetaProto'
_OPTIMIZERPARAM._serialized_start=70
_OPTIMIZERPARAM._serialized_end=121
_PREDICTPARAM._serialized_start=123
_PREDICTPARAM._serialized_end=156
_HETERONNMODELMETA._serialized_start=159
_HETERONNMODELMETA._serialized_end=424
_HETERONNMETA._serialized_start=427
_HETERONNMETA._serialized_end=634
# @@protoc_insertion_point(module_scope)
| 3,714 | 55.287879 | 1,155 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/linr_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: linr-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15linr-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xd0\x01\n\rLinRModelMeta\x12\x0f\n\x07penalty\x18\x01 \x01(\t\x12\x0b\n\x03tol\x18\x02 \x01(\x01\x12\r\n\x05\x61lpha\x18\x03 \x01(\x01\x12\x11\n\toptimizer\x18\x04 \x01(\t\x12\x12\n\nbatch_size\x18\x05 \x01(\x03\x12\x15\n\rlearning_rate\x18\x06 \x01(\x01\x12\x10\n\x08max_iter\x18\x07 \x01(\x03\x12\x12\n\nearly_stop\x18\x08 \x01(\t\x12\x15\n\rfit_intercept\x18\t \x01(\x08\x12\x17\n\x0freveal_strategy\x18\n \x01(\tB\x14\x42\x12LinRModelMetaProtob\x06proto3')
_LINRMODELMETA = DESCRIPTOR.message_types_by_name['LinRModelMeta']
LinRModelMeta = _reflection.GeneratedProtocolMessageType('LinRModelMeta', (_message.Message,), {
'DESCRIPTOR' : _LINRMODELMETA,
'__module__' : 'linr_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.LinRModelMeta)
})
_sym_db.RegisterMessage(LinRModelMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\022LinRModelMetaProto'
_LINRMODELMETA._serialized_start=66
_LINRMODELMETA._serialized_end=274
# @@protoc_insertion_point(module_scope)
| 1,740 | 47.361111 | 593 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/psi_model_meta_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: psi-model-meta.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14psi-model-meta.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\x1e\n\x07PSIMeta\x12\x13\n\x0bmax_bin_num\x18\x01 \x01(\x05\x42\x1a\x42\x18\x42oostTreeModelParamProtob\x06proto3')
_PSIMETA = DESCRIPTOR.message_types_by_name['PSIMeta']
PSIMeta = _reflection.GeneratedProtocolMessageType('PSIMeta', (_message.Message,), {
'DESCRIPTOR' : _PSIMETA,
'__module__' : 'psi_model_meta_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.PSIMeta)
})
_sym_db.RegisterMessage(PSIMeta)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\030BoostTreeModelParamProto'
_PSIMETA._serialized_start=64
_PSIMETA._serialized_end=94
# @@protoc_insertion_point(module_scope)
| 1,343 | 36.333333 | 247 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/onehot_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: onehot-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12onehot-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"6\n\x07\x43olsMap\x12\x0e\n\x06values\x18\x01 \x03(\t\x12\x1b\n\x13transformed_headers\x18\x02 \x03(\t\"\xd6\x01\n\x0bOneHotParam\x12P\n\x07\x63ol_map\x18\x01 \x03(\x0b\x32?.com.webank.ai.fate.core.mlmodel.buffer.OneHotParam.ColMapEntry\x12\x15\n\rresult_header\x18\x02 \x03(\t\x1a^\n\x0b\x43olMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12>\n\x05value\x18\x02 \x01(\x0b\x32/.com.webank.ai.fate.core.mlmodel.buffer.ColsMap:\x02\x38\x01\x42\x12\x42\x10OneHotParamProtob\x06proto3')
_COLSMAP = DESCRIPTOR.message_types_by_name['ColsMap']
_ONEHOTPARAM = DESCRIPTOR.message_types_by_name['OneHotParam']
_ONEHOTPARAM_COLMAPENTRY = _ONEHOTPARAM.nested_types_by_name['ColMapEntry']
ColsMap = _reflection.GeneratedProtocolMessageType('ColsMap', (_message.Message,), {
'DESCRIPTOR' : _COLSMAP,
'__module__' : 'onehot_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.ColsMap)
})
_sym_db.RegisterMessage(ColsMap)
OneHotParam = _reflection.GeneratedProtocolMessageType('OneHotParam', (_message.Message,), {
'ColMapEntry' : _reflection.GeneratedProtocolMessageType('ColMapEntry', (_message.Message,), {
'DESCRIPTOR' : _ONEHOTPARAM_COLMAPENTRY,
'__module__' : 'onehot_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OneHotParam.ColMapEntry)
})
,
'DESCRIPTOR' : _ONEHOTPARAM,
'__module__' : 'onehot_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.OneHotParam)
})
_sym_db.RegisterMessage(OneHotParam)
_sym_db.RegisterMessage(OneHotParam.ColMapEntry)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\020OneHotParamProto'
_ONEHOTPARAM_COLMAPENTRY._options = None
_ONEHOTPARAM_COLMAPENTRY._serialized_options = b'8\001'
_COLSMAP._serialized_start=62
_COLSMAP._serialized_end=116
_ONEHOTPARAM._serialized_start=119
_ONEHOTPARAM._serialized_end=333
_ONEHOTPARAM_COLMAPENTRY._serialized_start=239
_ONEHOTPARAM_COLMAPENTRY._serialized_end=333
# @@protoc_insertion_point(module_scope)
| 2,745 | 45.542373 | 608 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/generated/homo_nn_model_param_pb2.py
|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: homo-nn-model-param.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19homo-nn-model-param.proto\x12&com.webank.ai.fate.core.mlmodel.buffer\"\xab\x01\n\x0bHomoNNParam\x12\x13\n\x0bmodel_bytes\x18\x01 \x01(\x0c\x12\x18\n\x10\x65xtra_data_bytes\x18\x02 \x01(\x0c\x12\x11\n\tepoch_idx\x18\x03 \x01(\x05\x12\x17\n\x0f\x63onverge_status\x18\x04 \x01(\x08\x12\x14\n\x0closs_history\x18\x05 \x03(\x02\x12\x12\n\nbest_epoch\x18\x06 \x01(\x05\x12\x17\n\x0flocal_save_path\x18\x07 \x01(\tB\x12\x42\x10HomoNNParamProtob\x06proto3')
_HOMONNPARAM = DESCRIPTOR.message_types_by_name['HomoNNParam']
HomoNNParam = _reflection.GeneratedProtocolMessageType('HomoNNParam', (_message.Message,), {
'DESCRIPTOR' : _HOMONNPARAM,
'__module__' : 'homo_nn_model_param_pb2'
# @@protoc_insertion_point(class_scope:com.webank.ai.fate.core.mlmodel.buffer.HomoNNParam)
})
_sym_db.RegisterMessage(HomoNNParam)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'B\020HomoNNParamProto'
_HOMONNPARAM._serialized_start=70
_HOMONNPARAM._serialized_end=241
# @@protoc_insertion_point(module_scope)
| 1,650 | 44.861111 | 515 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/test/test_tree_converter.py
|
from federatedml.protobuf.model_migrate.converter.tree_model_converter import HeteroSBTConverter
from federatedml.protobuf.generated.boosting_tree_model_param_pb2 import BoostingTreeModelParam, NodeParam, \
DecisionTreeModelParam, FeatureImportanceInfo
from federatedml.protobuf.generated.boosting_tree_model_meta_pb2 import BoostingTreeModelMeta
from federatedml.protobuf.model_migrate.converter.tree_model_converter import HeteroSBTConverter
from federatedml.protobuf.model_migrate.model_migrate import model_migration
import copy
host_old = [10000, 9999]
host_new = [114, 514, ]
guest_old = [10000]
guest_new = [1919]
param = BoostingTreeModelParam()
fp0 = FeatureImportanceInfo()
fp0.fullname = 'host_10000_0'
fp0.sitename = 'host:10000'
fp1 = FeatureImportanceInfo()
fp1.sitename = 'host:9999'
fp1.fullname = 'host_9999_1'
fp2 = FeatureImportanceInfo(fullname='x0')
fp2.sitename = 'guest:10000'
feature_importance = [fp0, fp1, fp2]
param.feature_importances.extend(feature_importance)
tree_0 = DecisionTreeModelParam(tree_=[NodeParam(sitename='guest:10000'), NodeParam(sitename='guest:10000'),
NodeParam(sitename='guest:10000')])
tree_1 = DecisionTreeModelParam(tree_=[NodeParam(sitename='host:10000'), NodeParam(sitename='host:9999'),
NodeParam(sitename='host:10000')])
tree_2 = DecisionTreeModelParam(tree_=[NodeParam(sitename='host:9999'), NodeParam(sitename='guest:10000'),
NodeParam(sitename='host:9999')])
tree_3 = DecisionTreeModelParam()
param.trees_.extend([tree_0, tree_1, tree_2, tree_3])
rs = model_migration({'HelloParam': param, 'HelloMeta': {}}, 'HeteroSecureBoost', old_guest_list=guest_old,
new_guest_list=guest_new, old_host_list=host_old, new_host_list=host_new, )
| 1,840 | 42.833333 | 109 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/test/test_binning_converter.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 federatedml.protobuf.model_migrate.converter.binning_model_converter import FeatureBinningConverter
from federatedml.protobuf.generated.feature_binning_meta_pb2 import FeatureBinningMeta
from federatedml.protobuf.generated.feature_binning_param_pb2 import FeatureBinningParam
from federatedml.protobuf.model_migrate.converter.tree_model_converter import HeteroSBTConverter
from federatedml.protobuf.model_migrate.model_migrate import model_migration
import copy
host_old = [10000, 9999]
host_new = [114, 514, ]
guest_old = [10000]
guest_new = [1919]
param = FeatureBinningParam()
old_header = ['host_10000_0', 'host_10000_1', 'host_10000_2', 'host_10000_3']
param.header_anonymous = old_header
rs = model_migration({'HelloParam': param, 'HelloMeta': {}}, 'HeteroSecureBoost', old_guest_list=guest_old,
new_guest_list=guest_new, old_host_list=host_old, new_host_list=host_new, )
print(rs)
| 1,583 | 36.714286 | 107 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/binning_model_migrate.py
|
#
# 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 federatedml.protobuf import parse_pb_buffer
def extract_woe_array_dict(model_param_dict, host_idx=0):
if len(model_param_dict.get("multiClassResults", {}).get("labels", [])) > 2:
raise ValueError(f"Does not support transforming model trained on multi-label data. Please check.")
host_result = model_param_dict.get("hostResults", [])[host_idx].get("binningResult", {})
woe_array_dict = {}
for col, res in host_result.items():
woe_array_dict[col] = {"woeArray": res.get("woeArray", [])}
return woe_array_dict
def merge_woe_array_dict(pb_name, model_param_pb, model_param_dict, woe_array_dict):
model_param_pb = parse_pb_buffer(pb_name, model_param_pb)
header, anonymous_header = list(model_param_pb.header), list(model_param_pb.header_anonymous)
if len(header) != len(anonymous_header):
raise ValueError(
"Given header length and anonymous header length in model param do not match. "
"Please check!"
)
anonymous_col_name_dict = dict(zip(header, anonymous_header))
for col_name in model_param_pb.binning_result.binning_result:
try:
woe_array = woe_array_dict[anonymous_col_name_dict[col_name]]["woeArray"]
except KeyError:
continue
model_param_pb.binning_result.binning_result[col_name].woe_array[:] = woe_array
model_param_dict["binningResult"]["binningResult"][col_name]["woeArray"] = woe_array
for col_name in model_param_pb.multi_class_result.results[0].binning_result:
try:
woe_array = woe_array_dict[anonymous_col_name_dict[col_name]]["woeArray"]
except KeyError:
continue
model_param_pb.multi_class_result.results[0].binning_result[col_name].woe_array[:] = woe_array
model_param_dict["multiClassResult"]["results"][0]["binningResult"][col_name]["woeArray"] = woe_array
return model_param_pb.SerializeToString(), model_param_dict
def set_model_meta(model_meta_dict):
model_meta_dict.get("transformParam", {})["transformType"] = "woe"
return model_meta_dict
| 2,720 | 40.227273 | 109 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/model_migrate.py
|
from typing import List
from federatedml.protobuf.model_migrate.converter_factory import converter_factory
from federatedml.model_base import serialize_models
import copy
def generate_id_mapping(old_id, new_id):
if old_id is None and new_id is None:
return {}
elif not (isinstance(old_id, list) and isinstance(new_id, list)):
raise ValueError('illegal input format: id lists type should be list, however got: \n'
'content: {}/ type: {} \n'
'content: {}/ type: {}'.format(old_id, type(old_id), new_id, type(new_id)))
if len(old_id) != len(new_id):
raise ValueError('id lists length does not match: len({}) != len({})'.format(old_id, new_id))
mapping = {}
for id0, id1 in zip(old_id, new_id):
if not isinstance(id0, int) or not isinstance(id1, int):
raise ValueError('party id must be an integer, got {}:{} and {}:{}'.format(id0, type(id0),
id1, type(id1)))
mapping[id0] = id1
return mapping
def model_migration(model_contents: dict,
module_name,
old_guest_list: List[int],
new_guest_list: List[int],
old_host_list: List[int],
new_host_list: List[int],
old_arbiter_list=None,
new_arbiter_list=None,
):
converter = converter_factory(module_name)
if converter is None:
# no supported converter, return
return serialize_models(model_contents)
# replace old id with new id using converter
guest_mapping_dict = generate_id_mapping(old_guest_list, new_guest_list)
host_mapping_dict = generate_id_mapping(old_host_list, new_host_list)
arbiter_mapping_dict = generate_id_mapping(old_arbiter_list, new_arbiter_list)
model_contents_cpy = copy.deepcopy(model_contents)
keys = model_contents.keys()
param, meta = None, None
param_key, meta_key = None, None
for key in keys:
if 'Param' in key:
param_key = key
param = model_contents_cpy[key]
if 'Meta' in key:
meta_key = key
meta = model_contents_cpy[key]
if param is None or meta is None:
raise ValueError('param or meta is None')
converted_param, converted_meta = converter.convert(param, meta, guest_mapping_dict,
host_mapping_dict, arbiter_mapping_dict)
return serialize_models({param_key: converted_param, meta_key: converted_meta})
| 2,660 | 38.132353 | 103 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/converter_factory.py
|
import typing
from federatedml.protobuf.model_migrate.converter.binning_model_converter import FeatureBinningConverter
from federatedml.protobuf.model_migrate.converter.converter_base import ProtoConverterBase
from federatedml.protobuf.model_migrate.converter.feature_selection_model_converter import \
HeteroFeatureSelectionConverter
from federatedml.protobuf.model_migrate.converter.pearson_model_converter import HeteroPearsonConverter
from federatedml.protobuf.model_migrate.converter.tree_model_converter import HeteroSBTConverter
from federatedml.protobuf.model_migrate.converter.data_transform_converter import DataTransformConverter
def converter_factory(module_name: str) -> typing.Optional[ProtoConverterBase]:
if module_name == 'HeteroSecureBoost':
return HeteroSBTConverter()
elif module_name == 'HeteroFastSecureBoost':
return HeteroSBTConverter()
elif module_name == 'HeteroPearson':
return HeteroPearsonConverter()
elif module_name == 'HeteroFeatureBinning':
return FeatureBinningConverter()
elif module_name == 'HeteroFeatureSelection':
return HeteroFeatureSelectionConverter()
elif module_name == "DataTransform":
return DataTransformConverter()
else:
return None
| 1,272 | 46.148148 | 104 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/__init__.py
| 0 | 0 | 0 |
py
|
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/converter/tree_model_converter.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 typing import Dict
from federatedml.util import consts
from federatedml.protobuf.generated.boosting_tree_model_meta_pb2 import BoostingTreeModelMeta
from federatedml.protobuf.generated.boosting_tree_model_param_pb2 import BoostingTreeModelParam
from federatedml.protobuf.model_migrate.converter.converter_base import AutoReplace
from federatedml.protobuf.model_migrate.converter.converter_base import ProtoConverterBase
class HeteroSBTConverter(ProtoConverterBase):
def convert(self, param: BoostingTreeModelParam, meta: BoostingTreeModelMeta,
guest_id_mapping: Dict,
host_id_mapping: Dict,
arbiter_id_mapping: Dict,
tree_plan_delimiter='_'
):
feat_importance_list = list(param.feature_importances)
fid_feature_mapping = dict(param.feature_name_fid_mapping)
feature_fid_mapping = {v: k for k, v in fid_feature_mapping.items()}
tree_list = list(param.trees_)
tree_plan = list(param.tree_plan)
replacer = AutoReplace(guest_id_mapping, host_id_mapping, arbiter_id_mapping)
# fp == feature importance
for fp in feat_importance_list:
fp.sitename = replacer.replace(fp.sitename)
if fp.fullname not in feature_fid_mapping:
fp.fullname = replacer.migrate_anonymous_header(fp.fullname)
for tree in tree_list:
tree_nodes = list(tree.tree_)
for node in tree_nodes:
node.sitename = replacer.replace(node.sitename)
new_tree_plan = []
for str_tuple in tree_plan:
param.tree_plan.remove(str_tuple)
tree_mode, party_id = str_tuple.split(tree_plan_delimiter)
if int(party_id) != -1:
new_party_id = replacer.plain_replace(party_id, role=consts.HOST)
else:
new_party_id = party_id
new_tree_plan.append(tree_mode + tree_plan_delimiter + new_party_id)
param.tree_plan.extend(new_tree_plan)
return param, meta
| 2,723 | 40.272727 | 95 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/converter/binning_model_converter.py
|
#
# 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 typing import Dict, Tuple
from federatedml.protobuf.generated.feature_binning_meta_pb2 import FeatureBinningMeta
from federatedml.protobuf.generated.feature_binning_param_pb2 import FeatureBinningParam, IVParam
from federatedml.protobuf.model_migrate.converter.converter_base import AutoReplace
from federatedml.protobuf.model_migrate.converter.converter_base import ProtoConverterBase
from google.protobuf.json_format import MessageToDict
class FeatureBinningConverter(ProtoConverterBase):
def convert(self, param: FeatureBinningParam, meta: FeatureBinningMeta,
guest_id_mapping: Dict,
host_id_mapping: Dict,
arbiter_id_mapping: Dict
) -> Tuple:
header_anonymous = list(param.header_anonymous)
replacer = AutoReplace(guest_id_mapping, host_id_mapping, arbiter_id_mapping)
param.header_anonymous[:] = replacer.migrate_anonymous_header(header_anonymous)
self._migrate_binning_result(param, replacer, guest_id_mapping, host_id_mapping)
if param.multi_class_result.host_party_ids:
migrate_host_party_ids = []
for host_party_id in param.multi_class_result.host_party_ids:
migrate_host_party_ids.append(str(host_id_mapping[int(host_party_id)]))
param.multi_class_result.host_party_ids[:] = migrate_host_party_ids
self._migrate_binning_result(param.multi_class_result, replacer, guest_id_mapping, host_id_mapping, multi=True)
return param, meta
def _migrate_binning_result(self, param, replacer, guest_id_mapping, host_id_mapping, multi=False):
if multi:
for binning_result in param.results:
migrate_party_id = self.migrate_binning_result(binning_result, guest_id_mapping, host_id_mapping)
if migrate_party_id is not None:
binning_result.party_id = migrate_party_id
else:
migrate_party_id = self.migrate_binning_result(param.binning_result, guest_id_mapping, host_id_mapping)
if migrate_party_id is not None:
param.binning_result.party_id = migrate_party_id
for host_binning_result in param.host_results:
migrate_party_id = self.migrate_binning_result(host_binning_result, guest_id_mapping, host_id_mapping)
if migrate_party_id is not None:
host_binning_result.party_id = migrate_party_id
kv_binning_result = dict(host_binning_result.binning_result)
for col_name, iv_param in kv_binning_result.items():
migrate_col_name = replacer.migrate_anonymous_header(col_name)
host_binning_result.binning_result[migrate_col_name].CopyFrom(iv_param)
del host_binning_result.binning_result[col_name]
@staticmethod
def migrate_binning_result(binning_result, guest_id_mapping, host_id_mapping):
if binning_result.role and binning_result.party_id:
party_id = int(binning_result.party_id)
role = binning_result.role
if role == "guest":
migrate_party_id = guest_id_mapping[party_id]
elif role == "host":
migrate_party_id = host_id_mapping[party_id]
else:
raise ValueError(f"unsupported role {role} in binning migration")
return str(migrate_party_id)
return None
| 4,038 | 45.425287 | 119 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/converter/data_transform_converter.py
|
#
# 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 typing import Dict, Tuple
from federatedml.protobuf.generated.data_transform_meta_pb2 import DataTransformMeta
from federatedml.protobuf.generated.data_transform_param_pb2 import DataTransformParam
from federatedml.protobuf.model_migrate.converter.converter_base import AutoReplace
from federatedml.protobuf.model_migrate.converter.converter_base import ProtoConverterBase
class DataTransformConverter(ProtoConverterBase):
def convert(self, param: DataTransformParam, meta: DataTransformMeta,
guest_id_mapping: Dict,
host_id_mapping: Dict,
arbiter_id_mapping: Dict
) -> Tuple:
try:
anonymous_header = list(param.anonymous_header)
replacer = AutoReplace(guest_id_mapping, host_id_mapping, arbiter_id_mapping)
param.anonymous_header[:] = replacer.migrate_anonymous_header(anonymous_header)
return param, meta
except AttributeError:
return param, meta
| 1,618 | 40.512821 | 91 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/converter/feature_selection_model_converter.py
|
#
# 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 typing import Dict, Tuple
from federatedml.protobuf.generated.feature_selection_meta_pb2 import FeatureSelectionMeta
from federatedml.protobuf.generated.feature_selection_param_pb2 import FeatureSelectionParam, \
FeatureSelectionFilterParam, FeatureValue, LeftCols
from federatedml.protobuf.model_migrate.converter.converter_base import AutoReplace
from federatedml.protobuf.model_migrate.converter.converter_base import ProtoConverterBase
class HeteroFeatureSelectionConverter(ProtoConverterBase):
def convert(self, param: FeatureSelectionParam, meta: FeatureSelectionMeta,
guest_id_mapping: Dict,
host_id_mapping: Dict,
arbiter_id_mapping: Dict
) -> Tuple:
replacer = AutoReplace(guest_id_mapping, host_id_mapping, arbiter_id_mapping)
host_col_name_objs = list(param.host_col_names)
for col_obj in host_col_name_objs:
old_party_id = col_obj.party_id
col_obj.party_id = str(host_id_mapping[int(old_party_id)])
col_names = list(col_obj.col_names)
for idx, col_name in enumerate(col_names):
col_obj.col_names[idx] = replacer.migrate_anonymous_header(col_name)
filter_results = list(param.results)
new_results = []
for idx, result in enumerate(filter_results):
host_feature_values = list(result.host_feature_values)
new_feature_value_list = []
for this_host in host_feature_values:
feature_values = dict(this_host.feature_values)
new_feature_values = {replacer.migrate_anonymous_header(k): v for k, v in feature_values.items()}
new_feature_value_list.append(FeatureValue(feature_values=new_feature_values))
left_col_list = list(result.host_left_cols)
new_host_left_col = []
for left_col_obj in left_col_list:
original_cols = [replacer.migrate_anonymous_header(x) for x in left_col_obj.original_cols]
left_cols = {replacer.migrate_anonymous_header(k): v for k, v in dict(left_col_obj.left_cols).items()}
new_host_left_col.append(LeftCols(original_cols=original_cols,
left_cols=left_cols))
new_result = FeatureSelectionFilterParam(feature_values=result.feature_values,
host_feature_values=new_feature_value_list,
left_cols=result.left_cols,
host_left_cols=new_host_left_col,
filter_name=result.filter_name)
new_results.append(new_result)
del param.results[:]
param.results.extend(new_results)
try:
for col_name, anonym in dict(param.col_name_to_anonym_dict).items():
new_anonym = replacer.migrate_anonymous_header(anonym)
# del param.col_name_to_anonym_dict[col_name]
param.col_name_to_anonym_dict[col_name] = new_anonym
"""param = FeatureSelectionParam(
results=new_results,
final_left_cols=param.final_left_cols,
col_names=param.col_names,
host_col_names=param.host_col_names,
header=param.header,
col_name_to_anonym_dict=param.col_name_to_anonym_dict
)"""
return param, meta
except AttributeError:
return param, meta
| 4,293 | 48.356322 | 118 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/converter/converter_base.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 abc import ABC, abstractmethod
from typing import Dict, Tuple
from federatedml.util.anonymous_generator_util import Anonymous
from federatedml.util import consts
class AutoReplace(object):
def __init__(self, guest_mapping, host_mapping, arbiter_mapping):
self._mapping = {
consts.GUEST: guest_mapping,
consts.HOST: host_mapping,
consts.ARBITER: arbiter_mapping
}
self._anonymous_generator = Anonymous(migrate_mapping=self._mapping)
def get_mapping(self, role: str):
if role not in self._mapping:
raise ValueError('this role contains no site name {}'.format(role))
return self._mapping[role]
def party_tuple_format(self, string: str):
"""({role},{party_id})"""
role, party_id = string.strip("()").split(",")
return f"({role}, {self._mapping[role][int(party_id)]})"
def colon_format(self, string: str):
"""{role}:{party_id}"""
role, party_id = string.split(':')
mapping = self.get_mapping(role)
new_party_id = mapping[int(party_id)]
return role + ':' + str(new_party_id)
def maybe_anonymous_format(self, string: str):
if self._anonymous_generator.is_anonymous(string):
return self.migrate_anonymous_header([string])[0]
else:
return string
def plain_replace(self, old_party_id, role):
old_party_id = int(old_party_id)
mapping = self._mapping[role]
if old_party_id in mapping:
return str(mapping[int(old_party_id)])
return str(old_party_id)
def migrate_anonymous_header(self, anonymous_header):
if isinstance(anonymous_header, list):
return self._anonymous_generator.migrate_anonymous(anonymous_header)
else:
return self._anonymous_generator.migrate_anonymous([anonymous_header])[0]
def replace(self, string):
if ':' in string:
return self.colon_format(string)
else:
# nothing to replace
return string
class ProtoConverterBase(ABC):
@abstractmethod
def convert(self, param, meta,
guest_id_mapping: Dict,
host_id_mapping: Dict,
arbiter_id_mapping: Dict
) -> Tuple:
raise NotImplementedError('this interface is not implemented')
| 3,044 | 33.213483 | 85 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_migrate/converter/pearson_model_converter.py
|
#
# 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 typing import Dict
from federatedml.protobuf.generated.pearson_model_meta_pb2 import PearsonModelMeta
from federatedml.protobuf.generated.pearson_model_param_pb2 import PearsonModelParam
from federatedml.protobuf.model_migrate.converter.converter_base import ProtoConverterBase, AutoReplace
class HeteroPearsonConverter(ProtoConverterBase):
def convert(self, param: PearsonModelParam, meta: PearsonModelMeta,
guest_id_mapping: Dict,
host_id_mapping: Dict,
arbiter_id_mapping: Dict
):
replacer = AutoReplace(guest_id_mapping, host_id_mapping, arbiter_id_mapping)
param.party = replacer.party_tuple_format(param.party)
for i in range(len(param.parties)):
param.parties[i] = replacer.party_tuple_format(param.parties[i])
for anonymous in param.anonymous_map:
anonymous.anonymous = replacer.migrate_anonymous_header(anonymous.anonymous)
for names in param.all_names:
for i, name in enumerate(names.names):
names.names[i] = replacer.maybe_anonymous_format(name)
return param, meta
| 1,769 | 43.25 | 103 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_merge/merge_sbt.py
|
import json
import numpy as np
import lightgbm as lgb
from sklearn.pipeline import Pipeline
from lightgbm.sklearn import _LGBMLabelEncoder
from federatedml.protobuf.homo_model_convert.lightgbm.gbdt import sbt_to_lgb
from federatedml.protobuf.generated.boosting_tree_model_param_pb2 import BoostingTreeModelParam
from federatedml.protobuf.generated.boosting_tree_model_meta_pb2 import BoostingTreeModelMeta
from google.protobuf import json_format
from federatedml.util.anonymous_generator_util import Anonymous
def _merge_sbt(guest_param, host_param, host_sitename, rename_host=True):
# update feature name fid mapping
guest_fid_map = guest_param['featureNameFidMapping']
guest_fid_map = {int(k): v for k, v in guest_fid_map.items()}
host_fid_map = sorted([(int(k), v) for k, v in host_param['featureNameFidMapping'].items()], key=lambda x: x[0])
guest_feat_len = len(guest_fid_map)
start = guest_feat_len
host_new_fid = {}
for k, v in host_fid_map:
guest_fid_map[start] = v if not rename_host else v + '_' + host_sitename
host_new_fid[k] = start
start += 1
guest_param['featureNameFidMapping'] = guest_fid_map
# merging trees
for tree_guest, tree_host in zip(guest_param['trees'], host_param['trees']):
tree_guest['splitMaskdict'].update(tree_host['splitMaskdict'])
tree_guest['missingDirMaskdict'].update(tree_host['missingDirMaskdict'])
for node_g, node_h in zip(tree_guest['tree'], tree_host['tree']):
if str(node_h['id']) in tree_host['splitMaskdict']:
node_g['fid'] = int(host_new_fid[int(node_h['fid'])])
node_g['sitename'] = host_sitename
node_g['bid'] = 0
return guest_param
def extract_host_name(host_param, idx):
try:
anonymous_obj = Anonymous()
anonymous_dict = host_param['anonymousNameMapping']
role, party_id = None, None
for key in anonymous_dict:
role = anonymous_obj.get_role_from_anonymous_column(key)
party_id = anonymous_obj.get_party_id_from_anonymous_column(key)
break
if role is not None and party_id is not None:
return role + '_' + party_id
else:
return None
except Exception as e:
return 'host_{}'.format(idx)
def merge_sbt(guest_param: dict, guest_meta: dict, host_params: list, host_metas: list, output_format: str,
target_name='y', host_rename=True):
result_param = None
for idx, host_param in enumerate(host_params):
host_name = extract_host_name(host_param, idx)
if result_param is None:
result_param = _merge_sbt(guest_param, host_param, host_name, host_rename)
else:
result_param = _merge_sbt(result_param, host_param, host_name, host_rename)
pb_param = json_format.Parse(json.dumps(result_param), BoostingTreeModelParam())
pb_meta = json_format.Parse(json.dumps(guest_meta), BoostingTreeModelMeta())
lgb_model = sbt_to_lgb(pb_param, pb_meta, False)
if output_format in ['lgb', 'lightgbm']:
return lgb_model
elif output_format in ['pmml']:
classes = list(map(int, pb_param.classes_))
bst = lgb.Booster(model_str=lgb_model)
new_clf = lgb.LGBMRegressor() if guest_meta['taskType'] == 'regression' else lgb.LGBMClassifier()
new_clf._Booster = bst
new_clf._n_features = len(bst.feature_name())
new_clf._n_classes = len(np.unique(classes))
new_clf._le = _LGBMLabelEncoder().fit(np.array(classes))
new_clf.fitted_ = True
new_clf._classes = new_clf._le.classes_
test_pipeline = Pipeline([("lgb", new_clf)])
return test_pipeline
else:
raise ValueError('unknown output type {}'.format(output_format))
| 3,821 | 39.231579 | 116 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_merge/merge_hetero_models.py
|
import copy
import tempfile
import json
import pickle
import base64
from federatedml.protobuf.model_merge.merge_sbt import merge_sbt
from federatedml.protobuf.model_merge.merge_hetero_lr import merge_lr
from nyoka import lgb_to_pmml
from sklearn2pmml import sklearn2pmml
def get_pmml_str(pmml_pipeline, target_name):
tmp_f = tempfile.NamedTemporaryFile()
path = tmp_f.name
lgb_to_pmml(pmml_pipeline, pmml_pipeline['lgb'].feature_name_, target_name, path)
with open(path, 'r') as read_f:
str_ = read_f.read()
tmp_f.close()
return str_
def output_sklearn_pmml_str(pmml_pipeline, ):
tmp_f = tempfile.NamedTemporaryFile()
path = tmp_f.name
sklearn2pmml(pmml_pipeline, path, with_repr=True)
with open(path, 'r') as read_f:
str_ = read_f.read()
tmp_f.close()
return str_
def hetero_model_merge(guest_param: dict, guest_meta: dict, host_params: list, host_metas: list, model_type: str,
output_format: str, target_name: str = 'y', host_rename=False, include_guest_coef=False):
"""
Merge a hetero model
:param guest_param: a json dict contains guest model param
:param guest_meta: a json dict contains guest model meta
:param host_params: a list contains json dicts of host params
:param host_metas: a list contains json dicts of host metas
:param model_type: specify the model type:
secureboost, alias tree, sbt
logistic_regression, alias LR
:param output_format: output format of merged model, support:
lightgbm, for tree models only
sklearn, for linear models only
pmml, for all types
:param target_name: if output format is pmml, need to specify the targe(label) name
:param host_rename: add suffix to secureboost host features
:param include_guest_coef: default False
:return: Merged Model Class
"""
guest_param = copy.deepcopy(guest_param)
guest_meta = copy.deepcopy(guest_meta)
host_params = copy.deepcopy(host_params)
host_metas = copy.deepcopy(host_metas)
if not isinstance(model_type, str):
raise ValueError('model type should be a str, but got {}'.format(model_type))
if output_format.lower() not in {'lightgbm', 'lgb', 'sklearn', 'pmml'}:
raise ValueError('unknown output format: {}'.format(output_format))
if model_type.lower() in ['secureboost', 'tree', 'sbt']:
model = merge_sbt(guest_param, guest_meta, host_params, host_metas, output_format, target_name,
host_rename=host_rename)
if output_format == 'pmml':
return get_pmml_str(model, target_name)
else:
return model
elif model_type.lower() in {'logistic_regression', 'lr'}:
model = merge_lr(guest_param, guest_meta, host_params, host_metas, output_format, include_guest_coef)
if output_format == 'pmml':
return output_sklearn_pmml_str(model)
else:
return json.dumps(str(base64.b64encode(pickle.dumps(model)), "utf-8"))
else:
raise ValueError('model type should be one in ["sbt", "lr"], '
'but got unknown model type: {}'.format(model_type))
| 3,281 | 39.518519 | 113 |
py
|
FATE
|
FATE-master/python/federatedml/protobuf/model_merge/__init__.py
| 0 | 0 | 0 |
py
|
|
FATE
|
FATE-master/python/federatedml/protobuf/model_merge/merge_hetero_lr.py
|
import json
import numpy as np
from federatedml.protobuf.generated.lr_model_param_pb2 import LRModelParam
from federatedml.protobuf.generated.lr_model_meta_pb2 import LRModelMeta
from sklearn.linear_model import LogisticRegression
from sklearn2pmml.pipeline import PMMLPipeline
from google.protobuf import json_format
def _get_coef(param_obj):
coefficient = np.empty((1, len(param_obj.header)))
weight_dict = dict(param_obj.weight)
for index in range(len(param_obj.header)):
coefficient[0][index] = weight_dict[param_obj.header[index]]
return coefficient
def _merge_single_model_coef(guest_pb_param, host_pb_param, include_guest_coef):
host_coef = _get_coef(host_pb_param)
if include_guest_coef:
guest_coef = _get_coef(guest_pb_param)
coef = np.concatenate((guest_coef, host_coef), axis=1)
return coef
return host_coef
def _get_model_header(guest_pb_param, host_pb_param, include_guest_coef, include_role=False):
header = list(host_pb_param.header)
if include_guest_coef:
if include_role:
guest_header = [f"guest_{feature}" for feature in guest_pb_param.header]
host_header = [f"host_{feature}" for feature in header]
else:
guest_header = list(guest_pb_param.header)
host_header = header
header = guest_header + host_header
return header
def merge_lr(guest_param: dict, guest_meta: dict, host_params: list, host_metas: list, output_format: str,
include_guest_coef=False):
# check for multi-host
if len(host_params) > 1 or len(host_metas) > 1:
raise ValueError(f"Cannot merge Hetero LR models from multiple hosts. Please check input")
host_param, host_meta = host_params[0], host_metas[0]
pb_meta = json_format.Parse(json.dumps(guest_meta), LRModelMeta())
if pb_meta.reveal_strategy == "encrypted_reveal_in_host":
raise ValueError(f"Cannot merge encrypted LR models. Please check input.")
# set up model
sk_lr_model = LogisticRegression(penalty=pb_meta.penalty.lower(),
tol=pb_meta.tol,
fit_intercept=pb_meta.fit_intercept,
max_iter=pb_meta.max_iter,
multi_class="ovr",
solver="saga")
include_role = False
if output_format in ['pmml']:
include_role = True
if pb_meta.need_one_vs_rest:
guest_pb_param_c = json_format.Parse(json.dumps(guest_param), LRModelParam())
host_pb_param_c = json_format.Parse(json.dumps(host_param), LRModelParam())
sk_lr_model.classes_ = np.array([int(c) for c in guest_pb_param_c.one_vs_rest_result.one_vs_rest_classes])
guest_pb_models = guest_pb_param_c.one_vs_rest_result.completed_models
host_pb_models = host_pb_param_c.one_vs_rest_result.completed_models
coef_list, intercept_list, iters_list, header = [], [], [], []
for guest_single_pb_param, host_single_pb_param in zip(guest_pb_models, host_pb_models):
coef = _merge_single_model_coef(guest_single_pb_param, host_single_pb_param, include_guest_coef)
coef_list.append(coef)
intercept_list.append(guest_single_pb_param.intercept)
iters_list.append(guest_single_pb_param.iters)
header = _get_model_header(guest_single_pb_param, host_single_pb_param, include_guest_coef, include_role)
sk_lr_model.coef_ = np.concatenate(coef_list, axis=0)
sk_lr_model.intercept_ = np.array(intercept_list)
sk_lr_model.n_iter_ = np.array(iters_list)
else:
guest_pb_param = json_format.Parse(json.dumps(guest_param), LRModelParam())
host_pb_param = json_format.Parse(json.dumps(host_param), LRModelParam())
sk_lr_model.classes_ = np.array([0, 1])
sk_lr_model.n_iter_ = np.array([guest_pb_param.iters])
header = _get_model_header(guest_pb_param, host_pb_param, include_guest_coef, include_role)
coef = _merge_single_model_coef(guest_pb_param, host_pb_param, include_guest_coef)
sk_lr_model.coef_ = coef
sk_lr_model.intercept_ = np.array([guest_pb_param.intercept])
sk_lr_model.feature_names_in_ = np.array(header, dtype=str)
sk_lr_model.n_features_in_ = len(header)
if output_format in ['sklearn', 'scikit-learn']:
return sk_lr_model
elif output_format in ['pmml']:
pipeline = PMMLPipeline([("classifier", sk_lr_model)])
pipeline.active_fields = header
return pipeline
else:
raise ValueError('unknown output type {}'.format(output_format))
| 4,686 | 46.826531 | 117 |
py
|
FATE
|
FATE-master/python/federatedml/framework/weights.py
|
#
# 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.
#
import abc
import numpy as np
import operator
from federatedml.secureprotol.encrypt import Encrypt
from federatedml.util import LOGGER
class TransferableWeights:
def __init__(self, weights, cls, *args, **kwargs):
self._weights = weights
self._cls = cls
if args:
self._args = args
if kwargs:
self._kwargs = kwargs
def with_degree(self, degree):
setattr(self, "_degree", degree)
return self
def get_degree(self, default=None):
return getattr(self, "_degree", default)
@property
def unboxed(self):
return self._weights
@property
def weights(self):
if not hasattr(self, "_args") and not hasattr(self, "_kwargs"):
return self._cls(self._weights)
else:
args = self._args if hasattr(self, "_args") else ()
kwargs = self._kwargs if hasattr(self, "_kwargs") else {}
return self._cls(self._weights, *args, **kwargs)
class Weights:
def __init__(self, l):
self._weights = l
def for_remote(self):
return TransferableWeights(self._weights, self.__class__)
@property
def unboxed(self):
return self._weights
@abc.abstractmethod
def map_values(self, func, inplace):
pass
@abc.abstractmethod
def binary_op(self, other, func, inplace):
pass
@abc.abstractmethod
def axpy(self, a, y):
pass
def decrypted(self, cipher: Encrypt, inplace=True):
return self.map_values(cipher.decrypt, inplace=inplace)
def encrypted(self, cipher: Encrypt, inplace=True):
return self.map_values(cipher.encrypt, inplace=inplace)
def __imul__(self, other):
return self.map_values(lambda x: x * other, inplace=True)
def __mul__(self, other):
return self.map_values(lambda x: x * other, inplace=False)
def __rmul__(self, other):
return self * other
def __iadd__(self, other):
return self.binary_op(other, operator.add, inplace=True)
def __add__(self, other):
return self.binary_op(other, operator.add, inplace=False)
def __radd__(self, other):
return self + other
def __isub__(self, other):
return self.binary_op(other, operator.sub, inplace=True)
def __sub__(self, other):
return self.binary_op(other, operator.sub, inplace=False)
def __truediv__(self, other):
return self.map_values(lambda x: x / other, inplace=False)
def __itruediv__(self, other):
return self.map_values(lambda x: x / other, inplace=True)
class NumericWeights(Weights):
def __init__(self, v):
super().__init__(v)
def map_values(self, func, inplace):
v = func(self._weights)
if inplace:
self._weights = v
return self
else:
return NumericWeights(v)
def binary_op(self, other: 'NumpyWeights', func, inplace):
v = func(self._weights, other._weights)
if inplace:
self._weights = v
return self
else:
return NumericWeights(v)
def axpy(self, a, y: 'NumpyWeights'):
self._weights = self._weights + a * y._weights
return self
class ListWeights(Weights):
def __init__(self, l):
super().__init__(l)
def map_values(self, func, inplace):
if inplace:
for k, v in enumerate(self._weights):
self._weights[k] = func(v)
return self
else:
_w = []
for v in self._weights:
_w.append(func(v))
return ListWeights(_w)
def binary_op(self, other: 'ListWeights', func, inplace):
if inplace:
for k, v in enumerate(self._weights):
self._weights[k] = func(self._weights[k], other._weights[k])
return self
else:
_w = []
for k, v in enumerate(self._weights):
_w.append(func(self._weights[k], other._weights[k]))
return ListWeights(_w)
def axpy(self, a, y: 'ListWeights'):
for k, v in enumerate(self._weights):
self._weights[k] += a * y._weights[k]
return self
class DictWeights(Weights):
def __init__(self, d):
super().__init__(d)
def map_values(self, func, inplace):
if inplace:
for k, v in self._weights.items():
self._weights[k] = func(v)
return self
else:
_w = dict()
for k, v in self._weights.items():
_w[k] = func(v)
return DictWeights(_w)
def binary_op(self, other: 'DictWeights', func, inplace):
if inplace:
for k, v in self._weights.items():
self._weights[k] = func(other._weights[k], v)
return self
else:
_w = dict()
for k, v in self._weights.items():
_w[k] = func(other._weights[k], v)
return DictWeights(_w)
def axpy(self, a, y: 'DictWeights'):
for k, v in self._weights.items():
self._weights[k] += a * y._weights[k]
return self
class OrderDictWeights(Weights):
"""
This class provide a dict container same as `DictWeights` but with fixed key order.
This feature is useful in secure aggregation random padding generation, which is order sensitive.
"""
def __init__(self, d):
super().__init__(d)
self.walking_order = sorted(d.keys(), key=str)
def map_values(self, func, inplace):
if inplace:
for k in self.walking_order:
self._weights[k] = func(self._weights[k])
return self
else:
_w = dict()
for k in self.walking_order:
_w[k] = func(self._weights[k])
return OrderDictWeights(_w)
def binary_op(self, other: 'OrderDictWeights', func, inplace):
if inplace:
for k in self.walking_order:
self._weights[k] = func(other._weights[k], self._weights[k])
return self
else:
_w = dict()
for k in self.walking_order:
_w[k] = func(other._weights[k], self._weights[k])
return OrderDictWeights(_w)
def axpy(self, a, y: 'OrderDictWeights'):
for k in self.walking_order:
self._weights[k] += a * y._weights[k]
return self
class NumpyWeights(Weights):
def __init__(self, arr):
super().__init__(arr)
def map_values(self, func, inplace):
if inplace:
size = self._weights.size
view = self._weights.view().reshape(size)
for i in range(size):
view[i] = func(view[i])
return self
else:
vec_func = np.vectorize(func)
weights = vec_func(self._weights)
return NumpyWeights(weights)
def binary_op(self, other: 'NumpyWeights', func, inplace):
if inplace:
size = self._weights.size
view = self._weights.view().reshape(size)
view_other = other._weights.view().reshape(size)
for i in range(size):
view[i] = func(view[i], view_other[i])
return self
else:
vec_func = np.vectorize(func)
weights = vec_func(self._weights, other._weights)
return NumpyWeights(weights)
def axpy(self, a, y: 'NumpyWeights'):
size = self._weights.size
view = self._weights.view().reshape(size)
view_other = y._weights.view().reshpae(size)
for i in range(size):
view[i] += a * view_other[i]
return self
def __repr__(self):
return self._weights.__repr__()
| 8,403 | 28.696113 | 101 |
py
|
FATE
|
FATE-master/python/federatedml/framework/__init__.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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.
| 661 | 35.777778 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/scheduler/interface.py
|
#
# 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 federatedml.util.param_extract import ParamExtract
from federatedml.components.components import Components
def get_support_role(module, roles=None, cache=None):
return Components.get(module, cache).get_supported_roles()
def get_module(module, role, cache=None):
return Components.get(module, cache).get_run_obj(role)
def get_module_name(module, role, cache=None):
return Components.get(module, cache).get_run_obj_name(role)
def get_module_param(module, alias, cache=None):
return Components.get(module, cache).get_param_obj(alias)
# this interface only support for dsl v1
def get_not_builtin_types_for_dsl_v1(param):
return ParamExtract().get_not_builtin_types(param)
| 1,321 | 32.05 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/__init__.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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.
| 661 | 35.777778 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/blocks.py
|
from fate_arch.session import get_parties
from federatedml.transfer_variable.base_transfer_variable import Variable, BaseTransferVariables
from federatedml.util import consts
from federatedml.secureprotol.diffie_hellman import DiffieHellman
from federatedml.secureprotol import PaillierEncrypt
from federatedml.secureprotol.fate_paillier import PaillierPublicKey
from federatedml.secureprotol.encrypt import PadsCipher
from federatedml.util import LOGGER
from typing import Union
import hashlib
"""
Base Transfer variable
"""
class HomoTransferBase(BaseTransferVariables):
def __init__(self, server=(consts.ARBITER,), clients=(consts.GUEST, consts.HOST), prefix=None):
super().__init__()
if prefix is None:
self.prefix = f"{self.__class__.__module__}.{self.__class__.__name__}."
else:
self.prefix = f"{self.__class__.__module__}.{self.__class__.__name__}.{prefix}_"
self.server = server
self.clients = clients
def create_client_to_server_variable(self, name):
name = f"{self.prefix}{name}"
return Variable.get_or_create(name, lambda: Variable(name, self.clients, self.server))
def create_server_to_client_variable(self, name):
name = f"{self.prefix}{name}"
return Variable.get_or_create(name, lambda: Variable(name, self.server, self.clients))
@staticmethod
def get_parties(roles):
return get_parties().roles_to_parties(roles=roles)
@property
def client_parties(self):
return self.get_parties(roles=self.clients)
@property
def server_parties(self):
return self.get_parties(roles=self.server)
"""
Client & Server Communication
"""
class CommunicatorTransVar(HomoTransferBase):
def __init__(self, server=(consts.ARBITER,), clients=(consts.GUEST, consts.HOST), prefix=None):
super().__init__(server=server, clients=clients, prefix=prefix)
self.client_to_server = self.create_client_to_server_variable(name="client_to_server")
self.server_to_client = self.create_server_to_client_variable(name="server_to_client")
class ServerCommunicator(object):
def __init__(self, prefix=None):
self.trans_var = CommunicatorTransVar(prefix=prefix)
self._client_parties = self.trans_var.client_parties
def get_parties(self, party_idx):
if party_idx == -1:
return self._client_parties
if isinstance(party_idx, list):
return [self._client_parties[i] for i in set(party_idx)]
if isinstance(party_idx, int):
return self._client_parties[party_idx]
else:
raise ValueError('illegal party idx {}'.format(party_idx))
def get_obj(self, suffix=tuple(), party_idx=-1):
party = self.get_parties(party_idx)
return self.trans_var.client_to_server.get_parties(parties=party, suffix=suffix)
def broadcast_obj(self, obj, suffix=tuple(), party_idx=-1):
party = self.get_parties(party_idx)
self.trans_var.server_to_client.remote_parties(obj=obj, parties=party, suffix=suffix)
class ClientCommunicator(object):
def __init__(self, prefix=None):
trans_var = CommunicatorTransVar(prefix=prefix)
self.trans_var = trans_var
self._server_parties = trans_var.server_parties
def send_obj(self, obj, suffix=tuple()):
self.trans_var.client_to_server.remote_parties(obj=obj, parties=self._server_parties, suffix=suffix)
def get_obj(self, suffix=tuple()):
return self.trans_var.server_to_client.get_parties(parties=self._server_parties, suffix=suffix)
"""
Diffie Hellman Exchange
"""
class DHTransVar(HomoTransferBase):
def __init__(self, server=(consts.ARBITER,), clients=(consts.GUEST, consts.HOST), prefix=None):
super().__init__(server=server, clients=clients, prefix=prefix)
self.p_power_r = self.create_client_to_server_variable(name="p_power_r")
self.p_power_r_bc = self.create_server_to_client_variable(name="p_power_r_bc")
self.pubkey = self.create_server_to_client_variable(name="pubkey")
class DHServer(object):
def __init__(self, trans_var: DHTransVar = None):
if trans_var is None:
trans_var = DHTransVar()
self._p_power_r = trans_var.p_power_r
self._p_power_r_bc = trans_var.p_power_r_bc
self._pubkey = trans_var.pubkey
self._client_parties = trans_var.client_parties
def key_exchange(self):
p, g = DiffieHellman.key_pair()
self._pubkey.remote_parties(obj=(int(p), int(g)), parties=self._client_parties)
pubkey = dict(self._p_power_r.get_parties(parties=self._client_parties))
self._p_power_r_bc.remote_parties(obj=pubkey, parties=self._client_parties)
class DHClient(object):
def __init__(self, trans_var: DHTransVar = None):
if trans_var is None:
trans_var = DHTransVar()
self._p_power_r = trans_var.p_power_r
self._p_power_r_bc = trans_var.p_power_r_bc
self._pubkey = trans_var.pubkey
self._server_parties = trans_var.server_parties
def key_exchange(self, uuid: str):
p, g = self._pubkey.get_parties(parties=self._server_parties)[0]
r = DiffieHellman.generate_secret(p)
gr = DiffieHellman.encrypt(g, r, p)
self._p_power_r.remote_parties(obj=(uuid, gr), parties=self._server_parties)
cipher_texts = self._p_power_r_bc.get_parties(parties=self._server_parties)[0]
share_secret = {uid: DiffieHellman.decrypt(gr, r, p) for uid, gr in cipher_texts.items() if uid != uuid}
return share_secret
"""
UUID
"""
class UUIDTransVar(HomoTransferBase):
def __init__(self, server=(consts.ARBITER,), clients=(consts.GUEST, consts.HOST), prefix=None):
super().__init__(server=server, clients=clients, prefix=prefix)
self.uuid = self.create_server_to_client_variable(name="uuid")
class UUIDServer(object):
def __init__(self, trans_var: UUIDTransVar = None):
if trans_var is None:
trans_var = UUIDTransVar()
self._uuid_transfer = trans_var.uuid
self._uuid_set = set()
self._ind = -1
self.client_parties = trans_var.client_parties
# noinspection PyUnusedLocal
@staticmethod
def generate_id(ind, *args, **kwargs):
return hashlib.md5(f"{ind}".encode("ascii")).hexdigest()
def _next_uuid(self):
while True:
self._ind += 1
uid = self.generate_id(self._ind)
if uid in self._uuid_set:
continue
self._uuid_set.add(uid)
return uid
def validate_uuid(self):
for party in self.client_parties:
uid = self._next_uuid()
self._uuid_transfer.remote_parties(obj=uid, parties=[party])
class UUIDClient(object):
def __init__(self, trans_var: UUIDTransVar = None):
if trans_var is None:
trans_var = UUIDTransVar()
self._uuid_variable = trans_var.uuid
self._server_parties = trans_var.server_parties
def generate_uuid(self):
uid = self._uuid_variable.get_parties(parties=self._server_parties)[0]
return uid
"""
Random Padding
"""
class RandomPaddingCipherTransVar(HomoTransferBase):
def __init__(self, server=(consts.ARBITER,), clients=(consts.GUEST, consts.HOST), prefix=None):
super().__init__(server=server, clients=clients, prefix=prefix)
self.uuid_transfer_variable = UUIDTransVar(server=server, clients=clients, prefix=self.prefix)
self.dh_transfer_variable = DHTransVar(server=server, clients=clients, prefix=self.prefix)
class RandomPaddingCipherServer(object):
def __init__(self, trans_var: RandomPaddingCipherTransVar = None):
if trans_var is None:
trans_var = RandomPaddingCipherTransVar()
self._uuid = UUIDServer(trans_var=trans_var.uuid_transfer_variable)
self._dh = DHServer(trans_var=trans_var.dh_transfer_variable)
def exchange_secret_keys(self):
LOGGER.info("synchronizing uuid")
self._uuid.validate_uuid()
LOGGER.info("Diffie-Hellman keys exchanging")
self._dh.key_exchange()
class RandomPaddingCipherClient(object):
def __init__(self, trans_var: RandomPaddingCipherTransVar = None):
if trans_var is None:
trans_var = RandomPaddingCipherTransVar()
self._uuid = UUIDClient(trans_var=trans_var.uuid_transfer_variable)
self._dh = DHClient(trans_var=trans_var.dh_transfer_variable)
self._cipher = None
def create_cipher(self) -> PadsCipher:
LOGGER.info("synchronizing uuid")
uuid = self._uuid.generate_uuid()
LOGGER.info(f"got local uuid")
LOGGER.info("Diffie-Hellman keys exchanging")
exchanged_keys = self._dh.key_exchange(uuid)
LOGGER.info(f"got Diffie-Hellman exchanged keys")
cipher = PadsCipher()
cipher.set_self_uuid(uuid)
cipher.set_exchanged_keys(exchanged_keys)
self._cipher = cipher
return cipher
def encrypt(self, transfer_weights):
return self._cipher.encrypt(transfer_weights)
| 9,154 | 34.484496 | 112 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/util/scatter.py
|
#
# 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.
#
class Scatter(object):
def __init__(self, host_variable, guest_variable):
"""
scatter values from guest and hosts
Args:
host_variable: a variable represents `Host -> Arbiter`
guest_variable: a variable represent `Guest -> Arbiter`
Examples:
>>> from federatedml.framework.homo.util import scatter
>>> s = scatter.Scatter(host_variable, guest_variable)
>>> for v in s.get():
print(v)
"""
self._host_variable = host_variable
self._guest_variable = guest_variable
def get(self, suffix=tuple(), host_ids=None):
"""
create a generator of values from guest and hosts.
Args:
suffix: tag suffix
host_ids: ids of hosts to get value from.
If None provided, get values from all hosts.
If a list of int provided, get values from all hosts listed.
Returns:
a generator of scatted values
Raises:
if host_ids is neither None nor a list of int, ValueError raised
"""
yield self._guest_variable.get(idx=0, suffix=suffix)
if host_ids is None:
host_ids = -1
for ret in self._host_variable.get(idx=host_ids, suffix=suffix):
yield ret
| 1,962 | 31.180328 | 76 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/util/__init__.py
| 0 | 0 | 0 |
py
|
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/__init__.py
|
#
# 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.
#
| 616 | 37.5625 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_random_padding_cipher.py
|
#
# 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 federatedml.framework.homo.blocks import random_padding_cipher
from federatedml.framework.homo.test.blocks.test_utils import TestBlocks
from federatedml.util import consts
# noinspection PyUnusedLocal
def sync_random_padding(job_id, role, ind, *args):
if role == consts.ARBITER:
rp_cipher = random_padding_cipher.Server()
rp_cipher.exchange_secret_keys()
return
elif role == consts.HOST:
rp_cipher = random_padding_cipher.Client()
rp_cipher.create_cipher()
return rp_cipher
else:
rp_cipher = random_padding_cipher.Client()
rp_cipher.create_cipher()
return rp_cipher
class RandomPaddingCipherTest(TestBlocks):
def run_with_num_hosts(self, num_hosts):
_, guest, hosts = self.run_test(sync_random_padding, self.job_id, num_hosts=num_hosts)
import numpy as np
raw = np.zeros((10, 10))
encrypted = np.zeros((10, 10))
guest_matrix = np.random.rand(10, 10)
raw += guest_matrix
encrypted += guest.encrypt(guest_matrix)
for host in hosts:
host_matrix = np.random.rand(10, 10)
raw += host_matrix
encrypted += host.encrypt(host_matrix)
self.assertTrue(np.allclose(raw, encrypted))
def test_host_1(self):
self.run_with_num_hosts(1)
def test_host_10(self):
self.run_with_num_hosts(10)
| 2,025 | 31.15873 | 94 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_loss_scatter.py
|
#
# 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.
#
import random
from federatedml.framework.homo.blocks import loss_scatter
from federatedml.framework.homo.test.blocks.test_utils import TestBlocks
from federatedml.util import consts
def loss_scatter_call(job_id, role, ind, *args):
losses = args[0]
if role == consts.ARBITER:
losses = loss_scatter.Server().get_losses()
return list(losses)
elif role == consts.HOST:
loss = losses[ind + 1]
return loss_scatter.Client().send_loss(loss)
else:
loss = losses[0]
return loss_scatter.Client().send_loss(loss)
class LossScatterTest(TestBlocks):
def run_with_num_hosts(self, num_hosts):
losses = [random.random() for _ in range(num_hosts + 1)]
arbiter, _, _ = self.run_test(loss_scatter_call, self.job_id, num_hosts, losses)
for loss, arbiter_got_loss in zip(losses, arbiter):
self.assertEqual(loss, arbiter_got_loss)
def test_host_1(self):
self.run_with_num_hosts(1)
def test_host_10(self):
self.run_with_num_hosts(10)
| 1,664 | 31.647059 | 88 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_aggregator.py
|
#
# 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.
#
import numpy as np
from federatedml.framework.homo.blocks import aggregator
from federatedml.framework.homo.test.blocks.test_utils import TestBlocks
from federatedml.util import consts
def aggregator_call(job_id, role, ind, *args):
server_model = args[0][0]
client_models = args[0][1:]
if role == consts.ARBITER:
agg = aggregator.Server()
models = agg.get_models()
agg.send_aggregated_model(server_model)
return models
else:
agg = aggregator.Client()
if role == consts.GUEST:
agg.send_model(client_models[0])
else:
agg.send_model(client_models[ind + 1])
return agg.get_aggregated_model()
class AggregatorTest(TestBlocks):
def run_with_num_hosts(self, num_hosts):
models = [np.random.rand(3, 4) for _ in range(num_hosts + 2)]
server, *clients = self.run_test(aggregator_call, self.job_id, num_hosts, models)
for model in clients:
self.assertAlmostEqual(np.linalg.norm(model - models[0]), 0.0)
for client_model, arbiter_get_model in zip(models[1:], server):
self.assertAlmostEqual(np.linalg.norm(client_model - arbiter_get_model), 0.0)
def test_host_1(self):
self.run_with_num_hosts(1)
def test_host_10(self):
self.run_with_num_hosts(10)
| 1,949 | 33.821429 | 89 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_diffie_hellman.py
|
#
# 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 federatedml.framework.homo.blocks import uuid_generator, diffie_hellman
from federatedml.framework.homo.test.blocks.test_utils import TestBlocks
from federatedml.util import consts
# noinspection PyUnusedLocal
def dh_call(job_id, role, ind, *args):
if role == consts.ARBITER:
uuid_generator.Server().validate_uuid()
return diffie_hellman.Server().key_exchange()
else:
uid = uuid_generator.Client().generate_uuid()
return uid, diffie_hellman.Client().key_exchange(uid)
class DHKeyExchangeTest(TestBlocks):
def dh_key_exchange(self, num_hosts):
_, guest, hosts = self.run_test(dh_call, self.job_id, num_hosts=num_hosts)
results = [guest]
results.extend(hosts)
self.assertEqual(len(results), num_hosts + 1)
for i in range(len(results)):
for j in range(i + 1, len(results)):
self.assertEqual(results[i][1][results[j][0]], results[j][1][results[i][0]])
def test_host_1(self):
self.dh_key_exchange(1)
def test_host_10(self):
self.maxDiff = None
self.dh_key_exchange(10)
| 1,738 | 33.78 | 92 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_make_uuid.py
|
#
# 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 federatedml.framework.homo.blocks import uuid_generator
from federatedml.util import consts
from federatedml.framework.homo.test.blocks.test_utils import TestBlocks
# noinspection PyProtectedMember,PyUnusedLocal
def uuid_call(job_id, role, ind, *args):
if role == consts.ARBITER:
uuid_server = uuid_generator.Server()
uuid_server.validate_uuid()
return uuid_server._uuid_set
else:
uuid_client = uuid_generator.Client()
uid = uuid_client.generate_uuid()
return uid
class IdentifyUUIDTest(TestBlocks):
def run_uuid_test(self, num_hosts):
uuid_set, guest_uuid, hosts_uuid = self.run_test(uuid_call, self.job_id, num_hosts=num_hosts)
self.assertEqual(len(hosts_uuid), num_hosts)
self.assertIn(guest_uuid, uuid_set)
for host_uuid in hosts_uuid:
self.assertIn(host_uuid, uuid_set)
def test_host_1(self):
self.run_uuid_test(1)
def test_host_10(self):
self.run_uuid_test(10)
| 1,623 | 33.553191 | 101 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_secure_mean_aggregator.py
|
#
# 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.
#
import copy
import numpy as np
import random
from federatedml.framework.homo.blocks import secure_mean_aggregator
from federatedml.framework.homo.test.blocks.test_utils import TestBlocks
from federatedml.framework.weights import OrderDictWeights
from federatedml.util import consts
# noinspection PyUnusedLocal
def secure_aggregator_call(job_id, role, ind, *args):
if role == consts.ARBITER:
agg = secure_mean_aggregator.Server()
model = agg.weighted_mean_model()
agg.send_aggregated_model(model)
else:
agg = secure_mean_aggregator.Client()
# disorder dit
order = list(range(5))
np.random.seed(random.SystemRandom().randint(1, 100))
np.random.shuffle(order)
raw = {k: np.random.rand(10, 10) for k in order}
w = OrderDictWeights(copy.deepcopy(raw))
d = random.random()
agg.send_weighted_model(w, weight=d)
aggregated = agg.get_aggregated_model()
return aggregated, raw, d
class AggregatorTest(TestBlocks):
def run_with_num_hosts(self, num_hosts):
_, guest, hosts = self.run_test(secure_aggregator_call, self.job_id, num_hosts)
expert = OrderDictWeights(guest[1]) * guest[2]
total_weights = guest[2]
aggregated = [guest[0]]
for host in hosts:
expert += OrderDictWeights(host[1]) * host[2]
total_weights += host[2]
aggregated.append(host[0])
expert /= total_weights
expert = expert.unboxed
aggregated = [w.unboxed for w in aggregated]
for k in expert:
for w in aggregated:
self.assertAlmostEqual(np.linalg.norm(expert[k] - w[k]), 0.0)
def test_host_1(self):
self.run_with_num_hosts(1)
def test_host_10(self):
self.run_with_num_hosts(10)
| 2,445 | 32.972222 | 87 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_model_scatter.py
|
#
# 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.
#
import random
from federatedml.framework.homo.blocks import model_scatter
from federatedml.framework.homo.test.blocks.test_utils import TestBlocks
from federatedml.util import consts
def model_scatter_call(job_id, role, ind, *args):
models = args[0]
if role == consts.ARBITER:
models = model_scatter.Server().get_models()
return list(models)
elif role == consts.HOST:
model = models[ind + 1]
return model_scatter.Client().send_model(model)
else:
model = models[0]
return model_scatter.Client().send_model(model)
class ModelScatterTest(TestBlocks):
def run_with_num_hosts(self, num_hosts):
models = [[random.random() for _ in range(random.randint(1, 10))] for _ in range(num_hosts + 1)]
arbiter, _, _ = self.run_test(model_scatter_call, self.job_id, num_hosts, models)
for model, arbiter_model in zip(models, arbiter):
self.assertListEqual(model, arbiter_model)
def test_host_1(self):
self.run_with_num_hosts(1)
def test_host_10(self):
self.run_with_num_hosts(10)
| 1,717 | 32.686275 | 104 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/__init__.py
|
#
# 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.
#
| 616 | 37.5625 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_has_converged.py
|
#
# 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.
#
import random
from federatedml.framework.homo.blocks import has_converged
from federatedml.framework.homo.test.blocks.test_utils import TestBlocks
from federatedml.util import consts
# noinspection PyUnusedLocal
def model_broadcaster_call(job_id, role, ind, *args):
status = args[0]
if role == consts.ARBITER:
return has_converged.Server().remote_converge_status(status)
else:
return has_converged.Client().get_converge_status()
class ModelBroadcasterTest(TestBlocks):
def run_with_num_hosts(self, num_hosts):
status = random.random() > 0.5
arbiter, guest, hosts = self.run_test(model_broadcaster_call, self.job_id, num_hosts, status)
self.assertEqual(guest, status)
for i in range(num_hosts):
self.assertEqual(hosts[i], status)
def test_host_1(self):
self.run_with_num_hosts(1)
def test_host_10(self):
self.run_with_num_hosts(10)
| 1,556 | 32.12766 | 101 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_model_broadcaster.py
|
#
# 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 federatedml.framework.homo.blocks import model_broadcaster
from federatedml.framework.homo.test.blocks.test_utils import TestBlocks
from federatedml.util import consts
# noinspection PyUnusedLocal
def model_broadcaster_call(job_id, role, ind, *args):
model_to_broadcast = args[0]
if role == consts.ARBITER:
return model_broadcaster.Server().send_model(model_to_broadcast)
elif role == consts.HOST:
return model_broadcaster.Client().get_model()
else:
return model_broadcaster.Client().get_model()
class ModelBroadcasterTest(TestBlocks):
def run_with_num_hosts(self, num_hosts):
import random
model = [random.random() for _ in range(10)]
arbiter, guest, hosts = self.run_test(model_broadcaster_call, self.job_id, num_hosts, model)
self.assertListEqual(guest, model)
for i in range(num_hosts):
self.assertListEqual(hosts[i], model)
def test_host_1(self):
self.run_with_num_hosts(1)
def test_host_10(self):
self.run_with_num_hosts(10)
| 1,681 | 33.326531 | 100 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/test/blocks/test_utils.py
|
#
# 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.
#
import time
import unittest
import uuid
from multiprocessing import Pool
from fate_arch.computing import ComputingType
from fate_arch.session import Session
from federatedml.util import consts
class TestBlocks(unittest.TestCase):
def clean_tables(self):
from fate_arch.session import computing_session as session
session.init(job_id=self.job_id)
try:
session.cleanup("*", self.job_id, True)
except EnvironmentError:
pass
try:
session.cleanup("*", self.job_id, False)
except EnvironmentError:
pass
def setUp(self) -> None:
self.job_id = str(uuid.uuid1())
def tearDown(self) -> None:
self.clean_tables()
@staticmethod
def apply_func(func, job_id, role, num_hosts, ind, *args):
partyid_map = dict(host=[9999 + i for i in range(num_hosts)], guest=[9999], arbiter=[9999])
partyid = 9999
if role == consts.HOST:
partyid = 9999 + ind
with Session() as session:
session.init_computing(job_id, computing_type=ComputingType.STANDALONE)
session.init_federation(federation_session_id=job_id,
runtime_conf={"local": {"role": role, "party_id": partyid}, "role": partyid_map})
return func(job_id, role, ind, *args)
@staticmethod
def run_test(func, job_id, num_hosts, *args):
pool = Pool(num_hosts + 2)
tasks = []
for role, ind in [(consts.ARBITER, 0), (consts.GUEST, 0)] + [(consts.HOST, i) for i in range(num_hosts)]:
tasks.append(
pool.apply_async(func=TestBlocks.apply_func,
args=(func, job_id, role, num_hosts, ind, *args))
)
pool.close()
left = [i for i in range(len(tasks))]
while left:
time.sleep(0.01)
tmp = []
for i in left:
if tasks[i].ready():
tasks[i] = tasks[i].get()
else:
tmp.append(i)
left = tmp
return tasks[0], tasks[1], tasks[2:]
| 2,764 | 33.5625 | 117 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/aggregator/__init__.py
|
from federatedml.framework.homo.aggregator.secure_aggregator import SecureAggregatorClient, SecureAggregatorServer
__all__ = ['SecureAggregatorClient', 'SecureAggregatorServer']
| 179 | 44 | 114 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/aggregator/aggregator_base.py
|
from federatedml.framework.homo.blocks import ServerCommunicator, ClientCommunicator
class AutoSuffix(object):
"""
A auto suffix that will auto increase count
"""
def __init__(self, suffix_str=""):
self._count = 0
self.suffix_str = suffix_str
def __call__(self):
concat_suffix = self.suffix_str + "_" + str(self._count)
self._count += 1
return concat_suffix
class AggregatorBaseClient(object):
def __init__(self, communicate_match_suffix: str = None):
"""Base class of client aggregator
Parameters
----------
communicate_match_suffix : str, you can give a unique name to aggregator, to avoid reusing of same transfer variable tag,
To make sure that client and server can communicate correctly,
the server-side and client-side aggregators need to have the same suffix
"""
self.communicator = ClientCommunicator(prefix=communicate_match_suffix)
self.suffix = {}
def _get_suffix(self, var_name, user_suffix=tuple()):
assert var_name in self.suffix, 'var name {} not found in suffix list'.format(
var_name)
if user_suffix is not None and not isinstance(user_suffix, tuple):
raise ValueError('suffix must be None, tuples contains str or number. got {} whose type is {}'.format(
user_suffix, type(user_suffix)))
if user_suffix is None or len(user_suffix) == 0:
return self.suffix[var_name]()
else:
return (var_name, ) + user_suffix
def send(self, obj, suffix):
self.communicator.send_obj(obj, suffix=suffix)
def get(self, suffix):
return self.communicator.get_obj(suffix=suffix)
class AggregatorBaseServer(object):
def __init__(self, communicate_match_suffix=None):
"""Base class of server aggregator
Parameters
----------
communicate_match_suffix : str, you can give a unique name to aggregator, to avoid reusing of same transfer variable tag,
To make sure that client and server can communicate correctly,
the server-side and client-side aggregators need to have the same suffix
"""
self.communicator = ServerCommunicator(prefix=communicate_match_suffix)
self.suffix = {}
def _get_suffix(self, var_name, user_suffix=tuple()):
assert var_name in self.suffix, 'var name {} not found in suffix list'.format(
var_name)
if user_suffix is not None and not isinstance(user_suffix, tuple):
raise ValueError('suffix must be None, tuples contains str or number. got {} whose type is {}'.format(
user_suffix, type(user_suffix)))
if user_suffix is None or len(user_suffix) == 0:
return self.suffix[var_name]()
else:
return (var_name, ) + user_suffix
def broadcast(self, obj, suffix, party_idx=-1):
self.communicator.broadcast_obj(obj, suffix=suffix, party_idx=party_idx)
def collect(self, suffix, party_idx=-1):
objs = self.communicator.get_obj(suffix=suffix, party_idx=party_idx)
return objs
| 3,238 | 37.105882 | 129 |
py
|
FATE
|
FATE-master/python/federatedml/framework/homo/aggregator/secure_aggregator.py
|
from federatedml.framework.homo.blocks import RandomPaddingCipherClient, RandomPaddingCipherServer, PadsCipher, RandomPaddingCipherTransVar
from federatedml.framework.homo.aggregator.aggregator_base import AggregatorBaseClient, AutoSuffix, AggregatorBaseServer
import numpy as np
from federatedml.framework.weights import Weights, NumpyWeights
from federatedml.util import LOGGER
import torch as t
from typing import Union, List
from fate_arch.computing._util import is_table
from federatedml.util import consts
AGG_TYPE = ['weighted_mean', 'sum', 'mean']
class SecureAggregatorClient(AggregatorBaseClient):
def __init__(self, secure_aggregate=True, aggregate_type='weighted_mean', aggregate_weight=1.0,
communicate_match_suffix=None):
super(SecureAggregatorClient, self).__init__(
communicate_match_suffix=communicate_match_suffix)
self.secure_aggregate = secure_aggregate
self.suffix = {
"local_loss": AutoSuffix("local_loss"),
"agg_loss": AutoSuffix("agg_loss"),
"local_model": AutoSuffix("local_model"),
"agg_model": AutoSuffix("agg_model"),
"converge_status": AutoSuffix("converge_status")
}
# init secure aggregate random padding:
if self.secure_aggregate:
self._random_padding_cipher: PadsCipher = RandomPaddingCipherClient(
trans_var=RandomPaddingCipherTransVar(prefix=communicate_match_suffix)).create_cipher()
LOGGER.info('initialize secure aggregator done')
# compute weight
assert aggregate_type in AGG_TYPE, 'aggregate type must in {}'.format(
AGG_TYPE)
if aggregate_type == 'weighted_mean':
aggregate_weight = aggregate_weight
elif aggregate_type == 'mean':
aggregate_weight = 1
self.send(aggregate_weight, suffix=('agg_weight', ))
self._weight = aggregate_weight / \
self.get(suffix=('agg_weight', ))[0] # local weight / total weight
if aggregate_type == 'sum': # reset _weight
self._weight = 1
self._set_table_amplify_factor = False
LOGGER.debug('aggregate compute weight is {}'.format(self._weight))
def _process_model(self, model):
to_agg = None
if isinstance(model, np.ndarray) or isinstance(model, Weights):
if isinstance(model, np.ndarray):
to_agg = NumpyWeights(model * self._weight)
else:
to_agg = model * self._weight
if self.secure_aggregate:
to_agg: Weights = to_agg.encrypted(
self._random_padding_cipher)
return to_agg
# is FATE distrubed Table
elif is_table(model):
model = model.mapValues(lambda x: x * self._weight)
if self.secure_aggregate:
if not self._set_table_amplify_factor:
self._random_padding_cipher.set_amplify_factor(
consts.SECURE_AGG_AMPLIFY_FACTOR)
model = self._random_padding_cipher.encrypt_table(model)
return model
if isinstance(model, t.nn.Module):
parameters = list(model.parameters())
tmp_list = [[np.array(p.cpu().detach().tolist()) for p in parameters if p.requires_grad]]
LOGGER.debug('Aggregate trainable parameters: {}/{}'.format(len(tmp_list[0]), len(parameters)))
elif isinstance(model, t.optim.Optimizer):
tmp_list = [[np.array(p.cpu().detach().tolist()) for p in group["params"]]
for group in model.param_groups]
elif isinstance(model, list):
for p in model:
assert isinstance(
p, np.ndarray), 'expecting List[np.ndarray], but got {}'.format(p)
tmp_list = [model]
if self.secure_aggregate:
to_agg = [
[
NumpyWeights(
arr *
self._weight).encrypted(
self._random_padding_cipher) for arr in arr_list] for arr_list in tmp_list]
else:
to_agg = [[arr * self._weight for arr in arr_list]
for arr_list in tmp_list]
return to_agg
def _recover_model(self, model, agg_model):
if isinstance(model, np.ndarray):
return agg_model.unboxed
elif isinstance(model, Weights):
return agg_model
elif is_table(agg_model):
return agg_model
else:
if self.secure_aggregate:
agg_model = [[np_weight.unboxed for np_weight in arr_list]
for arr_list in agg_model]
if isinstance(model, t.nn.Module):
for agg_p, p in zip(agg_model[0], [p for p in model.parameters() if p.requires_grad]):
p.data.copy_(t.Tensor(agg_p))
return model
elif isinstance(model, t.optim.Optimizer):
for agg_group, group in zip(agg_model, model.param_groups):
for agg_p, p in zip(agg_group, group["params"]):
p.data.copy_(t.Tensor(agg_p))
return model
else:
return agg_model
def send_loss(self, loss, suffix=tuple()):
suffix = self._get_suffix('local_loss', suffix)
assert isinstance(loss, float) or isinstance(
loss, np.ndarray), 'illegal loss type {}, loss should be a float or a np array'.format(type(loss))
self.send(loss * self._weight, suffix)
def send_model(self,
model: Union[np.ndarray,
Weights,
List[np.ndarray],
t.nn.Module,
t.optim.Optimizer],
suffix=tuple()):
"""Sending model to arbiter for aggregation
Parameters
----------
model : model can be:
A numpy array
A Weight instance(or subclass of Weights), see federatedml.framework.weights
List of numpy array
A pytorch model, is the subclass of torch.nn.Module
A pytorch optimizer, will extract param group from this optimizer as weights to aggregate
suffix : sending suffix, by default tuple(), can be None or tuple contains str&number. If None, will automatically generate suffix
"""
suffix = self._get_suffix('local_model', suffix)
# judge model type
to_agg_model = self._process_model(model)
self.send(to_agg_model, suffix)
def get_aggregated_model(self, suffix=tuple()):
suffix = self._get_suffix("agg_model", suffix)
return self.get(suffix)[0]
def get_aggregated_loss(self, suffix=tuple()):
suffix = self._get_suffix("agg_loss", suffix)
return self.get(suffix)[0]
def get_converge_status(self, suffix=tuple()):
suffix = self._get_suffix("converge_status", suffix)
return self.get(suffix)[0]
def model_aggregation(self, model, suffix=tuple()):
self.send_model(model, suffix=suffix)
agg_model = self.get_aggregated_model(suffix=suffix)
return self._recover_model(model, agg_model)
def loss_aggregation(self, loss, suffix=tuple()):
self.send_loss(loss, suffix=suffix)
converge_status = self.get_converge_status(suffix=suffix)
return converge_status
class SecureAggregatorServer(AggregatorBaseServer):
def __init__(self, secure_aggregate=True, communicate_match_suffix=None):
super(SecureAggregatorServer, self).__init__(
communicate_match_suffix=communicate_match_suffix)
self.suffix = {
"local_loss": AutoSuffix("local_loss"),
"agg_loss": AutoSuffix("agg_loss"),
"local_model": AutoSuffix("local_model"),
"agg_model": AutoSuffix("agg_model"),
"converge_status": AutoSuffix("converge_status")
}
self.secure_aggregate = secure_aggregate
if self.secure_aggregate:
RandomPaddingCipherServer(trans_var=RandomPaddingCipherTransVar(
prefix=communicate_match_suffix)).exchange_secret_keys()
LOGGER.info('initialize secure aggregator done')
agg_weights = self.collect(suffix=('agg_weight', ))
sum_weights = 0
for i in agg_weights:
sum_weights += i
self.broadcast(sum_weights, suffix=('agg_weight', ))
def aggregate_model(self, suffix=None, party_idx=-1):
# get suffix
suffix = self._get_suffix('local_model', suffix)
# recv params for aggregation
models = self.collect(suffix=suffix, party_idx=party_idx)
agg_result = None
# Aggregate Weights or Numpy Array
if isinstance(models[0], Weights):
agg_result = models[0]
for w in models[1:]:
agg_result += w
# Aggregate Table
elif is_table(models[0]):
agg_result = models[0]
for table in models[1:]:
agg_result = agg_result.join(table, lambda x1, x2: x1 + x2)
return agg_result
# Aggregate numpy groups
elif isinstance(models[0], list):
# aggregation
agg_result = models[0]
# aggregate numpy model weights from all clients
for params_group in models[1:]:
for agg_params, params in zip(
agg_result, params_group):
for agg_p, p in zip(agg_params, params):
# agg_p: NumpyWeights or numpy array
agg_p += p
if agg_result is None:
raise ValueError(
'can not aggregate receive model, format is illegal: {}'.format(models))
return agg_result
def broadcast_model(self, model, suffix=tuple(), party_idx=-1):
suffix = self._get_suffix('agg_model', suffix)
self.broadcast(model, suffix=suffix, party_idx=party_idx)
def aggregate_loss(self, suffix=tuple(), party_idx=-1):
# get loss
suffix = self._get_suffix('local_loss', suffix)
losses = self.collect(suffix, party_idx=party_idx)
# aggregate loss
total_loss = losses[0]
for loss in losses[1:]:
total_loss += loss
return total_loss
def broadcast_loss(self, loss_sum, suffix=tuple(), party_idx=-1):
suffix = self._get_suffix('agg_loss', suffix)
self.broadcast(loss_sum, suffix=suffix, party_idx=party_idx)
def model_aggregation(self, suffix=tuple(), party_idx=-1):
agg_model = self.aggregate_model(suffix=suffix, party_idx=party_idx)
self.broadcast_model(agg_model, suffix=suffix, party_idx=party_idx)
return agg_model
def broadcast_converge_status(self, converge_status, suffix=tuple(), party_idx=-1):
suffix = self._get_suffix('converge_status', suffix)
self.broadcast(converge_status, suffix=suffix, party_idx=party_idx)
def loss_aggregation(self, check_converge=False, converge_func=None, suffix=tuple(), party_idx=-1):
agg_loss = self.aggregate_loss(suffix=suffix, party_idx=party_idx)
if check_converge:
converge_status = converge_func(agg_loss)
else:
converge_status = False
self.broadcast_converge_status(
converge_status, suffix=suffix, party_idx=party_idx)
return agg_loss, converge_status
| 11,628 | 39.378472 | 139 |
py
|
FATE
|
FATE-master/python/federatedml/framework/test/__init__.py
|
#
# 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.
#
| 616 | 37.5625 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/test/homo/__init__.py
|
#
# 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.
#
| 616 | 37.5625 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/test/homo/homo_test_sync_base.py
|
#
# 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.
#
import unittest
import uuid
from multiprocessing import Pool
from fate_arch.computing import ComputingType
from fate_arch.session import Session
from federatedml.util import consts
from federatedml.transfer_variable.transfer_class.homo_transfer_variable import HomoTransferVariable
import time
class TestSyncBase(unittest.TestCase):
def clean_tables(self):
from fate_arch.session import computing_session as session
session.init(job_id=self.job_id)
try:
session.cleanup("*", self.job_id, True)
except EnvironmentError:
pass
try:
session.cleanup("*", self.job_id, False)
except EnvironmentError:
pass
def setUp(self) -> None:
self.transfer_variable = HomoTransferVariable()
self.job_id = str(uuid.uuid1())
self.transfer_variable.set_flowid(self.job_id)
def tearDown(self) -> None:
pass
# self.clean_tables()
@classmethod
def _call(cls, job_id, role, transfer_variable, num_hosts, ind, *args):
role_id = {
"host": [
10000 + i for i in range(num_hosts)
],
"guest": [
9999
],
"arbiter": [
9999
]
}
with Session() as session:
session.init_computing(job_id, computing_type=ComputingType.STANDALONE)
session.init_federation(job_id,
runtime_conf={
"local": {
"role": role,
"party_id": role_id[role][0] if role != "host" else role_id[role][ind]
},
"role": role_id
})
return cls.call(role, transfer_variable, ind, *args)
@classmethod
def call(cls, role, transfer_variable, ind, *args):
pass
@classmethod
def results(cls, job_id, transfer_variable, num_hosts, *args):
tasks = []
with Pool(num_hosts + 2) as p:
tasks.append(p.apply_async(func=cls._call,
args=(job_id, consts.ARBITER, transfer_variable, num_hosts, 0, *args)))
tasks.append(p.apply_async(func=cls._call,
args=(job_id, consts.GUEST, transfer_variable, num_hosts, 0, *args)))
for i in range(num_hosts):
tasks.append(
p.apply_async(func=cls._call,
args=(job_id, consts.HOST, transfer_variable, num_hosts, i, *args)))
left = list(range(len(tasks)))
while len(left) > 0:
time.sleep(0.1)
tmp = []
for i in left:
if tasks[i].ready():
tasks[i] = tasks[i].get()
else:
tmp.append(i)
left = tmp
return tasks
def run_results(self, num_hosts, *args):
return self.results(self.job_id, self.transfer_variable, num_hosts, *args)
| 3,835 | 34.518519 | 114 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/__init__.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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.
| 661 | 35.777778 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/procedure/__init__.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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.
| 661 | 35.777778 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/procedure/batch_generator.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 federatedml.framework.hetero.sync import batch_info_sync
from federatedml.model_selection import MiniBatch
from federatedml.util import LOGGER
class Guest(batch_info_sync.Guest):
def __init__(self):
self.mini_batch_obj = None
self.finish_sycn = False
self.batch_nums = None
self.batch_masked = False
def register_batch_generator(self, transfer_variables, has_arbiter=True):
self._register_batch_data_index_transfer(transfer_variables.batch_info,
transfer_variables.batch_data_index,
getattr(transfer_variables, "batch_validate_info", None),
has_arbiter)
def initialize_batch_generator(self, data_instances, batch_size, suffix=tuple(),
shuffle=False, batch_strategy="full", masked_rate=0):
self.mini_batch_obj = MiniBatch(data_instances, batch_size=batch_size, shuffle=shuffle,
batch_strategy=batch_strategy, masked_rate=masked_rate)
self.batch_nums = self.mini_batch_obj.batch_nums
self.batch_masked = self.mini_batch_obj.batch_size != self.mini_batch_obj.masked_batch_size
batch_info = {"batch_size": self.mini_batch_obj.batch_size, "batch_num": self.batch_nums,
"batch_mutable": self.mini_batch_obj.batch_mutable,
"masked_batch_size": self.mini_batch_obj.masked_batch_size}
self.sync_batch_info(batch_info, suffix)
if not self.mini_batch_obj.batch_mutable:
self.prepare_batch_data(suffix)
def prepare_batch_data(self, suffix=tuple()):
self.mini_batch_obj.generate_batch_data()
index_generator = self.mini_batch_obj.mini_batch_data_generator(result='index')
batch_index = 0
for batch_data_index in index_generator:
batch_suffix = suffix + (batch_index,)
self.sync_batch_index(batch_data_index, batch_suffix)
batch_index += 1
def generate_batch_data(self, with_index=False, suffix=tuple()):
if self.mini_batch_obj.batch_mutable:
self.prepare_batch_data(suffix)
if with_index:
data_generator = self.mini_batch_obj.mini_batch_data_generator(result='both')
for batch_data, index_data in data_generator:
yield batch_data, index_data
else:
data_generator = self.mini_batch_obj.mini_batch_data_generator(result='data')
for batch_data in data_generator:
yield batch_data
def verify_batch_legality(self, suffix=tuple()):
validate_infos = self.sync_batch_validate_info(suffix)
least_batch_size = 0
is_legal = True
for validate_info in validate_infos:
legality = validate_info.get("legality")
if not legality:
is_legal = False
least_batch_size = max(least_batch_size, validate_info.get("least_batch_size"))
if not is_legal:
raise ValueError(f"To use batch masked strategy, "
f"(masked_rate + 1) * batch_size should > {least_batch_size}")
class Host(batch_info_sync.Host):
def __init__(self):
self.finish_sycn = False
self.batch_data_insts = []
self.batch_nums = None
self.data_inst = None
self.batch_mutable = False
self.batch_masked = False
self.masked_batch_size = None
def register_batch_generator(self, transfer_variables, has_arbiter=None):
self._register_batch_data_index_transfer(transfer_variables.batch_info,
transfer_variables.batch_data_index,
getattr(transfer_variables, "batch_validate_info", None))
def initialize_batch_generator(self, data_instances, suffix=tuple(), **kwargs):
batch_info = self.sync_batch_info(suffix)
batch_size = batch_info.get("batch_size")
self.batch_nums = batch_info.get('batch_num')
self.batch_mutable = batch_info.get("batch_mutable")
self.masked_batch_size = batch_info.get("masked_batch_size")
self.batch_masked = self.masked_batch_size != batch_size
if not self.batch_mutable:
self.prepare_batch_data(data_instances, suffix)
else:
self.data_inst = data_instances
def prepare_batch_data(self, data_inst, suffix=tuple()):
self.batch_data_insts = []
for batch_index in range(self.batch_nums):
batch_suffix = suffix + (batch_index,)
batch_data_index = self.sync_batch_index(suffix=batch_suffix)
# batch_data_inst = batch_data_index.join(data_instances, lambda g, d: d)
batch_data_inst = data_inst.join(batch_data_index, lambda d, g: d)
self.batch_data_insts.append(batch_data_inst)
def generate_batch_data(self, suffix=tuple()):
if self.batch_mutable:
self.prepare_batch_data(data_inst=self.data_inst, suffix=suffix)
batch_index = 0
for batch_data_inst in self.batch_data_insts:
LOGGER.info("batch_num: {}, batch_data_inst size:{}".format(
batch_index, batch_data_inst.count()))
yield batch_data_inst
batch_index += 1
def verify_batch_legality(self, least_batch_size, suffix=tuple()):
if self.masked_batch_size <= least_batch_size:
batch_validate_info = {"legality": False,
"least_batch_size": least_batch_size}
LOGGER.warning(f"masked_batch_size {self.masked_batch_size} is illegal, should > {least_batch_size}")
else:
batch_validate_info = {"legality": True}
self.sync_batch_validate_info(batch_validate_info, suffix)
class Arbiter(batch_info_sync.Arbiter):
def __init__(self):
self.batch_num = None
def register_batch_generator(self, transfer_variables):
self._register_batch_data_index_transfer(transfer_variables.batch_info, transfer_variables.batch_data_index)
def initialize_batch_generator(self, suffix=tuple()):
batch_info = self.sync_batch_info(suffix)
self.batch_num = batch_info.get('batch_num')
def generate_batch_data(self):
for i in range(self.batch_num):
yield i
| 7,113 | 43.186335 | 116 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/procedure/two_parties_paillier_cipher.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 federatedml.secureprotol.encrypt import PaillierEncrypt
from federatedml.util import consts
class Guest(object):
def __init__(self):
self._pubkey_transfer = None
def gen_paillier_cipher_operator(self, transfer_variables, suffix=tuple()):
self._pubkey_transfer = transfer_variables.paillier_pubkey
cipher = PaillierEncrypt()
cipher.generate_key()
pub_key = cipher.get_public_key()
self._pubkey_transfer.remote(obj=pub_key, role=consts.HOST, idx=-1, suffix=suffix)
return cipher
class Host(object):
def __init__(self):
self._pubkey_transfer = None
def gen_paillier_cipher_operator(self, transfer_variables, suffix=tuple()):
self._pubkey_transfer = transfer_variables.paillier_pubkey
pubkey = self._pubkey_transfer.get(idx=0, suffix=suffix)
cipher = PaillierEncrypt()
cipher.set_public_key(pubkey)
return cipher
| 1,602 | 33.847826 | 90 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/procedure/convergence.py
|
#
# 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 federatedml.framework.hetero.sync import converge_sync
class Host(converge_sync.Host):
def register_convergence(self, transfer_variables):
self._register_convergence(is_stopped_transfer=transfer_variables.converge_flag)
class Guest(converge_sync.Guest):
def register_convergence(self, transfer_variables):
self._register_convergence(is_stopped_transfer=transfer_variables.converge_flag)
class Arbiter(converge_sync.Arbiter):
def register_convergence(self, transfer_variables):
self._register_convergence(is_stopped_transfer=transfer_variables.converge_flag)
| 1,225 | 33.055556 | 88 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/procedure/paillier_cipher.py
|
#
# 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 federatedml.framework.hetero.sync import paillier_keygen_sync
class Host(paillier_keygen_sync.Host):
def register_paillier_cipher(self, transfer_variables):
self._register_paillier_keygen(pubkey_transfer=transfer_variables.paillier_pubkey)
class Guest(paillier_keygen_sync.Guest):
def register_paillier_cipher(self, transfer_variables):
self._register_paillier_keygen(pubkey_transfer=transfer_variables.paillier_pubkey)
class Arbiter(paillier_keygen_sync.Arbiter):
def register_paillier_cipher(self, transfer_variables):
self._register_paillier_keygen(pubkey_transfer=transfer_variables.paillier_pubkey)
| 1,271 | 34.333333 | 90 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/util/__init__.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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.
| 661 | 35.777778 | 75 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/sync/batch_info_sync.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 federatedml.util import LOGGER
from federatedml.util import consts
class Guest(object):
def _register_batch_data_index_transfer(self, batch_data_info_transfer,
batch_data_index_transfer,
batch_validate_info_transfer,
has_arbiter):
self.batch_data_info_transfer = batch_data_info_transfer.disable_auto_clean()
self.batch_data_index_transfer = batch_data_index_transfer.disable_auto_clean()
self.batch_validate_info_transfer = batch_validate_info_transfer
self.has_arbiter = has_arbiter
def sync_batch_info(self, batch_info, suffix=tuple()):
self.batch_data_info_transfer.remote(obj=batch_info,
role=consts.HOST,
suffix=suffix)
if self.has_arbiter:
self.batch_data_info_transfer.remote(obj=batch_info,
role=consts.ARBITER,
suffix=suffix)
def sync_batch_index(self, batch_index, suffix=tuple()):
self.batch_data_index_transfer.remote(obj=batch_index,
role=consts.HOST,
suffix=suffix)
def sync_batch_validate_info(self, suffix):
if not self.batch_validate_info_transfer:
raise ValueError("batch_validate_info should be create in transfer variable")
validate_info = self.batch_validate_info_transfer.get(idx=-1,
suffix=suffix)
return validate_info
class Host(object):
def _register_batch_data_index_transfer(self, batch_data_info_transfer, batch_data_index_transfer,
batch_validate_info_transfer):
self.batch_data_info_transfer = batch_data_info_transfer.disable_auto_clean()
self.batch_data_index_transfer = batch_data_index_transfer.disable_auto_clean()
self.batch_validate_info_transfer = batch_validate_info_transfer
def sync_batch_info(self, suffix=tuple()):
LOGGER.debug("In sync_batch_info, suffix is :{}".format(suffix))
batch_info = self.batch_data_info_transfer.get(idx=0,
suffix=suffix)
batch_size = batch_info.get('batch_size')
if batch_size < consts.MIN_BATCH_SIZE and batch_size != -1:
raise ValueError(
"Batch size get from guest should not less than {}, except -1, batch_size is {}".format(
consts.MIN_BATCH_SIZE, batch_size))
return batch_info
def sync_batch_index(self, suffix=tuple()):
batch_index = self.batch_data_index_transfer.get(idx=0,
suffix=suffix)
return batch_index
def sync_batch_validate_info(self, validate_info, suffix=tuple()):
self.batch_validate_info_transfer.remote(obj=validate_info,
role=consts.GUEST,
suffix=suffix)
class Arbiter(object):
def _register_batch_data_index_transfer(self, batch_data_info_transfer, batch_data_index_transfer):
self.batch_data_info_transfer = batch_data_info_transfer.disable_auto_clean()
self.batch_data_index_transfer = batch_data_index_transfer.disable_auto_clean()
def sync_batch_info(self, suffix=tuple()):
batch_info = self.batch_data_info_transfer.get(idx=0,
suffix=suffix)
return batch_info
| 4,439 | 45.736842 | 104 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/sync/converge_sync.py
|
# 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 federatedml.util import consts
class Arbiter(object):
# noinspection PyAttributeOutsideInit
def _register_convergence(self, is_stopped_transfer):
self._is_stopped_transfer = is_stopped_transfer
def sync_converge_info(self, is_converged, suffix=tuple()):
self._is_stopped_transfer.remote(obj=is_converged, role=consts.HOST, idx=-1, suffix=suffix)
self._is_stopped_transfer.remote(obj=is_converged, role=consts.GUEST, idx=-1, suffix=suffix)
class _Client(object):
# noinspection PyAttributeOutsideInit
def _register_convergence(self, is_stopped_transfer):
self._is_stopped_transfer = is_stopped_transfer
def sync_converge_info(self, suffix=tuple()):
is_converged = self._is_stopped_transfer.get(idx=0, suffix=suffix)
return is_converged
Host = _Client
Guest = _Client
| 1,467 | 33.952381 | 100 |
py
|
FATE
|
FATE-master/python/federatedml/framework/hetero/sync/selection_info_sync.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 federatedml.feature.feature_selection.selection_properties import SelectionProperties
from federatedml.transfer_variable.transfer_class.hetero_feature_selection_transfer_variable import \
HeteroFeatureSelectionTransferVariable
from federatedml.statistic.data_overview import look_up_names_from_header
from federatedml.util import LOGGER
from federatedml.util import consts
class Guest(object):
# noinspection PyAttributeOutsideInit
def register_selection_trans_vars(self, transfer_variable):
self._host_select_cols_transfer = transfer_variable.host_select_cols
self._result_left_cols_transfer = transfer_variable.result_left_cols
def sync_select_cols(self, suffix=tuple()):
host_select_col_names = self._host_select_cols_transfer.get(idx=-1, suffix=suffix)
# LOGGER.debug(f"In sync_select_cols, host_names: {host_select_col_names}")
host_selection_params = []
for host_id, select_names in enumerate(host_select_col_names):
host_selection_properties = SelectionProperties()
host_selection_properties.set_header(select_names)
host_selection_properties.set_last_left_col_indexes([x for x in range(len(select_names))])
host_selection_properties.add_select_col_names(select_names)
host_selection_params.append(host_selection_properties)
return host_selection_params
def sync_select_results(self, host_selection_inner_params, suffix=tuple()):
for host_id, host_select_results in enumerate(host_selection_inner_params):
# LOGGER.debug("Send host selected result, left_col_names: {}".format(host_select_results.left_col_names))
self._result_left_cols_transfer.remote(host_select_results.left_col_names,
role=consts.HOST,
idx=host_id,
suffix=suffix)
class Host(object):
# noinspection PyAttributeOutsideInit
def register_selection_trans_vars(self, transfer_variable: HeteroFeatureSelectionTransferVariable):
self._host_select_cols_transfer = transfer_variable.host_select_cols
self._result_left_cols_transfer = transfer_variable.result_left_cols
def sync_select_cols(self, encoded_names, suffix=tuple()):
self._host_select_cols_transfer.remote(encoded_names,
role=consts.GUEST,
idx=0,
suffix=suffix)
def sync_select_results_old(self, selection_param, decode_func=None, suffix=tuple()):
left_cols_names = self._result_left_cols_transfer.get(idx=0, suffix=suffix)
for col_name in left_cols_names:
if decode_func is not None:
col_name = decode_func(col_name)
selection_param.add_left_col_name(col_name)
LOGGER.debug("Received host selected result, original left_cols: {},"
" left_col_names: {}".format(left_cols_names, selection_param.left_col_names))
def sync_select_results(self, selection_param, header=None, anonymous_header=None, suffix=tuple()):
left_col_names = self._result_left_cols_transfer.get(idx=0, suffix=suffix)
if header is not None and anonymous_header is not None:
left_col_plain_names = look_up_names_from_header(left_col_names, anonymous_header, header)
for col_name in left_col_plain_names:
selection_param.add_left_col_name(col_name)
# LOGGER.debug(f"Received host selected result, original left_cols: {left_col_names},"
# f"left_col_names: {selection_param.left_col_names}")
| 4,437 | 52.46988 | 118 |
py
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.