(self, data_instances, model_weights, encrypted_calculator,
                     optimizer, n_iter_, batch_index, cipher_operator)
Compute hetero poisson loss:
            h_loss = sum(exp(mu_h))

        Parameters:
        ___________
        data_instances: Table, input data

        model_weights: model weight object, stores intercept_ and coef_

        encrypted_calculator: ecnrypted calculator object

        optimizer: optimizer object

        n_iter_: int, current number of iter.

        batch_index: int, use to obtain current encrypted_calculator index

        cipher_operator: cipher for encrypt intermediate loss and loss_regular
Compute hetero poisson loss:
            h_loss = sum(exp(mu_h))
Compute hetero poisson loss : h_loss = sum ( exp ( mu_h ))
def compute_loss(self, data_instances, model_weights, encrypted_calculator,
                     optimizer, n_iter_, batch_index, cipher_operator):
        '''
        Compute hetero poisson loss:
            h_loss = sum(exp(mu_h))

        Parameters:
        ___________
        data_instances: Table, input data

        model_weights: model weight object, stores intercept_ and coef_

        encrypted_calculator: ecnrypted calculator object

        optimizer: optimizer object

        n_iter_: int, current number of iter.

        batch_index: int, use to obtain current encrypted_calculator index

        cipher_operator: cipher for encrypt intermediate loss and loss_regular

        '''
        current_suffix = (n_iter_, batch_index)
        self_wx = data_instances.mapValues(
            lambda v: vec_dot(v.features, model_weights.coef_) + model_weights.intercept_)
        en_wx = encrypted_calculator[batch_index].encrypt(self_wx)
        self.remote_loss_intermediate(en_wx, suffix=current_suffix)

        loss_regular = optimizer.loss_norm(model_weights)
        if loss_regular is not None:
            en_loss_regular = cipher_operator.encrypt(loss_regular)
            self.remote_loss_regular(en_loss_regular, suffix=current_suffix)
def compute_loss ( self , data_instances , model_weights , encrypted_calculator , optimizer , n_iter_ , batch_index , cipher_operator ) : current_suffix = ( n_iter_ , batch_index ) self_wx = data_instances . mapValues ( lambda v : vec_dot ( v . features , model_weights . coef_ ) + model_weights . intercept_ ) en_wx = encrypted_calculator [ batch_index ] . encrypt ( self_wx ) self . remote_loss_intermediate ( en_wx , suffix = current_suffix ) loss_regular = optimizer . loss_norm ( model_weights ) if loss_regular is not None : en_loss_regular = cipher_operator . encrypt ( loss_regular ) self . remote_loss_regular ( en_loss_regular , suffix = current_suffix )