Skip to content
Source code for the paper: "Low-Precision Neural Network Decoding of Polar Codes"
Python C++ CMake C
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
python Initial commit Jun 30, 2019
source/polar_decoder Initial commit Jun 30, 2019
.gitignore Initial commit Jun 30, 2019
LICENSE Initial commit Jun 30, 2019 Update Nov 16, 2019


The following code was used to obtain results for the paper: "Low-Precision Neural Network Decoding of Polar Codes" published to SPAWC2019. If you use this code please cite us:

  title={{Low-Precision} Neural Network Decoding of Polar Codes},
  author={Wodiany, Igor and Pop, Antoniu},
  booktitle={2019 IEEE 20th International Workshop on Signal Processing Advances in Wireless Communications (SPAWC)},

Running Python simulation - layer type get_decoder - NN sizes - quantizations levels

Running the simulation consists of 2 steps: Setting up the environment and running the python function. The first step is achieved by following commands:

$ cd <Project Root>/python
$ pipenv shell
$ python3

Then to run the example simulation:

>>> import
>>>, 4, ['NN_LLR'], 1000)

Python simulation supports caching now so when model is invoked again, after it was trained in the previous run, simulation will loaded it from the saved file. However it does not work for the NN with quantized layers.

The following files have to be changed to test different configurations:

  • Layers type (normal/quantized) can be changed in
  • Layers size can be changed in in the get_decoder function
  • Quantizated types can be changed in

Running C++ implementation

The C++ project can be built using CMake and Make using the Intel Compiler (ICC):

$ mkdir build
$ cd build/
$ cmake -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER=/opt/intel/compilers_and_libraries_2019/linux/bin/intel64/icc \
  -DCMAKE_CXX_COMPILER=/opt/intel/compilers_and_libraries_2019/linux/bin/intel64/icc ..
$ make

The project was tested with ICC 19.0.1, however it should work with any recent version of ICC or GCC.

To run the decoder:

$ cd source/polar_decoder
$ ./Decoder 512-256-128/int8

The second argument is the network configuration and the date type. Only configurations that are in the data/weights directory are valid arguments.

The following changes have to be made to the source code to allow testing different sizes/data types:

  • Adjust layers sizes in NeuralDecoder.h
  • Change weights data types in DecoderMain.cpp
  • Enable or disable lut2 clipping in DenseLayer.h


Since the code is not the highest quality, as getting results fast was far more important than everything else, please feel to contact me if you need help with running the code.

You can’t perform that action at this time.