addons icon indicating copy to clipboard operation
addons copied to clipboard

Can I use normalized "trellis" as probability distribution over classes for each sequence element?

Open koren-v opened this issue 4 years ago • 1 comments

Hi, I use your piece of code in my model, but instead of hard labels, I need to know the probability of each class for each timestamp. So can I use normalized trellis as these distributions?

koren-v avatar Mar 19 '21 08:03 koren-v

Hi @koren-v , that probability you mentioned is the emission probability? if so, I think you can use tfa.layers.CRF to get the potentials (as logits).

In following sample code:

layer = tfa.layers.CRF(4, use_boundary=False)
decoded_sequence, potentials, sequence_length, chain_kernel = layer(inputs)

potentials is the thing you want.


So can I use normalized trellis as these distributions?

I did not understand your question, can you rephrase it in detail?

howl-anderson avatar Aug 28 '21 15:08 howl-anderson

TensorFlow Addons is transitioning to a minimal maintenance and release mode. New features will not be added to this repository. For more information, please see our public messaging on this decision: TensorFlow Addons Wind Down

Please consider sending feature requests / contributions to other repositories in the TF community with a similar charters to TFA: Keras Keras-CV Keras-NLP

seanpmorgan avatar Mar 01 '23 04:03 seanpmorgan