Giter VIP home page Giter VIP logo

winograd_study's Introduction

说明

代码用于理解winograd算法,简单实现。

winograd算法和strassen算法一样,**上都是用更多的加法,用更少的乘法。

winograd乘法上的消耗减少了,内存IO上的耗时增加了,容易抵消乘法减少带来的收益。

toom-cook

求解G、B、A

https://gmplib.org/manual/Toom-3_002dWay-Multiplication.html

toom-cook

**剩余定理

https://www.encyclopediaofmath.org/index.php/Winograd_small_convolution_algorithm

image-20200424153932122

crt

思考

多项式乘法的本质是多项式系数的卷积。

一个域中的卷积可以等价为另一个域中的乘法。

G、A、B实际是到另一个域的变换矩阵,变换之后卷积就可以以乘法的方式体现。

卷积的本质是滤波。

滤波的本质是什么?有效信号的放大,无效信号的抑制,最终得到我们需要的信息。

try again

https://github.com/andravin/wincnn

>>> wincnn.showCookToomConvolution((0,1,-1,2),3,3)

AT =1  1  1   1  0⎤
⎢              ⎥
⎢0  1  -1  2  0⎥
⎢              ⎥
⎣0  1  1   4  1G =1/2    0     0  ⎤
⎢                ⎥
⎢-1/2  -1/2  -1/2⎥
⎢                ⎥
⎢-1/6  1/6   -1/6⎥
⎢                ⎥
⎢1/6   1/3   2/3 ⎥
⎢                ⎥
⎣ 0     0     1BT =2  -1  -2  1   0⎤
⎢                ⎥
⎢0  -2  -1  1   0⎥
⎢                ⎥
⎢0  2   -3  1   0⎥
⎢                ⎥
⎢0  -1  0   1   0⎥
⎢                ⎥
⎣0  2   -1  -2  1FIR filter: AT*((G*g)(BT*d)) =d[0]⋅g[0] + d[1]⋅g[1] + d[2]⋅g[2]⎤
⎢                                 ⎥
⎢d[1]⋅g[0] + d[2]⋅g[1] + d[3]⋅g[2]⎥
⎢                                 ⎥
⎣d[2]⋅g[0] + d[3]⋅g[1] + d[4]⋅g[2]⎦

1479115435

快速傅里叶变换

卷积还可以用快速傅里叶变换加速计算,参考fft.py

winograd_study's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

winograd_study's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.