Skip to content

Commit

Permalink
Corrects experiment to also measure for p=2, q=2
Browse files Browse the repository at this point in the history
  • Loading branch information
fakufaku committed Apr 20, 2020
1 parent 4ccf4eb commit 015adf8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bss_scale/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def minimum_distortion(
"""

# by default we do the regular minimum distortion
if p is None or (p == 2.0 and q is None):
if p is None or (p == 2.0 and (q is None or p == q)):
return minimum_distortion_l2(Y, ref), 1

n_frames, n_freq, n_channels = Y.shape
Expand Down
2 changes: 1 addition & 1 deletion experiment1_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ref_mic": 0,

"minimum_distortion": {
"p_list": [0.1, 2.0, 0.1],
"p_list": [0.1, 2.0, 20],
"kwargs": {
"rtol": 1e-5,
"max_iter": 100
Expand Down
2 changes: 1 addition & 1 deletion experiment1_rpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ def one_loop(args):
gen_args,
func_init=init,
base_dir=base_dir,
results_dir="data/",
results_dir="sim_results/",
description="Simulation for OverIVA",
)
7 changes: 4 additions & 3 deletions process.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ def process(args, config):
results.append(t.copy())

# minimum distortion
lo, hi, step = config["minimum_distortion"]["p_list"]
lo, hi, n_steps = config["minimum_distortion"]["p_list"]
p_vals = np.linspace(lo, hi, n_steps)
kwargs = config["minimum_distortion"]["kwargs"]
for p in np.arange(lo, hi + step, step):
for q in np.arange(p, hi + step, step):
for ip, p in enumerate(p_vals):
for q in p_vals[ip:]:
t["p"], t["q"], t["proj_algo"] = (
f"{p:.1f}",
f"{q:.1f}",
Expand Down

0 comments on commit 015adf8

Please sign in to comment.