-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Description
Hi,
I have a question about the "scale"; the following code segment:
if do_scale and np.random.uniform() < p_scale_per_sample:
if independent_scale_for_each_axis and np.random.uniform() < p_independent_scale_per_axis:
sc = []
for _ in range(dim):
if np.random.random() < 0.5 and scale[0] < 1:
sc.append(np.random.uniform(scale[0], 1)) #
else:
sc.append(np.random.uniform(max(scale[0], 1), scale[1]))
else:
if np.random.random() < 0.5 and scale[0] < 1:
sc = np.random.uniform(scale[0], 1)
else:
sc = np.random.uniform(max(scale[0], 1), scale[1])
I'm confused and has this design considered other issues?
I think should the code be changed to this:
...
for _ in range(dim):
if np.random.random() < 0.5 and scale[0] < 1:
sc.append(np.random.uniform(scale[0], min(scale[1], 1)))
else:
sc.append(np.random.uniform(max(scale[0], 1), scale[1]))
else:
if np.random.random() < 0.5 and scale[0] < 1:
sc = np.random.uniform(scale[0], min(scale[1], 1))
else:
sc = np.random.uniform(max(scale[0], 1), scale[1])
Or more simplified:
if independent_scale_for_each_axis and np.random.uniform() < p_independent_scale_per_axis:
sc = []
for _ in range(dim):
sc.append(np.random.uniform(scale[0], scale[1]))
else:
sc = np.random.uniform(scale[0], scale[1])
Best regards,
Connor
Metadata
Metadata
Assignees
Labels
No labels