Giter Site home page Giter Site logo

adam-dziedzic / bandlimited-cnns Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 5.0 4.24 GB

Band-limited Training and Inference for Convolutional Neural Networks

Home Page: https://adam-dziedzic.github.io/bandlimited-cnns/

License: Apache License 2.0

Jupyter Notebook 48.34% Python 32.72% Shell 17.92% C++ 0.14% Cuda 0.83% C 0.01% CMake 0.01% Makefile 0.03% Roff 0.01% MATLAB 0.01% Batchfile 0.01% JavaScript 0.01%
cnns convolution fft convolutional-neural-networks python pytorch cuda neural-network compression

bandlimited-cnns's People

Contributors

adam-dziedzic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bandlimited-cnns's Issues

FFT conv with wrap-around

[Bit offtopic] While researching convolutions via FFT i stumbled upon this library which seems to be very well implemented.
For research I need convolutions via FFT that don't pad the input. It seems trivial but I don't seem to get it right.
I thought I only need to modify:


with:

        if out_size_H:
            out_H = out_size_H
        elif out_size or stride_type is StrideType.SPECTRAL:
            out_H = (H - HH + 2 * pad_H) // stride_H + 1
        elif wrap_around: #new
            out_H = H
        else:
            out_H = H - HH + 1 + 2 * pad_H

(similarly h)
and

init_H_fft = H + 2 * pad_H + HHH - 1

if wrap_around: #new
   init_H_fft = H + 2 * pad_H
   init_W_fft = W + 2 * pad_W
else:
   (usual init_H_fft, init_W_fft)

but this does not equal:

p_x_torch = torch.nn.functional.pad(x_torch, (1,1,1,1), mode='circular')
expect = torch.nn.functional.conv2d(input=p_x_torch, weight=y_torch,
                                            bias=b_torch, padding=0)

Thanks for your time!

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.