Lottery-Ticket-Hypothesis-in-Pytorch icon indicating copy to clipboard operation
Lottery-Ticket-Hypothesis-in-Pytorch copied to clipboard

Freezing Pruned weights smaller than 1e-6

Open yuezhixiong opened this issue 4 years ago • 3 comments

In main.py #Freezing Pruned weights by making their gradients Zero grad_tensor = np.where(tensor < EPS, 0, grad_tensor)

Does this also freeze the weights that have negative values? More than just weights with 0 values?

yuezhixiong avatar May 07 '20 08:05 yuezhixiong

I think it's really a bug. Once solving this problem, my experiment results can reach the original performance in the first iteration(pruning has not started). Hope to help you!

xiaosaisworking avatar May 14 '20 01:05 xiaosaisworking

I think it's really a bug. Once solving this problem, my experiment results can reach the original performance in the first iteration(pruning has not started). Hope to help you!

I also meet this problem, my experiment results can't reach the original performance. How can I solve this problem with the "grad_tensor = np.where(tensor < EPS, 0, grad_tensor)" , please?

JaminLi avatar Sep 28 '20 09:09 JaminLi

@JaminLi I think it should be grad_tensor = np.where(tensor.abs() < EPS, 0, grad_tensor).

zdhNarsil avatar Nov 10 '20 13:11 zdhNarsil