regress.py

来自「著名的ldpc编解码的资料及源代码」· Python 代码 · 共 28 行

PY
28
字号
"""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 + =
减小字号Ctrl + -
显示快捷键?