Code Monkey home page Code Monkey logo

Comments (5)

metastableB avatar metastableB commented on June 8, 2024

Hi @affot, to obtain the predictions you should first obtain a reference to the prediction operation by

   op = protoNNObj.getPredictionsOp() # or 
   op = bonsaiObj.getPredictions()

Once you have this, use your text data in the input X placeholder and evaluate this operation to obtain the predictions:

predictions = sess.run(op, feed_dict ={ X: X_test}) 

from edgeml.

ChristopherKoeppen avatar ChristopherKoeppen commented on June 8, 2024

Hello @metastableB

thanks a lot for your fast help here!! :-)
For protoNN it works. In the example I can handover for example the first 20 samples of the test set with:
predictions = sess.run(op, feed_dict ={ X: x_test[0:20]}) and it returns me an array with 20 predicted classes.

With the BonsaiObject I still have a problem. When I do the same here I get an error:

"InvalidArgumentError: You must feed a value for placeholder tensor 'sigmaI' with dtype float [[{{node sigmaI}}]]"
and
"InvalidArgumentError: You must feed a value for placeholder tensor 'sigmaI' with dtype float [[node sigmaI (defined at C:\Users\CK\anaconda3_neu\envs\BT36\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]]"

I allready tried predictions = sess.run(op, feed_dict ={ X: x_test[0:20], sigmaI: 1.0}) but here I get
"NameError: name 'sigmaI' is not defined" and don't find a solution.
Do you know where is the problem?

from edgeml.

metastableB avatar metastableB commented on June 8, 2024

You will need a reference to the sigmaI placeholder in the computation graph. You could try,

sigmaI = bonsaiTrainer.sigmaI
predictions = sess.run(op, feed_dict ={ X: x_test[0:20], sigmaI: 1.0})

See the declaration of sigmaI here.

Also for inference, you should set sigmaI to some large value ( 1e10 ) instead of 1.0.

from edgeml.

ChristopherKoeppen avatar ChristopherKoeppen commented on June 8, 2024

Thanks for your fast help here!! It works.

from edgeml.

ShikharJ avatar ShikharJ commented on June 8, 2024

Closing this for now, since the query is answered.

from edgeml.

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.