From eb32d83ed0018ddd8cbf9d6d1c99537e5fc0857d Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Fri, 25 Nov 2022 15:42:12 +0100 Subject: [PATCH] Modified main.py to work with the newly implemented cpp proximal decoder --- sw/main.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sw/main.py b/sw/main.py index 14ec9c7..3b0ebc9 100644 --- a/sw/main.py +++ b/sw/main.py @@ -1,12 +1,14 @@ import numpy as np from decoders import proximal, maximum_likelihood +from cpp_modules import cpp_decoders from utility import simulation, codes def start_new_simulation(sim_mgr: simulation.SimulationManager): sim_name = "test" + # H = codes.Gs["Hamming_7_4"] # H = codes.read_alist_file("res/204.3.486.alist") # H = codes.read_alist_file("res/204.55.187.alist") H = codes.read_alist_file("res/96.3.965.alist") @@ -15,12 +17,16 @@ def start_new_simulation(sim_mgr: simulation.SimulationManager): # H = codes.read_alist_file("res/999.111.3.5543.alist") # H = codes.read_alist_file("res/999.111.3.5565.alist") # H = codes.read_alist_file("res/816.1A4.845.alist") - k, n = H.shape + n_min_k, n = H.shape + k = n - n_min_k decoders = [ - proximal.ProximalDecoder(H, gamma=0.01), - proximal.ProximalDecoder(H, gamma=0.05), - proximal.ProximalDecoder(H, gamma=0.15) + cpp_decoders.ProximalDecoder(H.astype('int32'), gamma=0.01, K=1000, + omega=1e-4, eta=1.5), + cpp_decoders.ProximalDecoder(H.astype('int32'), gamma=0.05, K=1000, + omega=5*1e-5, eta=1.5), + cpp_decoders.ProximalDecoder(H.astype('int32'), gamma=0.15, K=1000, + omega=1e-4, eta=1.5) ] labels = [ @@ -31,7 +37,8 @@ def start_new_simulation(sim_mgr: simulation.SimulationManager): sim = simulation.Simulator(n=n, k=k, decoders=decoders, target_frame_errors=100, - SNRs=np.arange(1, 6, 0.5)) + SNRs=np.arange(1, 6, 0.5), + max_num_iterations=3000) sim_mgr.configure_simulation(simulator=sim, name=sim_name, column_labels=labels)