Skip to content

Commit 72e207e

Browse files
adding atan2
1 parent c719137 commit 72e207e

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

SciANN.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: SciANN
3-
Version: 0.6.8.5
3+
Version: 0.6.8.6
44
Summary: A Keras/Tensorflow wrapper for scientific computations and physics-informed deep learning using artificial neural networks.
55
Home-page: https://github.com/sciann/sciann
66
Author: Ehsan Haghighat

sciann/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
__credits__ = []
4242
__url__ = "http://github.com/sciann/sciann]"
4343
__license__ = "MIT"
44-
__version__ = "0.6.8.5"
44+
__version__ = "0.6.8.6"
4545
__cite__ = \
4646
'@article{haghighat2021sciann, \n' +\
4747
' title={SciANN: A Keras/TensorFlow wrapper for scientific computations and physics-informed deep learning using artificial neural networks}, \n' +\

sciann/utils/math.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,16 +602,37 @@ def atan(x):
602602
return _apply_function(x, 'atan')
603603

604604

605-
def atan2(x):
606-
"""Computes atan2 of x element-wise.
605+
def atan2(y, x):
606+
"""Computes atan2 of y, x pair, element-wise.
607607
608608
# Arguments
609+
y: Functional object.
609610
x: Functional object.
610611
611612
# Returns
612613
A new functional object.
613614
"""
614-
return _apply_function(x, 'atan2')
615+
validate_functional(x)
616+
validate_functional(y)
617+
618+
fun = get_activation('atan2')
619+
lmbd, outputs = [], []
620+
for i in range(len(x.outputs)):
621+
lmbd.append(
622+
Lambda(
623+
lambda xs: fun(xs[0], xs[1]),
624+
name=graph_unique_name("{}".format('atan2'))
625+
)
626+
)
627+
outputs += [lmbd[-1]([yi, xi]) for yi, xi in zip(y.outputs, x.outputs)]
628+
Functional = x.get_class()
629+
inputs = y.inputs.copy() + x.inputs.copy()
630+
res = Functional(
631+
inputs = unique_tensors(inputs),
632+
outputs = outputs,
633+
layers = lmbd
634+
)
635+
return res
615636

616637

617638
def cot(x):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
setup(
1717
name='SciANN',
18-
version='0.6.8.5',
18+
version='0.6.8.6',
1919
description='A Keras/Tensorflow wrapper for scientific computations and physics-informed deep learning using artificial neural networks.',
2020
long_description=long_description,
2121
author='Ehsan Haghighat',

0 commit comments

Comments
 (0)