Skip to content
Snippets Groups Projects
Commit b9a02817 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Add fig that is normalized by weights.

parent c16c2077
No related branches found
No related tags found
No related merge requests found
Pipeline #38168 passed
......@@ -67,6 +67,7 @@ _parser = argparse.ArgumentParser(
# Get an overview
> python try_round_weight.py --w_lo 0.2 --w_hi 3.0 --w_step 0.01 --s_lo 0.5 --s_hi 10 --s_step 0.2 -N 195312 -S 1
> python try_round_weight.py --w_lo 0.2 --w_hi 2.0 --w_step 0.01 --s_lo 1 --s_hi 10 --s_step 1 -N 195312 -S 1
# Zoom in at w = 0.75
> python try_round_weight.py --w_lo 0.7 --w_hi 0.8 --w_step 0.0001 --s_lo 1 --s_hi 10 --s_step 1 -N 195312 -S 0
......@@ -154,6 +155,8 @@ figNr = 0
figNr += 1
plt.figure(figNr)
for s, sigma in enumerate(sigmas):
# Plot sigma_qq of twice quantized noise as function of weight for
# different input sigmas
plt.plot(weights, sigmas_qq_T[s], label='s = %4.2f' % sigma)
plt.title("Sigma of weighted quantized noise")
plt.xlabel("Weight")
......@@ -164,6 +167,25 @@ plt.grid()
figNr += 1
plt.figure(figNr)
for s, sigma in enumerate(sigmas):
# Plot sigma_qq of twice quantized noise as function of weight for
# different input sigmas.
# Normalize the sigma_qq by the weight, so that it can be compared with
# the input sigma that is shown by the horizontal sigma reference lines.
plt.plot(weights, sigmas_qq_T[s] / weights, label='s = %4.2f' % sigma)
plt.plot(weights, sigmas[s]*np.ones(N_weights)) # add sigma reference lines
plt.title("Sigma of weighted quantized noise, normalized for weight")
plt.xlabel("Weight")
plt.ylabel("Sigma_qq")
plt.legend(loc='upper right')
plt.grid()
figNr += 1
plt.figure(figNr)
for s, sigma in enumerate(sigmas):
# Plot ratio of sigma_qq / sigma_sq as function of weight for different
# input sigma. The ratio deviation from 1 tells how much the twice
# quantized noise deviates from the noise that is only quantized after
# the weighting.
plt.plot(weights, sigmas_ratio_T[s], label='s = %4.2f' % sigma)
plt.title("Relative sigma difference of weighting after / before quantisation")
plt.xlabel("Weight")
......@@ -174,6 +196,8 @@ plt.grid()
figNr += 1
plt.figure(figNr)
for w, weight in enumerate(weights):
# Plot ratio of sigma_qq / sigma_sq as function of input sigma for
# different weights
plt.plot(sigmas, sigmas_ratio[w], label='w = %4.2f' % weight)
plt.title("Relative sigma difference of weighting after / before quantisation")
plt.xlabel("Sigma")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment