andravin / wincnn

Winograd minimal convolution algorithm generator for convolutional neural networks.
Apache License 2.0
606 stars 144 forks source link

What are the polynomial points for F(4,5)??? #22

Open victorygogogo opened 5 years ago

andravin commented 5 years ago

Because F(4,5) is the same degree as F(6,3), the same 7 interpolation points should work for both algorithms.

Generally for any F(m,r) with m+r-2 = n, you can try the same n interpolation points.

Following the example in the README, try

>>> from sympy import Rational
>>> wincnn.showCookToomFilter((0,1,-1,2,-2,Rational(1,2),-Rational(1,2)), 4, 5)

Hope that helps.

victorygogogo commented 5 years ago

thank you very much

victorygogogo commented 5 years ago

(0,1,-1,Rational(1,2),-Rational(1,2),2,-2 this interp can get the right result ?

andravin commented 5 years ago

Yes, the order you list the points in does not matter .. and otherwise your list is the same as mine.

The usual caveat applies: the more interpolation points your algorithm uses, the greater the numeric error when computed with limited precision arithmetic.

Increasingly, I am only interested in the shortest convolution algorithms, because the latest hardware tends not to have enough memory bandwidth to make the larger algorithms efficient. Also F(2,3) can be accurate even with low precision arithmetic.

victorygogogo commented 5 years ago

so if use low precision data type such as float16 ,f(2,3) can ignore the error ?

andravin commented 5 years ago

Yes, F(2,3) should work well with float16 precision, but as always, actually measure the error compared to a high precision direct convolution for your application!

Shipley1105 commented 10 months ago

How to compute F(7,3)?