Modified main.py to work with the newly implemented cpp proximal decoder
This commit is contained in:
parent
5fc8435cb4
commit
eb32d83ed0
17
sw/main.py
17
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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user