'Sets the backpropagation to use the shortcut when gradients do not
need to be calculated.
If True, a shortcut calculation is used. If False, the actual derivative
is return during backpropagation.
Arguments:
shortcut (bool): If True, shortcut calculation will be used during backpropagation.'

def set_shortcut(self, shortcut):

    self.shortcut = shortcut
    if shortcut:
        self.bprop_func = (lambda x: 1)
    else:
        self.bprop_func = (lambda x: (x * (1.0 - x)))
