[python-arrayfire] 129/250: FEAT: Adding sigmoid function
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:40 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/master
in repository python-arrayfire.
commit 718f1cc7de4028eb8f14ac42fb3a5eacda246c6d
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Tue Nov 10 08:24:08 2015 -0500
FEAT: Adding sigmoid function
---
arrayfire/arith.py | 20 ++++++++++++++++++++
tests/simple/arith.py | 1 +
2 files changed, 21 insertions(+)
diff --git a/arrayfire/arith.py b/arrayfire/arith.py
index cb88644..9dc8c66 100644
--- a/arrayfire/arith.py
+++ b/arrayfire/arith.py
@@ -698,6 +698,26 @@ def pow2(a):
"""
return _arith_unary_func(a, backend.get().af_pow2)
+def sigmoid(a):
+ """
+ Raise 2 to the power of each element in input.
+
+ Parameters
+ ----------
+ a : af.Array
+ Multi dimensional arrayfire array.
+
+ Returns
+ --------
+ out : af.Array
+ array where each element is outout of a sigmoid function for the corresponding value from `a`.
+
+ Note
+ -------
+ `a` must not be complex.
+ """
+ return _arith_unary_func(a, backend.get().af_sigmoid)
+
def exp(a):
"""
Exponential of each element in the array.
diff --git a/tests/simple/arith.py b/tests/simple/arith.py
index d70bad1..e55881e 100644
--- a/tests/simple/arith.py
+++ b/tests/simple/arith.py
@@ -173,6 +173,7 @@ def simple_arith(verbose = False):
display_func(af.root(a, b))
display_func(af.pow(a, b))
display_func(af.pow2(a))
+ display_func(af.sigmoid(a))
display_func(af.exp(a))
display_func(af.expm1(a))
display_func(af.erf(a))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-arrayfire.git
More information about the debian-science-commits
mailing list