當前位置: 首頁>>代碼示例>>Python>>正文


Python isd.GaussianRestraint類代碼示例

本文整理匯總了Python中IMP.isd.GaussianRestraint的典型用法代碼示例。如果您正苦於以下問題:Python GaussianRestraint類的具體用法?Python GaussianRestraint怎麽用?Python GaussianRestraint使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了GaussianRestraint類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testE

 def testE(self):
     "Test GaussianRestraint(3) score"
     gr = GaussianRestraint(*self.all)
     for i in range(100):
         map(self.change_value, self.all)
         map(self.change_sign, self.locations)
         e = gr.evaluate(False)
         self.assertAlmostEqual(e, self.normal_e(*self.all))
開發者ID:AljGaber,項目名稱:imp,代碼行數:8,代碼來源:test_GaussianRestraint.py

示例2: testSanityPE

 def testSanityPE(self):
     "Test if GaussianRestraint(13) prob is exp(-score)"
     gr = GaussianRestraint(*self.all)
     for i in range(100):
         map(self.change_value, self.all)
         map(self.change_sign, self.locations)
         self.assertAlmostEqual(gr.get_probability(),
                                exp(-gr.evaluate(False)), delta=0.001)
開發者ID:AljGaber,項目名稱:imp,代碼行數:8,代碼來源:test_GaussianRestraint.py

示例3: testdx

 def testdx(self):
     "Test GaussianRestraint(3) x derivative"
     gr = GaussianRestraint(*self.all)
     for i in range(100):
         map(self.change_value, self.all)
         map(self.change_sign, self.locations)
         gr.evaluate(True)
         self.assertAlmostEqual(Nuisance(self.x).get_nuisance_derivative(),
                                self.deriv_x(*self.all))
開發者ID:AljGaber,項目名稱:imp,代碼行數:9,代碼來源:test_GaussianRestraint.py

示例4: testSanityEP

 def testSanityEP(self):
     "Test if GaussianRestraint(13) score is -log(prob)"
     gr = GaussianRestraint(*self.all)
     for i in range(100):
         map(self.change_value, self.all)
         map(self.change_sign, self.locations)
         expected = gr.get_probability()
         if expected == 0:
             continue
         self.assertAlmostEqual(-log(expected),
                                gr.evaluate(False), delta=0.7)
開發者ID:AljGaber,項目名稱:imp,代碼行數:11,代碼來源:test_GaussianRestraint.py


注:本文中的IMP.isd.GaussianRestraint類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。