gbopt/acquisition_functions/eif.py
def compute(self, i):
        """
        Computes the EIF value for a given point x.

        Parameters
        ----------
        i: int
            The index of input point where the acquisition function should be evaluated.

        Returns
        -------
        np.ndarray(1,1)
            Expected influence of x.
        """
        Y_norm = self._normalize()
        Y = self.graph.Y

        self.graph.Y = Y_norm
        y = self.graph.Y[i]
        # If the label of x is 0
        self.graph.update(i, 0)
        self.label_prop_alg.label_propagate(self.graph)
        uids = np.delete(np.arange(self.graph.Y.shape[0]), self.graph.lids)
        YU0 = self.graph.Y[uids]
        self.graph.remove(i)

        self.graph.Y = Y_norm
        # If the label of x is 1
        self.graph.update(i, 1)
        self.label_prop_alg.label_propagate(self.graph)
        YU1 = self.graph.Y[uids]
        self.graph.remove(i)

        self.graph.Y = Y

        return (1 - y) * np.sum(1 - YU0) + y * np.sum(YU1)
        #return y * np.sum(YU1)

        Computes the EIF value for a given point x.

        Parameters
        ----------
        i: int
            The index of input point where the acquisition function should be evaluated.

        Returns
        -------
        np.ndarray(1,1)
            Expected influence of x.
        
Computes the EIF value for a given point x.
Parameters

int
The index of input point where the acquisition function should be evaluated.

Returns

np.ndarray(1,1)
Expected influence of x.
Computes the EIF value for a given point x . Parameters int The index of input point where the acquisition function should be evaluated . Returns np . ndarray ( 1 1 ) Expected influence of x .
def compute(self, i):
        Y_norm = self._normalize()
        Y = self.graph.Y
        self.graph.Y = Y_norm
        y = self.graph.Y[i]
        self.graph.update(i, 0)
        self.label_prop_alg.label_propagate(self.graph)
        uids = np.delete(np.arange(self.graph.Y.shape[0]), self.graph.lids)
        YU0 = self.graph.Y[uids]
        self.graph.remove(i)
        self.graph.Y = Y_norm
        self.graph.update(i, 1)
        self.label_prop_alg.label_propagate(self.graph)
        YU1 = self.graph.Y[uids]
        self.graph.remove(i)
        self.graph.Y = Y
        return (1 - y) * np.sum(1 - YU0) + y * np.sum(YU1)
def compute ( self , i ) : Y_norm = self . _normalize ( ) Y = self . graph . Y self . graph . Y = Y_norm y = self . graph . Y [ i ] self . graph . update ( i , 0 ) self . label_prop_alg . label_propagate ( self . graph ) uids = np . delete ( np . arange ( self . graph . Y . shape [ 0 ] ) , self . graph . lids ) YU0 = self . graph . Y [ uids ] self . graph . remove ( i ) self . graph . Y = Y_norm self . graph . update ( i , 1 ) self . label_prop_alg . label_propagate ( self . graph ) YU1 = self . graph . Y [ uids ] self . graph . remove ( i ) self . graph . Y = Y return ( 1 - y ) * np . sum ( 1 - YU0 ) + y * np . sum ( YU1 )
Computes the EIF value for a given point x.
Parameters
Computes the EIF value for a given point x . Parameters
"""
        Computes the EIF value for a given point x.

        Parameters
        ----------
        i: int
            The index of input point where the acquisition function should be evaluated.

        Returns
        -------
        np.ndarray(1,1)
            Expected influence of x.
        """ # If the label of x is 0 # If the label of x is 1 #return y * np.sum(YU1)
self
i