GithubHelp home page GithubHelp logo

Comments (12)

Maratyszcza avatar Maratyszcza commented on May 20, 2024 1

For FullyConnected operator, it is (output_dim, input_dim). Generally operators use NHWC layout.

from xnnpack.

Maratyszcza avatar Maratyszcza commented on May 20, 2024 1

You can set all height dimensions (input height, kernel height, height subsampling) to 1, this would be equivalent to 1D convolution.

from xnnpack.

Maratyszcza avatar Maratyszcza commented on May 20, 2024
  1. F32 functions don't quantize computations. However, many F32 operators accept output_min and output_max arguments which enable clamping output to arbitrary range (helpful e.g. for fusing simple activation functions). If you don't want to clamp output, just set them to +-std::numeric_limits<float>::infinity()
  2. XNNPACK is a fork of QNNPACK. Q8 operators in XNNPACK are remnants of QNNPACK code, but many internal optimizations were removed, and performance of these operators would be worse than in QNNPACK.

from xnnpack.

RuABraun avatar RuABraun commented on May 20, 2024

Okay thank you!

from xnnpack.

RuABraun avatar RuABraun commented on May 20, 2024

@Maratyszcza one more question, is the kernel shaped (input_dim, output_dim) or (output_dim, input_dim) ?

edit: seems to be (output_dim, input_dim)

from xnnpack.

RuABraun avatar RuABraun commented on May 20, 2024

Works great!

Two more questions, any plans on adding an elementwise product operator? And is it somehow possible to make the FullyConnected add to the the output instead of setting it?

from xnnpack.

Maratyszcza avatar Maratyszcza commented on May 20, 2024

Elementwise product (including broadcasting support) landed just yesterday, see xnn_create_multiply_nd_f32 and xnn_setup_multiply_nd_f32. Currently Fully Connected operator doesn't support fused addition, but you can use separate Add operator (see xnn_create_add_nc_f32 and xnn_setup_add_nc_f32)

from xnnpack.

RuABraun avatar RuABraun commented on May 20, 2024

Haha perfect timing! Thanks

from xnnpack.

RuABraun avatar RuABraun commented on May 20, 2024

@Maratyszcza seems broadcasting support is not available for the add operation (for when one wants to implement batch normalization for example)? is my impression correct?

could disabling the check and setting the bias mean stride to 0 work as quick hack?

edit: hah looks like it does!

from xnnpack.

Maratyszcza avatar Maratyszcza commented on May 20, 2024

For batch normalization, I'd recommend to convert it into 1x1 depthwise convolution. XNNPACK has special optimizations for 1x1 DW convolution.

from xnnpack.

RuABraun avatar RuABraun commented on May 20, 2024

I'm not working with images, so my input/output matrixes are only 2D, I assume xnn_create_convolution2d... would crash then (don't see a 1D version)? Don't see an option to set stride to 0 in one direction.

from xnnpack.

RuABraun avatar RuABraun commented on May 20, 2024

Ah thanks, forgot to check the setup function.

from xnnpack.

Related Issues (20)

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.