Skip to content

Commit cdd1a8a

Browse files
author
grigory
committed
Merge branch 'feature/fix-installation'
2 parents d6b4dcc + 05fd31b commit cdd1a8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+345
-837
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: python
2+
python:
3+
- "3.6"
4+
- "3.7"
5+
- "3.8"
6+
install:
7+
- pip install -r requirements.txt
8+
script:
9+
- make test

LICENSE.MD renamed to LICENSE.txt

File renamed without changes.

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include pyproject.toml
2+
3+
# Include the README
4+
include README.md
5+
6+
# Include the license file
7+
include LICENSE.txt

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -----------------------------------------------------------------------------
2+
# Run tests
3+
# -----------------------------------------------------------------------------
4+
5+
test:
6+
python -m unittest discover

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,25 @@ for snr in snr_range:
7373

7474
## TODO
7575

76-
[TODO List](TODO.md)
76+
### General
77+
78+
- [ ] Fix CRC-aided SC List decoder
79+
80+
### Polar code construction
81+
82+
- [ ] Arikan’s Monte-Carlo estimation [Section V.B](https://arxiv.org/pdf/1501.02473.pdf)
83+
- [ ] Trifonov’s Gaussian approximation [Section V.D](https://arxiv.org/pdf/1501.02473.pdf)
84+
85+
### Decoding
86+
- [ ] [SC STACK Decoding](https://ieeexplore.ieee.org/document/6215306)
87+
- [ ] [Fast SSC List Decoding](https://arxiv.org/pdf/1703.08208.pdf)
88+
- [ ] [Generalized Fast SSC LIST Decoding](https://arxiv.org/pdf/1804.09508.pdf)
89+
90+
### Modulation
91+
92+
- [ ] Q-PSK
93+
- [ ] 4-QAM
7794

7895
## License
7996

80-
[MIT License](LICENSE.MD)
97+
[MIT License](LICENSE.txt)

TODO.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[build-system]
2+
# These are the assumed default build requirements from pip:
3+
# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
4+
requires = ["setuptools>=40.8.0", "wheel"]
5+
build-backend = "setuptools.build_meta"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .fast_ssc import FastSSCPolarCodec
2+
from .g_fast_ssc import GFastSSCPolarCodec
3+
from .rc_scan import RCSCANPolarCodec
4+
from .sc import SCPolarCodec
5+
from .sc_list import SCListPolarCodec
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .codec import GeneralizedFastSSCPolarCodec
2-
from .decoder import GeneralizedFastSSCDecoder
1+
from .codec import GFastSSCPolarCodec
2+
from .decoder import GFastSSCDecoder
33
from .node import GFastSSCNode

python_polar_coding/polar_codes/g_fast_ssc/codec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
from python_polar_coding.polar_codes.fast_ssc import FastSSCPolarCodec
44

5-
from .decoder import GeneralizedFastSSCDecoder
5+
from .decoder import GFastSSCDecoder
66

77

8-
class GeneralizedFastSSCPolarCodec(FastSSCPolarCodec):
8+
class GFastSSCPolarCodec(FastSSCPolarCodec):
99
"""Generalized Fast SSC code.
1010
1111
Based on: https://arxiv.org/pdf/1804.09508.pdf
1212
1313
"""
14-
decoder_class = GeneralizedFastSSCDecoder
14+
decoder_class = GFastSSCDecoder
1515

1616
def __init__(
1717
self,

python_polar_coding/polar_codes/g_fast_ssc/decoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from .node import GFastSSCNode
66

77

8-
class GeneralizedFastSSCDecoder(FastSSCDecoder):
8+
class GFastSSCDecoder(FastSSCDecoder):
99
node_class = GFastSSCNode
1010

11-
def __init__(self, n: int, mask: np.array, AF: int = 1):
11+
def __init__(self, n: int, mask: np.array, AF: int = 0):
1212
self.AF = AF
1313
super().__init__(n=n, mask=mask)
1414

python_polar_coding/simulation/simulation.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
from ..channels import SimpleAWGNChannel
66
from ..modems import SimpleBPSKModem
77
from ..polar_codes import (
8-
FastSCANCodec,
98
FastSSCPolarCodec,
10-
GeneralizedFastSSCPolarCodec,
11-
GFastSCANCodec,
9+
GFastSSCPolarCodec,
1210
RCSCANPolarCodec,
1311
)
12+
from ..polar_codes.fast_scan import FastSCANCodec
13+
from ..polar_codes.g_fast_scan import GFastSCANCodec
1414
from . import functions, http
1515

1616

@@ -28,6 +28,15 @@ class CodeTypes:
2828
FAST_SCAN,
2929
G_FAST_SCAN,
3030
]
31+
SCAN = [
32+
RC_SCAN,
33+
FAST_SCAN,
34+
G_FAST_SCAN,
35+
]
36+
GENERALIZED = [
37+
G_FAST_SSC,
38+
G_FAST_SCAN,
39+
]
3140

3241

3342
class ChannelTypes:
@@ -37,7 +46,7 @@ class ChannelTypes:
3746
CODE_MAP = {
3847
CodeTypes.FAST_SSC: FastSSCPolarCodec,
3948
CodeTypes.RC_SCAN: RCSCANPolarCodec,
40-
CodeTypes.G_FAST_SSC: GeneralizedFastSSCPolarCodec,
49+
CodeTypes.G_FAST_SSC: GFastSSCPolarCodec,
4150
CodeTypes.FAST_SCAN: FastSCANCodec,
4251
CodeTypes.G_FAST_SCAN: GFastSCANCodec,
4352
}
@@ -101,10 +110,14 @@ def simulate_from_params(url: str):
101110
code_params=experiment,
102111
)
103112

104-
result_log = (f'Result: {result}\n'
105-
f'{code_type.upper()} ({experiment["N"]},{experiment["K"]})')
106-
if code_type == CodeTypes.RC_SCAN:
113+
result_log = (
114+
f'Result: {result}\n'
115+
f'{code_type.upper()} ({experiment["N"]},{experiment["K"]})'
116+
)
117+
if code_type in CodeTypes.SCAN:
107118
result_log += f', I = {experiment["I"]}'
119+
if code_type in CodeTypes.GENERALIZED:
120+
result_log += f', AF = {experiment["AF"]}'
108121
print(result_log)
109122

110123
resp = http.save_result(
@@ -115,7 +128,7 @@ def simulate_from_params(url: str):
115128
channel_type=channel_type,
116129
cls=cls,
117130
)
118-
print(f'Status: {resp.status_code}: {resp.json()}')
131+
print(f'Status {resp.status_code}: {resp.json()}')
119132

120133

121134
def simulate_multi_core(experiments: int, url: str):
@@ -124,8 +137,10 @@ def simulate_multi_core(experiments: int, url: str):
124137
print(f'Workers: {workers}; Number of experiments: {experiments}')
125138

126139
with futures.ProcessPoolExecutor(max_workers=workers) as ex:
127-
run_tasks = {ex.submit(simulate_from_params, *(url, )): (url, )
128-
for _ in range(experiments)}
140+
run_tasks = {
141+
ex.submit(simulate_from_params, *(url, )): (url, )
142+
for _ in range(experiments)
143+
}
129144
for future in futures.as_completed(run_tasks):
130145
try:
131146
future.result()

python_polar_coding/tests/test_g_fast_ssc/test_codec.py

Lines changed: 0 additions & 168 deletions
This file was deleted.

python_polar_coding/tests/test_sc_list/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)