Simulating more parameters for proximal decoding; Changed theme
This commit is contained in:
parent
dcb78a3963
commit
296feaf1fb
15
sw/main.py
15
sw/main.py
@ -21,12 +21,19 @@ def main():
|
|||||||
[0, 1, 1, 0, 0, 1, 1],
|
[0, 1, 1, 0, 0, 1, 1],
|
||||||
[0, 0, 0, 1, 1, 1, 1]])
|
[0, 0, 0, 1, 1, 1, 1]])
|
||||||
|
|
||||||
|
R = np.array([[0, 0, 1, 0, 0, 0, 0],
|
||||||
|
[0, 0, 0, 0, 1, 0, 0],
|
||||||
|
[0, 0, 0, 0, 0, 1, 0],
|
||||||
|
[0, 0, 0, 0, 0, 0, 1]])
|
||||||
|
|
||||||
# Define encoder and decoders
|
# Define encoder and decoders
|
||||||
|
|
||||||
encoder = channel.Encoder(G)
|
encoder = channel.Encoder(G)
|
||||||
|
|
||||||
decoders = {"naive_soft_decision": naive_soft_decision.SoftDecisionDecoder(G, H),
|
decoders = {"naive_soft_decision": naive_soft_decision.SoftDecisionDecoder(G, H, R),
|
||||||
# "proximal": proximal.ProximalDecoder(H, K=100, gamma=0.01),
|
"proximal_0_01": proximal.ProximalDecoder(H, R, K=100, gamma=0.01),
|
||||||
|
"proximal_0_05": proximal.ProximalDecoder(H, R, K=100, gamma=0.05),
|
||||||
|
"proximal_0_15": proximal.ProximalDecoder(H, R, K=100, gamma=0.15),
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test decoders
|
# Test decoders
|
||||||
@ -34,7 +41,7 @@ def main():
|
|||||||
k, n = G.shape
|
k, n = G.shape
|
||||||
d = np.zeros(k) # All-zeros assumption
|
d = np.zeros(k) # All-zeros assumption
|
||||||
|
|
||||||
SNRs = np.linspace(1, 7, 9)
|
SNRs = np.linspace(1, 8, 9)
|
||||||
data = pd.DataFrame({"SNR": SNRs})
|
data = pd.DataFrame({"SNR": SNRs})
|
||||||
|
|
||||||
for decoder_name in decoders:
|
for decoder_name in decoders:
|
||||||
@ -48,6 +55,8 @@ def main():
|
|||||||
|
|
||||||
# Plot results
|
# Plot results
|
||||||
|
|
||||||
|
sns.set_theme()
|
||||||
|
|
||||||
fig, axes = plt.subplots(1, 1)
|
fig, axes = plt.subplots(1, 1)
|
||||||
fig.suptitle("Bit-Error-Rates of various decoders")
|
fig.suptitle("Bit-Error-Rates of various decoders")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user