Git Product home page Git Product logo

batchgather's Introduction

BatchGather

Another idea for the built-in Tensorflow function "tf.batch_gather".

"tf.batch_gather" is a built-in function matching "tf.nn.top_k" in my own opinion.

In other words, my opinion is maybe a mistake.

The origin "tf.batch_gather" converts local batch_indices into global ones.

  • Here is the array example

  • The example that the local indices have been converted to global ones.

(The TopKV2 results from "tf.nn.top_k")

So we can find that 0 to 4 and 2 to 6.

then it gathers values corresponding to the indices.

  • my batch_gather function

I do not change the batch_indices. In contrast, the data array is processed, and what I do is just a demo to show the function's principle.

please read my codesome_test.py to find more, and I also provide batch_gather.py which is from tensorflow-github.

Wanna know more about batch_gather.py, you can refer https://github.com/tensorflow/tensorflow/blob/r1.13/tensorflow/python/ops/array_ops.py

  • PS: the top-k function can be used to hard negative mining in SSD or YOLO, some object detection algorithms I am studying. And the "tf.batch_gather" gathers corresponding yHat array to calculate the loss.

batchgather's People

Contributors

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