MiguelMonteiro / CRFasRNNLayer

Conditional Random Fields as Recurrent Neural Networks (Tensorflow)
MIT License
82 stars 19 forks source link

problems in the testing results #3

Closed liuziyang123 closed 6 years ago

liuziyang123 commented 6 years ago

I followed your steps and when I run crf_rnn_layer_test.py I got this output and this output How did this happen?

MiguelMonteiro commented 6 years ago

Hi, that test is just meant to exemplify how to use it and to make sure that the dimensions match up. The output is supposed to be rubbish because there is no training, labels/ground-truth or a neural network underneath. If you want to make sure the filters are working correctly please look at the tests for bilateral filtering in the permutohedral lattice repository. If the filters are working then the rest is working. If want to learn how to use this layer in a useful way please check the original paper.

Best,

Miguel

liuziyang123 commented 6 years ago

Thank you so much for answering my question. And may I ask another question? Why can't we feed labels to this layer? Is it because that the dimensions will not match up?

MiguelMonteiro commented 6 years ago

The dimensions match up (as long as it is one-hot encoding) and hence you can feed them it is just not correct to do so. In theory of the CRF we deal with log probability (logits) not labels or probability, as a result, the correct procedure is to feed the layer the raw outputs (logits) from the neural network.