-
Notifications
You must be signed in to change notification settings - Fork 2
Layers : Reduce
Reduce layers apply the same operation to the tensor elements along one or more axes.
-
Ttensor of size$(N,C_T,H_T,W_T)$
- (optional)
axes(list[int]) : the axes along which the operation is to be applied. If not given, the deault is to either to reduce over all the axes ifnoop_with_empty_axesis 0, or to not reduce otherwise. -
noop_with_empty_axes(int) (default is0) : Define behavior ifaxesis empty : reduce over all axes is 0, do not reduce if set to 1 -
keepdims(int) (default i1) : If set to 1, the reduced dimension will be kept (they wil be of size 1)
-
Ytensor of size$(N,C_Y,H_Y,W_Y)$
Let be
For this section, keepdims is assumed to be set to 1 to simplify the writing.
- Isolate a set
$S_i$ of element to reduce - Compute the output value using
$f()$ - Put the value instead of the set
$S_i$ - Repeat for each set
Over all the dimensions:
The output size is
Only one set:
Over two dimensions:
Let's assume that the axes to reduce are the axes 1 and 2.
The output size is
There are
Over one dimensions:
Let's assume that the axe to reduce is 1.
The output size is
There are
This section describe the
Let be