allenai / allenai/hidden-networks

Question about the prune rate

Abierto
#9 2 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
198
Forks
58
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi,

Recently I tried the code and found that there seems to have inconsistency of the definition of prune rate throughout the code.

In builder.py, when the scale_fan is True, the fan is scaled by a factor of (1-prune_rate), where it denotes the top k% of weights as indicated in the paper. So here prune_rate means the ratio of weights to be removed. This meaning is consistent with main.py line 318, which calculates the number of parameters in the subnetwork.

But in conv_type.py lines 20-25, when generating the subnet mask, (1-prune_rate) of the weights are removed:
`j = int((1 - k) * scores.numel())
flat_out = out.flatten()
flat_out[idx[:j]] = 0
flat_out[idx[j:]] = 1`
which seems incorrect. So I think this is a bug and line 20 should be changed to
`j = int(k * scores.numel())`

Could you please clarify a bit what exactly does the prune_rate means in your code?

Thanks

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.