sparse-structured-attention icon indicating copy to clipboard operation
sparse-structured-attention copied to clipboard

How to run tests

Open loretoparisi opened this issue 7 years ago • 3 comments

Please add some docs about how to run the tests presented in the paper. Thank you!

loretoparisi avatar Nov 07 '17 18:11 loretoparisi

Do you mean the experiments from the NIPS paper?

Unfortunately those are not implemented in this repository, this just implements the fundamental building blocks usable from pytorch. In general you can take any existing pytorch code (e.g. OpenNMT-py) and replace softmax with fusedmax, oscarmax or sparsemax from this repository, with minor work for adapting the API (notably, passing sequence lengths if needed.)

vene avatar Nov 07 '17 19:11 vene

@vene yes the experiments. Thanks for the clarification, but how did you tested these ones :)?

loretoparisi avatar Nov 07 '17 19:11 loretoparisi

there are unit tests in this repository that check that the implementation is correct. You can look at the test_*.py files, or run them using pytest.

Maybe in a future version I will add some toy examples and plots. Contributions always welcome!

vene avatar Nov 07 '17 19:11 vene