1 Star 0 Fork 1

duanyao/Bio_CN_Parser

forked from laozibabac/Bio_CN_Parser 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
simulations_test.py 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
laozibabac 提交于 2023-11-22 18:01 . initial commit
#! /usr/bin/python
import brain_util as bu
import simulations
import unittest
class TestBrainFunction(unittest.TestCase):
def test_projection(self):
w = simulations.project_sim(1000000, 1000, 0.001, 0.05, 25)
self.assertEqual(w[-2], w[-1])
def test_pattern_completion(self):
(_, winners) = simulations.pattern_com(
100000, 317, 0.05, 0.05, 25, 0.5, 5)
self.assertGreaterEqual(bu.overlap(winners[24], winners[29]), 300)
def test_association(self):
(_, winners) = simulations.association_sim(100000, 317, 0.05, 0.1, 10)
self.assertLessEqual(bu.overlap(winners[9], winners[19]), 2)
self.assertGreaterEqual(bu.overlap(winners[9], winners[29]), 100)
self.assertGreaterEqual(bu.overlap(winners[19], winners[29]), 100)
self.assertGreaterEqual(bu.overlap(winners[9], winners[39]), 20)
def test_merge(self):
(w_a, w_b, w_c) = simulations.merge_sim(100000,317,0.01,0.05,50)
self.assertLessEqual(w_a[-1], 3200)
self.assertLessEqual(w_b[-1], 3200)
self.assertLessEqual(w_c[-1], 6400)
if __name__ == '__main__':
unittest.main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/duan-yao/bioparser.git
[email protected]:duan-yao/bioparser.git
duan-yao
bioparser
Bio_CN_Parser
master

搜索帮助