14.9. Maths Sum \(\sum\)

Our implementation API:

Maths sum as computational node.

class fhez.nn.operations.sum.Sum

Sum inputs and distribute backprop.

First dim of inputs shape e.g (64,32,32,3) to sum are summed along axis=0 resulting in an output of (32,32,3) and returning gradients of (64,)

backward(gradient: numpy.ndarray)

Distribute gradient to inputs.

property cost

Get computational cost of this node.

forward(x: numpy.ndarray)

Sum inputs together assuming first dim is inputs.

update()

Do nothing since sum is not parameterisable.

updates()

Do nothing since sum is not parameterisable.