Added requirements.txt and instructions for running to README
This commit is contained in:
parent
6444914296
commit
bf469afbd1
18
sw/README.md
18
sw/README.md
@ -2,4 +2,20 @@
|
|||||||
|
|
||||||
## Software
|
## Software
|
||||||
|
|
||||||
`TODO`
|
### Create a python virtual environment
|
||||||
|
|
||||||
|
In the root directory of this repository run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ python3 -m venv venv
|
||||||
|
$ source venv/bin/activate
|
||||||
|
$ pip3 install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
### Run the unit tests
|
||||||
|
|
||||||
|
In the root directory of this repository run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ python -m unittest discover test
|
||||||
|
```
|
||||||
|
|||||||
@ -6,7 +6,7 @@ class ProximalDecoder:
|
|||||||
"""Class implementing the Proximal Decoding algorithm. See "Proximal Decoding for LDPC Codes" by Tadashi
|
"""Class implementing the Proximal Decoding algorithm. See "Proximal Decoding for LDPC Codes" by Tadashi
|
||||||
Wadayama, and Satoshi Takabe.
|
Wadayama, and Satoshi Takabe.
|
||||||
"""
|
"""
|
||||||
def __init__(self, H: np.array, K: int = 10, step_size: float = 0.1, gamma: float = 0.05):
|
def __init__(self, H: np.array, K: int = 10, step_size: float = 0.01, gamma: float = 0.05):
|
||||||
"""Construct a new ProximalDecoder Object.
|
"""Construct a new ProximalDecoder Object.
|
||||||
|
|
||||||
:param H: Parity Check Matrix
|
:param H: Parity Check Matrix
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import seaborn as sns
|
import seaborn as sns
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
from decoders import proximal
|
from decoders import proximal
|
||||||
from decoders import utility
|
from decoders import utility
|
||||||
@ -25,10 +26,13 @@ def main():
|
|||||||
|
|
||||||
print(f"Simulating with c = {c}")
|
print(f"Simulating with c = {c}")
|
||||||
|
|
||||||
decoder = proximal.ProximalDecoder(H, K=1000)
|
decoder = proximal.ProximalDecoder(H, K=100)
|
||||||
SNRs, BERs = utility.test_decoder(decoder, c, N=100)
|
SNRs, BERs = utility.test_decoder(decoder, c, N=100)
|
||||||
|
|
||||||
plt.stem(SNRs, BERs)
|
data = pd.DataFrame({"SNR": SNRs, "BER": BERs})
|
||||||
|
|
||||||
|
ax = sns.lineplot(data=data, x="SNR", y="BER")
|
||||||
|
ax.set_ylim([0, 1])
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
5
sw/requirements.txt
Normal file
5
sw/requirements.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
matplotlib==3.6.2
|
||||||
|
numpy==1.23.4
|
||||||
|
pandas==1.5.1
|
||||||
|
seaborn==0.12.1
|
||||||
|
tqdm==4.64.1
|
||||||
Loading…
Reference in New Issue
Block a user