Skip to content

Commit c719137

Browse files
re-activating layer-wise actf
1 parent f1989eb commit c719137

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
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.4
3+
Version: 0.6.8.5
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.4"
44+
__version__ = "0.6.8.5"
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/functionals/functional.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,18 @@ def Functional(
8383
if not all([isinstance(n, int) for n in hidden_layers]):
8484
raise TypeError("Enter a list of integers as the third input assigning layer widths, e.g. [10,10,10]. ")
8585
# prepare kernel initializers.
86-
activations, def_biasinit, def_kerinit = \
87-
prepare_default_activations_and_initializers(
88-
len(hidden_layers) * [activation] + [output_activation]
89-
)
86+
if isinstance(activation, list) and isinstance(activation[0], list):
87+
assert len(activation) == len(hidden_layers), \
88+
'to specify activation per layer, make sure len(activation)==len(hidden_layer).'
89+
activations, def_biasinit, def_kerinit = \
90+
prepare_default_activations_and_initializers(
91+
activation + [output_activation]
92+
)
93+
else:
94+
activations, def_biasinit, def_kerinit = \
95+
prepare_default_activations_and_initializers(
96+
len(hidden_layers) * [activation] + [output_activation]
97+
)
9098
if kernel_initializer is None:
9199
kernel_initializer = def_kerinit
92100
elif isinstance(kernel_initializer, (float, int)):

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.4',
18+
version='0.6.8.5',
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)