src.model.deeplearn.layer.torf_masked_fill_layer
Classes
|
- class src.model.deeplearn.layer.torf_masked_fill_layer.TORFMaskedFillLayer(*args, **kwargs)
- Author:
Alberto M. Esmoris Pena
Apply a float mask to a tensor, filling invalid (zero-mask) positions with a large negative value so they are ignored by a subsequent
maxreduction.Given tensors
[X, M]whereMcontains 0/1 floats:\[f(\mathbf{X}, \mathbf{M}) = \mathbf{X} \odot \mathbf{M} + (1 - \mathbf{M}) \cdot v_{\text{fill}}\]- Variables:
fill_value (float) – Value written into masked-out positions.
- __init__(fill_value=-1000000000.0, **kwargs)
See
LayerandLayer.__init__().
- call(inputs, training=False, mask=False)
Apply masked fill.
- Parameters:
inputs – List of two tensors
[X, M]whereMis a float mask with the same broadcastable shape asX.- Returns:
The masked tensor.
- get_config()
Return necessary data to deserialize the layer.
- classmethod from_config(config)
Use given config data to deserialize the layer.