Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
b9a02817
Commit
b9a02817
authored
2 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Add fig that is normalized by weights.
parent
c16c2077
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#38168
passed
2 years ago
Stage: simulation
Stage: synthesis
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/common/python/try_round_weight.py
+24
-0
24 additions, 0 deletions
libraries/base/common/python/try_round_weight.py
with
24 additions
and
0 deletions
libraries/base/common/python/try_round_weight.py
+
24
−
0
View file @
b9a02817
...
...
@@ -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
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment