📄 regress.py
字号:
"""This module contains various regression tests designed to make surechannel decoding functions are working correctly."""import pycodesfrom pycodes.utils import channels, CodeMaker, testingfrom math import exp(N,K) = (1200,600)L = CodeMaker.make_H_gallager(N,3,6) E = (N-K)*6 # number of edges in the code graphtesting.RequireSuccessfulDecoding( 'Small BSC test decoded with SumProductBP', N,K,E,L,'bit flips',0.05,channels.BSCOutput,numTrials=50, maxIter=20,algorithm='SumProductBP',requiredSuccessRate=0.8, verbose=0)testing.RequireSuccessfulDecoding( 'Small BSC test decoded with LRSumProductBP', N,K,E,L,'bit flips',0.05, lambda x,y: map(lambda z: exp(z),channels.BSCOutput(x,y)), numTrials=50,maxIter=20, algorithm='LRSumProductBP',requiredSuccessRate=0.8,verbose=0)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -