regress.py

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

PY
27
字号
"""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 BEC test decoded with SumProductBP',    N,K,E,L,'erasures',0.35,channels.BECOutput,    numTrials=50,maxIter=20,algorithm='SumProductBP',requiredSuccessRate=0.8)testing.RequireSuccessfulDecoding(    'Small BEC test decoded with LRSumProductBP',    N,K,E,L,'erasures',0.35,    lambda x,y: map(lambda z: exp(min(z,10)),channels.BECOutput(x,y)),    numTrials=50,maxIter=20,algorithm='LRSumProductBP',    requiredSuccessRate=0.8)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?