diff options
author | Cao Zongyan <zongyan.cao@alibaba-inc.com> | 2018-08-16 19:04:37 +0800 |
---|---|---|
committer | Cao Zongyan <zongyan.cao@alibaba-inc.com> | 2018-08-16 22:04:45 +0800 |
commit | aa25cc078c9b55e5ca3e0f59df43e169bfee8f3c (patch) | |
tree | 7348b2db46ab464be34cc385d2509f7260727bbd /tensorflow/core/ops/ops.pbtxt | |
parent | 938b9a40787028c58fb548fa6ada8c0dd8180f35 (diff) |
Add LeakyRelu C++ Op and its gradient implementation.
LeakyRelu, defined as 'y = { x (x>=0) or alpha*x (x<0) }', was computed
by combined Ops 'max(x, alpha*x)' in current codes. Hence its gradient
calculation for back propagation would contain a serial of element-wise
Ops. This looks really unnecessary for such a simple op and it could be
done within just one Op with less memory accesses.
Diffstat (limited to 'tensorflow/core/ops/ops.pbtxt')
-rw-r--r-- | tensorflow/core/ops/ops.pbtxt | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/tensorflow/core/ops/ops.pbtxt b/tensorflow/core/ops/ops.pbtxt index f2595279e0..837e91bc23 100644 --- a/tensorflow/core/ops/ops.pbtxt +++ b/tensorflow/core/ops/ops.pbtxt @@ -13605,6 +13605,74 @@ op { } } op { + name: "LeakyRelu" + input_arg { + name: "features" + type_attr: "T" + } + output_arg { + name: "activations" + type_attr: "T" + } + attr { + name: "alpha" + type: "float" + default_value { + f: 0.2 + } + } + attr { + name: "T" + type: "type" + default_value { + type: DT_FLOAT + } + allowed_values { + list { + type: DT_HALF + type: DT_FLOAT + type: DT_DOUBLE + } + } + } +} +op { + name: "LeakykReluGrad" + input_arg { + name: "gradients" + type_attr: "T" + } + input_arg { + name: "features" + type_attr: "T" + } + output_arg { + name: "backprops" + type_attr: "T" + } + attr { + name: "alpha" + type: "float" + default_value { + f: 0.2 + } + } + attr { + name: "T" + type: "type" + default_value { + type: DT_FLOAT + } + allowed_values { + list { + type: DT_HALF + type: DT_FLOAT + type: DT_DOUBLE + } + } + } +} +op { name: "LearnedUnigramCandidateSampler" input_arg { name: "true_classes" |