Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonghoon Jin <jhjin0@gmail.com>2015-10-01 00:06:22 +0300
committerJonghoon Jin <jhjin0@gmail.com>2015-10-05 21:29:40 +0300
commit7e4a9fa348b8a65f28e3b20415b3c7286d1d90e4 (patch)
tree52d108f406a8cb9407fc7dc184ec8b7bb34fc15f /Clamp.lua
parentbcea7ce973898ec2b46a9ea0d52504aeabd48e5a (diff)
Use custom range in HardTanh and mask it as Clamp
allows HardTanh to use a custom interval for linear region when min/max values are specified in declaration. Thus its implementation can be shared with new Clamp function.
Diffstat (limited to 'Clamp.lua')
-rw-r--r--Clamp.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/Clamp.lua b/Clamp.lua
new file mode 100644
index 0000000..36397a1
--- /dev/null
+++ b/Clamp.lua
@@ -0,0 +1,5 @@
+local Clamp, Parent = torch.class('nn.Clamp', 'nn.HardTanh')
+
+function Clamp:__init(min_value, max_value)
+ Parent.__init(self, min_value, max_value)
+end