Пример #1
0
 def setUp(self):
     self.alpha0 = 2.0
     self.allocM = MixModel('EM', dict(alpha0=self.alpha0))
     self.N = np.asarray([1., 2., 3, 4, 5.])
     self.SS = SuffStatBag(K=5, D=1)
     self.SS.setField('N', self.N, dims='K')
     self.resp = np.random.rand(100, 3)
     self.precompEntropy = np.sum(self.resp * np.log(self.resp), axis=0)
Пример #2
0
 def setUp(self):
     '''
 Create a stupid simple case for making sure we're calculating things correctly
 '''
     self.alpha0 = 1.0
     self.allocM = MixModel('EM', dict(alpha0=self.alpha0))
     self.N = np.asarray([1., 2., 3, 4, 5.])
     self.SS = SuffStatBag(K=5, D=1)
     self.SS.setField('N', self.N, dims='K')
     self.resp = np.random.rand(100, 3)
     self.precompEntropy = np.sum(self.resp * np.log(self.resp), axis=0)