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

github.com/soumith/cudnn.torch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2014-09-28 23:31:53 +0400
committerSoumith Chintala <soumith@gmail.com>2014-09-28 23:55:38 +0400
commit91793f499ab03a2d89cfa0148711e4ce02ab31ba (patch)
tree311aeb793a448dc87b67f6e1dd1d95ec75b4305a /ffi.lua
parent2f8a13181e33e05261077c8108e39edc18bf0f3e (diff)
adding SoftMax and SpatialSoftMax bindings
Diffstat (limited to 'ffi.lua')
-rw-r--r--ffi.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/ffi.lua b/ffi.lua
index 98b873d..8a68ac6 100644
--- a/ffi.lua
+++ b/ffi.lua
@@ -206,6 +206,39 @@ cudnnStatus_t cudnnActivationBackward( cudnnHandle_t handle,
void *destDiffData
);
+
+typedef enum
+{
+ CUDNN_SOFTMAX_FAST = 0, CUDNN_SOFTMAX_ACCURATE = 1
+} cudnnSoftmaxAlgorithm_t;
+
+typedef enum
+{
+ CUDNN_SOFTMAX_MODE_INSTANCE = 0, CUDNN_SOFTMAX_MODE_CHANNEL = 1
+} cudnnSoftmaxMode_t;
+
+
+cudnnStatus_t cudnnSoftmaxForward( cudnnHandle_t handle,
+ cudnnSoftmaxAlgorithm_t algorithm,
+ cudnnSoftmaxMode_t mode,
+ cudnnTensor4dDescriptor_t srcDesc,
+ const void *srcData,
+ cudnnTensor4dDescriptor_t destDesc,
+ void *destData
+ );
+
+cudnnStatus_t cudnnSoftmaxBackward( cudnnHandle_t handle,
+ cudnnSoftmaxAlgorithm_t algorithm,
+ cudnnSoftmaxMode_t mode,
+ cudnnTensor4dDescriptor_t srcDesc,
+ const void *srcData,
+ cudnnTensor4dDescriptor_t srcDiffDesc,
+ const void *srcDiffData,
+ cudnnTensor4dDescriptor_t destDiffDesc,
+ void *destDiffData
+ );
+
+
]]
local ok