(self, data_instances, model_weights, encrypted_calculator,
                                       batch_index, current_suffix, offset=None)
return fore_gradient
Compute gradients:
        gradient = (1/N) * \sum(exp(wx) - y) * x

        Define exp(wx) as mu, named it as guest_forward or host_forward
        Define (mu-y) as fore_gradient
        Then, gradient = fore_gradient * x
Compute gradients:
        gradient = (1/N) * \sum(exp(wx) - y) * x
Compute gradients : gradient = ( 1 / N ) * \ sum ( exp ( wx ) - y ) * x
def compute_and_aggregate_forwards(self, data_instances, model_weights, encrypted_calculator,
                                       batch_index, current_suffix, offset=None):
        '''
        Compute gradients:
        gradient = (1/N) * \sum(exp(wx) - y) * x

        Define exp(wx) as mu, named it as guest_forward or host_forward
        Define (mu-y) as fore_gradient
        Then, gradient = fore_gradient * x

        '''
        if offset is None:
            raise ValueError("Offset should be provided when compute poisson forwards")
        mu = data_instances.join(offset, lambda d, m: np.exp(vec_dot(d.features, model_weights.coef_)
                                                             + model_weights.intercept_ + m))
        self.forwards = mu

        self.host_forwards = self.get_host_forward(suffix=current_suffix)

        self.aggregated_forwards = self.forwards.join(self.host_forwards[0], lambda g, h: g * h)
        fore_gradient = self.aggregated_forwards.join(data_instances, lambda mu, d: mu - d.label)
        return fore_gradient
def compute_and_aggregate_forwards ( self , data_instances , model_weights , encrypted_calculator , batch_index , current_suffix , offset = None ) : if offset is None : raise ValueError ( "Offset should be provided when compute poisson forwards" ) mu = data_instances . join ( offset , lambda d , m : np . exp ( vec_dot ( d . features , model_weights . coef_ ) + model_weights . intercept_ + m ) ) self . forwards = mu self . host_forwards = self . get_host_forward ( suffix = current_suffix ) self . aggregated_forwards = self . forwards . join ( self . host_forwards [ 0 ] , lambda g , h : g * h ) fore_gradient = self . aggregated_forwards . join ( data_instances , lambda mu , d : mu - d . label ) return fore_gradient