I am currently implementing the fully convolutional regression network which is outlined in detail in the paper "Synthetic Data for Text Localisation in Natural Images" by Ankush Gupta et al.
I've got the network model compiled using the Keras API and I'm trying to implement the custom loss layer. This network outputs a tensor which is 7x16x16 and each of the 7 output values for the 16x16 output feature maps represents a different regressed value that ultimately helps to predict the possibility, size, and location of text in each convolutional cell. The part that's confusing me is implementing the special operations that need to be performed in the loss function. One of the 7 regressed output values, let's call it "c", represents the probability of a cell to contain text. This is used to help determine whether or not the loss of the other 6 output values even get back propagated. The rules in the custom loss function are as follows: 1. If the value 'c' is 0 (meaning there is no text in the current cell), the loss of the other 6 values is ignored completely (I'm assuming this means it's set to 0 and nothing is actually back-propagated, right?) and the MSE of the 'c' value is back-propagated. 2. If the value 'c' is 0, the MSE loss of the 'c' value is discounted. At the beginning of training, only 1% of the loss is back-propagated and this value is steadily increased throughout training until 100% of the loss is back propagated. So, since my output tensor is 7x16x16, I believe this means I have 7 different 16x16 matrices (feature maps) by which to specify the loss. I have an easier time thinking about a tensor that's 16x16x7 (which means each cell in the 16x16 matrix has 7 values) and I'm not exactly sure how to approach coding up the 2 rules that I specified because it looks like I need to specify them as lazily evaluated theano tensor functions instead of being able to loop through the tensors myself to apply the if/then/else logic. It would be helpful to be pointed in the right direction. I've looked at the documentation for the theano tensor functions already and I don't think I'm understanding exactly what a sequence of those functions may look like to help solve my problem. I can see there being an IfElse function in there but I'm not exactly sure how I would do the logic for the two steps I outlined above using this method. Thank you in advance for any examples, suggestions, or insight you are able to provide. -- --- 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.