TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfa.seq2seq.SequenceLoss

View source on GitHub

Class SequenceLoss

Weighted cross-entropy loss for a sequence of logits.

Aliases:

__init__

View source

__init__(
    average_across_timesteps=False,
    average_across_batch=False,
    sum_over_timesteps=True,
    sum_over_batch=True,
    softmax_loss_function=None,
    name=None
)

Initialize self. See help(type(self)) for accurate signature.

Methods

__call__

View source

__call__(
    y_true,
    y_pred,
    sample_weight=None
)

Override the parent call to have a customized reduce behavior.

from_config

from_config(
    cls,
    config
)

Instantiates a Loss from its config (output of get_config()).

Args:

  • config: Output of get_config().

Returns:

A Loss instance.

get_config

get_config()