Theano pairwise function#9
Conversation
|
(This addresses #8.) |
|
Perhaps we could make one that has the same accuracy and one that is not cheating. At least be up front about it in the report. I have an example that I didn't put in solving a Poisson eqn that depending on the method can span 4 orders of magnitude in runtime. It's not showing off the compiler tech by doing that unless the compiler tech can automatically detect this switch and do it for you (which I hope my sfl dsl will do someday). |
|
I added a non-cheating implementation, inspired by recent reading of the Tensor Contraction Engine (how does TCE maintain tolerances for numerical accuracy??). This impl currently uses more RAM than the other implementations, but that's just a compiler implementation detail right? |
|
RAM usage is not yet measured :) Also I wanted to add an implementation that uses just python + numpy as done in sklearn: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/metrics/pairwise.py#L176 in our case, |
|
When running this branch I get: |
|
This "test_value" business is one of the things in Theano I know next-to-nothing about. I suggest disabling it. It might be in your theanorc. |
|
@jaberg I don't have a theanorc. Anyway to make this benchmark work without custom config on the user environment? |
|
I didn't mean you would need a custom rc, I was only suggesting to delete any customizations you had made. I can't reproduce your crash, can you tell me what version of theano you are using? |
|
I was on master, I think. I will retry on the last stable release. |
|
Indeed it works with the latest stable version. I am pep8-ing and merging. |
It is cheating by using BLAS and being less accurate than other implementations. Is that really cheating? It could be more accurate by centering data before computing all pairs, is that "enough" ? The way to express the looping algorithm from the other implementations in Theano is to write an Op for that, essentially passing the burden of speed along to cython / numba / numpy / julia.