| @@ -52,7 +52,6 @@ namespace Tensorflow | |||||
| => new PaddingFIFOQueue(capacity, | => new PaddingFIFOQueue(capacity, | ||||
| new [] { dtype }, | new [] { dtype }, | ||||
| new[] { shape }, | new[] { shape }, | ||||
| new[] { name }, | |||||
| shared_name: shared_name, | shared_name: shared_name, | ||||
| name: name); | name: name); | ||||
| @@ -47,6 +47,15 @@ namespace Tensorflow.Gradients | |||||
| return new Tensor[] { gen_nn_ops.relu_grad(grads[0], op.outputs[0]) }; | return new Tensor[] { gen_nn_ops.relu_grad(grads[0], op.outputs[0]) }; | ||||
| } | } | ||||
| [RegisterGradient("LeakyRelu")] | |||||
| public static Tensor[] _LeakyReluGrad(Operation op, Tensor[] grads) | |||||
| { | |||||
| var grad = grads[0]; | |||||
| var x = op.inputs[0]; | |||||
| var alpha = (float)op.get_attr("alpha"); | |||||
| return new Tensor[] { gen_nn_ops.leaky_relu_grad(grad, x, alpha: alpha)}; | |||||
| } | |||||
| /// <summary> | /// <summary> | ||||
| /// The derivative of the softmax nonlinearity. | /// The derivative of the softmax nonlinearity. | ||||
| /// </summary> | /// </summary> | ||||
| @@ -284,6 +284,18 @@ namespace Tensorflow.Operations | |||||
| }); | }); | ||||
| return _op.outputs[0]; | return _op.outputs[0]; | ||||
| } | |||||
| public static Tensor leaky_relu_grad(Tensor gradients, Tensor features, float alpha = 0.2f, string name = null) | |||||
| { | |||||
| var _op = _op_def_lib._apply_op_helper("LeakyReluGrad", name: name, args: new | |||||
| { | |||||
| gradients, | |||||
| features, | |||||
| alpha | |||||
| }); | |||||
| return _op.output; | |||||
| } | } | ||||
| public static Tensor softmax(Tensor logits, string name = null) | public static Tensor softmax(Tensor logits, string name = null) | ||||