GithubHelp home page GithubHelp logo

gaojiah / octconv-tfkeras Goto Github PK

View Code? Open in Web Editor NEW

This project forked from koshian2/octconv-tfkeras

0.0 1.0 0.0 130 KB

Unofficial implementation of Octave Convolutions (OctConv) in TensorFlow / Keras.

License: MIT License

Python 100.00%

octconv-tfkeras's Introduction

OctConv-TFKeras

Unofficial implementation of Octave Convolutions (OctConv) in TensorFlow / Keras.

Y. Chen, H. Fang, B. Xu, Z. Yan, Y. Kalantidis, M. Rohrbach, S. Yan, J. Feng. Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution. (2019). https://arxiv.org/abs/1904.05049

(Update 2019-04-26) Official implementation by MXNet is available : https://github.com/facebookresearch/OctConv

Usage

from oct_conv2d import OctConv2D
# high, low = some tensors or inputs
high, low = OctConv2D(filters=ch, alpha=alpha)([high, low])

Colab Notebook

Train OctConv ResNet (TPU)
https://colab.research.google.com/drive/1MXN46mhCk6s-G_nfJrH1B6_8GXh-a_QH

Measuring prediction time (CPU)
https://colab.research.google.com/drive/12MdVXyB9K3FnpzYNmyc3qu5s59-53WNE

CIFAR-10

Experimented with Wide ResNet (N = 4, k = 10). Train with colab TPUs.

alpha Test Accuracy
0 88.68%
0.25 94.25%
0.5 94.06%
0.75 93.66%

Prediction Time

CPU and GPU are colab environment. On CPU, use 256 samples for prediction, and on GPU, use 50000 samples for prediction. Both CPU and GPU are 32x32 resolution each.

CPU

alpha/s Mean Median S.D. Median/sample[ms] Relative measured value Theoretical FLOPs cost
0 39.18 38.96 0.6807 152.19 100 100
0.25 29.79 29.55 0.7705 115.43 76 67
0.5 20.61 20.46 0.5052 79.92 53 44
0.75 14.38 14.17 0.7874 55.35 36 30

Theoretical FLOPs cost are from the paper.

GPU

alpha/s Mean Median S.D. Median/sample[ms] Relative measured value
0 60.43 59.94 1.693 1.20 100
0.25 62.24 62.09 0.6996 1.24 104
0.5 47.87 47.73 0.6224 0.95 80
0.75 34.15 34 0.6747 0.68 57

You can see that the time spent on prediction decreases with theoretical FLOPs costs, both CPU and GPU.

Details (Japanese)

[最新論文]Octave Convolution(OctConv)を試してみる
https://qiita.com/koshian2/items/0e40a5930f1aa63a66b9

octconv-tfkeras's People

Contributors

koshian2 avatar

Watchers

James Cloos avatar

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.