You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following function in nda.optimizers.compressor seems incorrect. It does not keep a values; instead it keeps dim-a values.
Random_a compressor, keep a values
def random(x, a):
dim = x.shape[0]
if a == 0:
return 0
if a == dim:
return x
if x.ndim == 2:
for i in range(x.shape[1]):
zero_mask = xp.random.choice(dim, a, replace=False)
x[zero_mask, i] = 0
else:
zero_mask = xp.random.choice(dim, a, replace=False)
x[zero_mask] = 0
return x
To correct the above issue, replace:
xp.random.choice(dim, a, replace=False)
with
xp.random.choice(dim, dim-a, replace=False)
The text was updated successfully, but these errors were encountered:
The following function in nda.optimizers.compressor seems incorrect. It does not keep a values; instead it keeps dim-a values.
Random_a compressor, keep a values
def random(x, a):
dim = x.shape[0]
if a == 0:
return 0
if a == dim:
return x
if x.ndim == 2:
for i in range(x.shape[1]):
zero_mask = xp.random.choice(dim, a, replace=False)
x[zero_mask, i] = 0
else:
zero_mask = xp.random.choice(dim, a, replace=False)
x[zero_mask] = 0
return x
To correct the above issue, replace:
xp.random.choice(dim, a, replace=False)
with
xp.random.choice(dim, dim-a, replace=False)
The text was updated successfully, but these errors were encountered: