src.model.deeplearn.layer.torf_reduce_sum_layer
Classes
|
- class src.model.deeplearn.layer.torf_reduce_sum_layer.TORFReduceSumLayer(*args, **kwargs)
- Author:
Alberto M. Esmoris Pena
Reduce a tensor by summation along a given axis, optionally keeping the reduced dimension and adding a small epsilon for numerical stability.
\[f(\mathbf{X}) = \sum_{\text{axis}} \mathbf{X} \;+\; \varepsilon\]- Variables:
axis (int) – The axis along which to sum.
keepdims (bool) – Whether to keep the reduced dimension.
eps (float) – Small constant added after summation (default 0).
- __init__(axis=1, keepdims=True, eps=0.0, **kwargs)
See
LayerandLayer.__init__().
- call(inputs, training=False, mask=False)
Sum the input tensor along the configured axis.
- Parameters:
inputs – The input tensor.
- Returns:
The reduced tensor.
- get_config()
Return necessary data to deserialize the layer.
- classmethod from_config(config)
Use given config data to deserialize the layer.