neuroprob/inference.py
def update(self, eval_rate, activity, tbin):
        """
        Use IPP likelihood for cognitive maps to assign weights
        TODO use NLL directly
        """
        units = len(activity)
        fact = factorial(activity)
        w = 1.
        for u in range(units):
            rT = tbin*eval_rate[u]((self.samples[:, 0], self.samples[:, 1], np.zeros_like(self.samples[:, 0])))
            if activity[u] > 0:
                w *= rT**activity[u] / fact[u] * np.exp(-rT)

        self.weights *= w
        self.weights += 1e-12
        self.weights /= self.weights.sum()

        self.eff_cnt = np.sum(np.square(self.weights))

        Use IPP likelihood for cognitive maps to assign weights
        TODO use NLL directly
        
Use IPP likelihood for cognitive maps to assign weights
TODO use NLL directly
Use IPP likelihood for cognitive maps to assign weights TODO use NLL directly
def update(self, eval_rate, activity, tbin):
        units = len(activity)
        fact = factorial(activity)
        w = 1.
        for u in range(units):
            rT = tbin*eval_rate[u]((self.samples[:, 0], self.samples[:, 1], np.zeros_like(self.samples[:, 0])))
            if activity[u] > 0:
                w *= rT**activity[u] / fact[u] * np.exp(-rT)
        self.weights *= w
        self.weights += 1e-12
        self.weights /= self.weights.sum()
        self.eff_cnt = np.sum(np.square(self.weights))
def update ( self , eval_rate , activity , tbin ) : units = len ( activity ) fact = factorial ( activity ) w = 1. for u in range ( units ) : rT = tbin * eval_rate [ u ] ( ( self . samples [ : , 0 ] , self . samples [ : , 1 ] , np . zeros_like ( self . samples [ : , 0 ] ) ) ) if activity [ u ] > 0 : w *= rT ** activity [ u ] / fact [ u ] * np . exp ( - rT ) self . weights *= w self . weights += 1e-12 self . weights /= self . weights . sum ( ) self . eff_cnt = np . sum ( np . square ( self . weights ) )
Use IPP likelihood for cognitive maps to assign weights
TODO use NLL directly
Use IPP likelihood for cognitive maps to assign weights TODO use NLL directly
"""
        Use IPP likelihood for cognitive maps to assign weights
        TODO use NLL directly
        """
self
eval_rate
activity
tbin