Exemplo n.º 1
0
    def __init__(self, params=None, layer_config=None, model_builder=None):
        self.nn_define = layer_config
        self.layer_config = layer_config

        self.host_input_shape = None
        self.guest_input_shape = None
        self.model = None
        self.rng_generator = random_number_generator.RandomNumberGenerator()
        self.model_builder = model_builder
        self.transfer_variable = None
        self.learning_rate = params.interactive_layer_lr
        self.encrypted_host_dense_output = None

        self.encrypted_host_input = None
        self.guest_input = None
        self.guest_output = None
        self.host_output = None

        self.dense_output_data = None

        self.guest_model = None
        self.host_model = None

        self.partitions = 0
        self.do_backward_select_strategy = False
        self.encrypted_host_input_cached = None
        self.drop_out_keep_rate = params.drop_out_keep_rate
        self.drop_out = None

        self.fixed_point_encoder = None if params.floating_point_precision is None else FixedPointEncoder(
            2**params.floating_point_precision)

        self.sync_output_unit = False
Exemplo n.º 2
0
    def __init__(self, params):
        self.acc_noise = None
        self.learning_rate = params.interactive_layer_lr
        self.encrypter = self.generate_encrypter(params)
        self.transfer_variable = None
        self.partitions = 1
        self.input_shape = None
        self.output_unit = None
        self.rng_generator = random_number_generator.RandomNumberGenerator()
        self.do_backward_select_strategy = False
        self.drop_out_keep_rate = params.drop_out_keep_rate

        self.fixed_point_encoder = None if params.floating_point_precision is None else FixedPointEncoder(
            2**params.floating_point_precision)
        self.mask_table = None
Exemplo n.º 3
0
 def set_fixed_float_precision(self, floating_point_precision):
     if floating_point_precision is not None:
         self.fixed_point_encoder = FixedPointEncoder(
             2**floating_point_precision)