numenta / nupic.research

Experimental algorithms. Unsupported.
https://nupicresearch.readthedocs.io
GNU Affero General Public License v3.0
104 stars 60 forks source link

Add script for calculating `sparsity` for config #545

Closed mvacaporale closed 3 years ago

mvacaporale commented 3 years ago

Here's a script that calculates what the sparsity needs to be in the config for the model to measure in at a desired sparsity. For instance, one may need to set sparsity=0.801 to achieve the sparsity of 80%.

Usage is

python calculate_sparsity_param -e bert_experiment -s 0.8

where e is the name of the experiment config (say tiny_bert_trifecta) and s is the desired sparsity.

mvacaporale commented 3 years ago

Looks good - but should we move it to scripts folder, instead of leaving it in root?

We can, I was keeping it consistent with export_finetuning_results.py and export_model.py, but I can move it to scripts if you think that's more appropriate.

lucasosouza commented 3 years ago

Looks good - but should we move it to scripts folder, instead of leaving it in root?

We can, I was keeping it consistent with export_finetuning_results.py and export_model.py, but I can move it to scripts if you think that's more appropriate.

The rule I was using there is currently runnable files stay in root folder, like run.py and export_finetuning.py, and run-once scripts move to scripts folder. Given that, should be fine to leave it in the root folder for now.