Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


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},
	year         = 2019,
	booktitle    = {2019 IEEE 20th International Workshop on Signal Processing Advances in Wireless Communications (SPAWC)},
	pages        = {1--5},
	doi          = {10.1109/SPAWC.2019.8815542}

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


Source code for the paper: "Low-Precision Neural Network Decoding of Polar Codes"