secretflow.ml.boost.sgb_v.factory.components.gradient_encryptor#

Classes:

GradientEncryptor()

Manage all encryptions related to y, gradients, hessians

class secretflow.ml.boost.sgb_v.factory.components.gradient_encryptor.GradientEncryptor[源代码]#

基类:Component

Manage all encryptions related to y, gradients, hessians

Methods:

__init__()

show_params()

set_devices(devices)

get_params(params)

set_params(params)

pack(g, h)

encrypt(gh, tree_index)

cache_to_workers(encrypted_gh, gh)

get_move_config(pyu)

__init__()[源代码]#
show_params()[源代码]#
set_devices(devices: Devices)[源代码]#
get_params(params: dict)[源代码]#
set_params(params: dict)[源代码]#
pack(g: PYUObject, h: PYUObject) PYUObject[源代码]#
encrypt(gh: PYUObject, tree_index: int) HEUObject[源代码]#
cache_to_workers(encrypted_gh: HEUObject, gh: PYUObject) Dict[PYU, Union[HEUObject, PYUObject]][源代码]#
get_move_config(pyu)[源代码]#

secretflow.ml.boost.sgb_v.factory.components.gradient_encryptor.gradient_encryptor#

Classes:

GradientEncryptorParams(...)

'fixed_point_parameter': int. Any floating point number encoded by heu,

GradientEncryptor()

Manage all encryptions related to y, gradients, hessians

Functions:

define_encoder(params)

move_config(pyu, params)

class secretflow.ml.boost.sgb_v.factory.components.gradient_encryptor.gradient_encryptor.GradientEncryptorParams(fixed_point_parameter: int = 20, batch_encoding_enabled: bool = True, audit_paths: dict = <factory>)[源代码]#

基类:object

‘fixed_point_parameter’: int. Any floating point number encoded by heu,

will multiply a scale and take the round, scale = 2 ** fixed_point_parameter. larger value may mean more numerical accurate, but too large will lead to overflow problem. See HEU’s document for more details.

default: 20

‘batch_encoding_enabled’: bool. if use batch encoding optimization.

default: True.

‘audit_paths’: dict. {device : path to save log for audit}

Attributes:

fixed_point_parameter

batch_encoding_enabled

audit_paths

Methods:

__init__([fixed_point_parameter, ...])

fixed_point_parameter: int = 20#
batch_encoding_enabled: bool = True#
audit_paths: dict#
__init__(fixed_point_parameter: int = 20, batch_encoding_enabled: bool = True, audit_paths: dict = <factory>) None#
secretflow.ml.boost.sgb_v.factory.components.gradient_encryptor.gradient_encryptor.define_encoder(params: GradientEncryptorParams)[源代码]#
class secretflow.ml.boost.sgb_v.factory.components.gradient_encryptor.gradient_encryptor.GradientEncryptor[源代码]#

基类:Component

Manage all encryptions related to y, gradients, hessians

Methods:

__init__()

show_params()

set_devices(devices)

get_params(params)

set_params(params)

pack(g, h)

encrypt(gh, tree_index)

cache_to_workers(encrypted_gh, gh)

get_move_config(pyu)

__init__()[源代码]#
show_params()[源代码]#
set_devices(devices: Devices)[源代码]#
get_params(params: dict)[源代码]#
set_params(params: dict)[源代码]#
pack(g: PYUObject, h: PYUObject) PYUObject[源代码]#
encrypt(gh: PYUObject, tree_index: int) HEUObject[源代码]#
cache_to_workers(encrypted_gh: HEUObject, gh: PYUObject) Dict[PYU, Union[HEUObject, PYUObject]][源代码]#
get_move_config(pyu)[源代码]#
secretflow.ml.boost.sgb_v.factory.components.gradient_encryptor.gradient_encryptor.move_config(pyu, params)[源代码]#