Coder Social home page Coder Social logo

Comments (3)

yoonkim avatar yoonkim commented on June 17, 2024 1

You want to create (and compile) a theano function whose output is y_pred, given the input.

from cnn_sentence.

alex-j-j avatar alex-j-j commented on June 17, 2024 1

In case anybody else stumbles over the same problem: define a function predict_val = theano.function([x], test_y_pred, allow_input_downcast=True) and call it wherever you deem it necessary, e.g. in the epoch loop: predictions = predict_val(test_set_x). This seems to output the predictions for test_set_x.

from cnn_sentence.

wyqnumber avatar wyqnumber commented on June 17, 2024

test_set_x = datasets[1][:,:img_h]
test_set_y = np.asarray(datasets[1][:,1], "int32")

test_set_yList = test_set_y.tolist()

shareTestX, shareTestY = shared_dataset((test_set_x ,test_set_y))

test_y_pred = classifier.predict(test_layer1_input)

predict_model = theano.function([index], T.mul(test_y_pred,1), givens={x: shareTestX[index:(index+1)]})

predict_value = [test_model(i) for i in xrange(len(test_set_yList))]

print predict_value

But, it is wrong, How to write the code? Thank you!

from cnn_sentence.

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.