0

http://lasagne.readthedocs.org/en/latest/user/tutorial.html#id2

I have tried the following

network_output = lasagne.layers.get_output(network)
f = theano.function([input_var], network_output[:,-1])
y_hat = f(X_train)

however I get NAN for all the samples in Y_hat here.

EDIT: I was able to solve the NAN issue. However now my prediction returns only one class (1)

a'-
  • 251
  • 5
  • 14

1 Answers1

0

network_output is a matrix of shape (N,K) where N is the number of datapoints and K is the number of classes; it is a raw scores matrix. In your code network_output[:,-1] will be all the raw score values for the K-th or last label. In other words, you are returning a column vector, not the entire raw scores matrix. To output all the scores simply modify your theano.function to this:

f = theano.function([input_var], network_output)

and you should be returning all the raw class scores.

Indie AI
  • 601
  • 1
  • 6
  • 6