Giter VIP home page Giter VIP logo

tf_acblock's Introduction

TF2 reimplementation of Asymmetric Convolution Module

This is a re-implementation of the paper: 'ACNet: Strengthening the Kernel Skeletons for Powerful CNN via Asymmetric Convolution Blocks'

Original paper site: https://arxiv.org/abs/1908.03930

Original Github site(Pytorch): https://github.com/DingXiaoH/ACNet

Currently only supports tf.keras API, does not support other TensorFlow APIs such as tf.layers, but you can look into the code and figure out ways around.

Requirement

  • Tensorflow 2
  • numpy

How to use

  1. Clone into your local directory.

    git clone https://github.com/CXYCarson/TF_AcBlock.git
    
  2. To train a cifar-quick without AC blocks, run

    python create_cfqk.py
    
  3. To train a cifar-quick with convolutions replaced with AC Blocks, run

    python create_AC_cfqk.py
    
  4. To convert the trained cifar-quick model into deploy mode, run

    python deploy_AC_cfqk.py
    
  5. Use it in your own project

    Ac_Block_utils.py contains all functions for you to use it in your own projects.

    First you'll need to use AC_Block() to build your model, it takes in almost the same parameters as the normal keras.layers.Conv2D() and keras.layers.BatchNormalization(). Note you must pass in the name of each module for deploying purpose.

    After you've trained and saved your model with AC modules, use the deploy() function to convert it to deploy mode. Simply pass in the checkpoint file in .h5 format and a list of AC module names. It will convert it to deploy mode and save a new model for you. Note that the converted model is not compiled yet, you'll need to compile it afterwards.

    All functionalities only support tf.keras API for now.

tf_acblock's People

Contributors

cxycarson 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.