Git Product home page Git Product logo

pixelhop's Introduction

Yifan Wang, Yueru Chen
[email protected], [email protected] last update 2019.09.25

Pixelhop

From arXiv:1909.08190. There are well packed Pixelhop unit and LAG unit with simple usage. It uses Saab (arXiv:1810.02786) inside it, part of the Saab code is modified from https://github.com/davidsonic/Interpretable_CNN.

Usage

Run the code in Python3 in ./src folder.

Pixelhop Unit:

x -> Input, 4-D tensor (N,H,W,D), the same as channel_last mode in Keras.

dilate -> Controls location of chooesn neghbour pixels.

pad -> Padding, support none, reflect, zeros (default: reflect)

num_AC_kernels -> Number of AC components to be kept.

weight_name -> Saab kernel file location to be saved or loaded. (default: ../weight/+weight_name)

getK -> If use input to compute Saab kernel. (default: True)

useDC -> If add DC component. (default: False)

x1 = PixelHop_Unit(x, dilate=1, pad='reflect', num_AC_kernels=9, weight_name='pixelhop1.pkl', getK=True, useDC=False)

LAG Unit:

x -> Input data matrix, 2-D tensor (N,D)

train_labels -> class labels of each training sample

class_list -> list of object classes

SAVE -> store parameters

num_clusters -> output feature dimension (default: 50)

alpha -> A parameter to determine the relationship between the Euclidean distance and the likelihood for a sample belonging to a cluste (default: 5)

Train -> True: training stage; False: testing stage (default: True)

x1=LAG_Unit(x,train_labels=train_labels, class_list=class_list,SAVE=SAVE,num_clusters=50,alpha=5,Train=True)

Example

One example is shown in ./src/example.py.

pixelhop's People

Contributors

yifan-fanyi avatar yueruche 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.