Coder Social home page Coder Social logo

siddhi-execution-tensorflow's Introduction

siddhi-execution-tensorflow

The siddhi-execution-tensorflow is an extension to Siddhi that adds support for inferences from pre-built TensorFlow SavedModels using Siddhi.

Find some useful links below:

Latest API Docs

Latest API Docs is 1.0.0-SNAPSHOT.

How to use

Using the extension in WSO2 Stream Processor

Using the extension as a java library

  • This extension can be added as a maven dependency along with other Siddhi dependencies to your project.
     <dependency>
        <groupId>org.wso2.extension.siddhi.execution.tensorflow</groupId>
        <artifactId>siddhi-execution-tensorflow</artifactId>
        <version>x.x.x</version>
     </dependency>

Jenkins Build Status


Branch Build Status
master Build Status

Features

  • tensorFlow (Stream Processor)

    Performs inferences (prediction) from an already built TensorFlow machine learning model. The types of models are unlimited (including image classifiers, deep learning models) as long as they satisfy the following conditions.
    1. They are saved with the tag 'serve' in SavedModel format
    2. Model is initially trained and ready for inferences
    3. Inference logic is written and saved in the model
    4. signature_def is properly included in the metaGraphDef (a protocol buffer file which has information about the graph) and the key for prediction signature def is 'serving-default'

    Also the prerequisites for inference are as follows.
    1. User knows the names of the input and output nodes
    2. Has a preprocessed data set of Java primitive types or their multidimensional arrays

    Since each input is directly used to create a Tensor they should be of compatible shape and data type with the model.
    The information related to input and output nodes can be retrieved from saved model signature def.signature_def can be read by using the saved_model_cli commands found at https://www.tensorflow.org/programmers_guide/saved_model
    signature_def can be read in Python as follows
    with tf.Session() as sess:
      md = tf.saved_model.loader.load(sess, ['serve'], export_dir)
      sig = md.signature_def[tf.saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY]
      print(sig)

    Or you can read signature def from Java as follows,
    final String DEFAULT_SERVING_SIGNATURE_DEF_KEY = "serving_default";

    final SignatureDef sig =
          MetaGraphDef.parseFrom(model.metaGraphDef())
              .getSignatureDefOrThrow(DEFAULT_SERVING_SIGNATURE_DEF_KEY);

    You will have to import the following in Java.
    import org.tensorflow.framework.MetaGraphDef;
    import org.tensorflow.framework.SignatureDef;

How to Contribute

Contact us

Support

  • We are committed to ensuring support for this extension in production. Our unique approach ensures that all support leverages our open development methodology and is provided by the very same engineers who build the technology.

  • For more details and to take advantage of this unique opportunity contact us via http://wso2.com/support/.

siddhi-execution-tensorflow's People

Contributors

sybernix avatar maheshika avatar pcnfernando avatar mohanvive 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.