I want to implement ordinal regression
<https://en.wikipedia.org/wiki/Ordinal_regression> in Theano. But I've no
idea how to implement the middle part: threshold definition and usage.
For example(simply say):
X = T.matrix('X', dtype='float32') # Feature matrix
y = T.vector('y', dtype='int32') # labels
w = T.vector('w', dtype='float32')
threshold = T.vector('threshold', dtype='float32')
p = T.nnet.sigmoid(threshold - T.dot(X, w))
p_y_x = theano.ifelse.ifelse(T.eq(y, 0), p[y], (p[y] - p[y-1]))
loss = -T.sum(T.log(p_y_x))
I notice there would be something wrong with the definition of p_y_x as
well as p. But I've no idea how to modify it. Can anyone help?
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.