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[source]#

Bases: 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__()[source]#
show_params()[source]#
set_devices(devices: Devices)[source]#
get_params(params: dict)[source]#
set_params(params: dict)[source]#
pack(g: PYUObject, h: PYUObject) PYUObject[source]#
encrypt(gh: PYUObject, tree_index: int) HEUObject[source]#
cache_to_workers(encrypted_gh: HEUObject, gh: PYUObject) Dict[PYU, Union[HEUObject, PYUObject]][source]#
get_move_config(pyu)[source]#

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>)[source]#

Bases: 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)[source]#
class secretflow.ml.boost.sgb_v.factory.components.gradient_encryptor.gradient_encryptor.GradientEncryptor[source]#

Bases: 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__()[source]#
show_params()[source]#
set_devices(devices: Devices)[source]#
get_params(params: dict)[source]#
set_params(params: dict)[source]#
pack(g: PYUObject, h: PYUObject) PYUObject[source]#
encrypt(gh: PYUObject, tree_index: int) HEUObject[source]#
cache_to_workers(encrypted_gh: HEUObject, gh: PYUObject) Dict[PYU, Union[HEUObject, PYUObject]][source]#
get_move_config(pyu)[source]#
secretflow.ml.boost.sgb_v.factory.components.gradient_encryptor.gradient_encryptor.move_config(pyu, params)[source]#