Hi all,

I have a TensorVariable, with 3 dimensions, which represents categorical 
output of the segmentation network, i.e.
- first dimension represents image
- second dimension represents pixel
- third dimension represents label classes (one column per each class, 1 
means that the pixel belongs to this class, 0 means it doesn't)
My problem: I want to take only a subset of this tensor. Specifically, I 
want to filter out all the pixels in a particular category
To put some context, I want to call categorical_crossentropy method from 
tensor.nnet method. But ignore one category (which represents unknown label 
in my case) 

I have no idea how to handle this. I was looking for a way to get indexes 
of tensor by specific condition, and could not find any.
Even more, if I knew what the indexes are, I fail to extract the subtensor 
properly.
I've done a few experiments with take function. But it seems to make 
selections in one dimension only (according to axis argument). I.e. if I 
new the pixel indexes I want to keep, I could apply take method with these 
indexes and axis = 1.
The problem is that for each image I will need different pixel indexes. I 
could probably solve this with loop, but then I would need to join 
selections from different images somehow, and once again - no idea how to 
do this...

Any help would be highly appreciated.
Thanks!!!
 

-- 

--- 
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.

Reply via email to