Example #1
0
def _SeluGradGrad(op, grad):
    x = op.inputs[1]
    scale_alpha = 1.7580993408473768599402175208123
    return (gen_nn_ops.elu_grad(grad, op.outputs[0]),
            array_ops.where(
                x < 0., gen_nn_ops.elu_grad(grad, op.outputs[0] + scale_alpha),
                array_ops.zeros(shape=array_ops.shape(x), dtype=x.dtype)))
Example #2
0
def _SeluGradGrad(op, grad):
  x = op.inputs[1]
  scale_alpha = 1.7580993408473768599402175208123
  return (gen_nn_ops.elu_grad(grad, op.outputs[0]),
          array_ops.where(
              x < 0., gen_nn_ops.elu_grad(grad, op.outputs[0] + scale_alpha),
              array_ops.zeros(shape=array_ops.shape(x), dtype=x.dtype)))
Example #3
0
def _EluGradGrad(op, grad):
    elu_x = op.inputs[1]
    return (gen_nn_ops.elu_grad(grad, op.outputs[0]),
            array_ops.where(
                elu_x < 0, grad * op.inputs[0],
                array_ops.zeros(shape=array_ops.shape(elu_x),
                                dtype=elu_x.dtype)))
Example #4
0
def _EluGrad(op, grad):
    return gen_nn_ops.elu_grad(grad, op.outputs[0])
Example #5
0
def _EluGradGrad(op, grad):
    elu_x = op.inputs[1]
    return (gen_nn_ops.elu_grad(grad, elu_x),
            array_ops.where(elu_x < 0, grad * op.inputs[0],
                            array_ops.zeros_like(elu_x)))
Example #6
0
def _EluGrad(op, grad):
  return gen_nn_ops.elu_grad(grad, op.outputs[0])
Example #7
0
def _EluGradGrad(op, grad):
  elu_x = op.inputs[1]
  return (gen_nn_ops.elu_grad(grad, op.outputs[0]),
          array_ops.where(
              elu_x < 0, grad * op.inputs[0],
              array_ops.zeros(shape=array_ops.shape(elu_x), dtype=elu_x.dtype)))