Skip to content

Commit d4767d0

Browse files
sciann-v0.7.0.0
1 parent 72e207e commit d4767d0

File tree

7 files changed

+42
-11
lines changed

7 files changed

+42
-11
lines changed

SciANN.egg-info/PKG-INFO

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
Metadata-Version: 2.1
22
Name: SciANN
3-
Version: 0.6.8.6
3+
Version: 0.7.0.0
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
77
Author-email: [email protected]
88
License: MIT
9-
Platform: UNKNOWN
109
Classifier: Development Status :: 4 - Beta
1110
Classifier: Intended Audience :: Developers
1211
Classifier: Intended Audience :: Education
@@ -30,5 +29,3 @@ Read the documentation at: https://sciann.com
3029

3130
SciANN is compatible with Python 2.7-3.6
3231
and is distributed under the MIT license.
33-
34-

SciANN.egg-info/SOURCES.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ docs/theme/css/theme_extra.css
6969
docs/theme/js/jquery-2.1.1.min.js
7070
docs/theme/js/modernizr-2.8.3.min.js
7171
docs/theme/js/theme.js
72-
examples/.DS_Store
7372
examples/example-fitting-1d-lstm.py
7473
examples/example-fitting-1d-rnn.py
7574
examples/example-fitting-1d.py

SciANN.egg-info/requires.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ scipy
33
six
44
pyyaml
55
h5py
6-
sklearn
6+
scikit-learn
77
pybtex
8-
tensorflow<=2.9.5,>=2.6.0
98

109
[tests]
1110
pytest

install_sciann_macos_arm.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
export ENV_NAME=tf29
3+
export TF_VER=2.9.0
4+
export PY_VER=3.9
5+
6+
# source ~/.miniconda_zshrc
7+
8+
conda create -n $ENV_NAME python=$PY_VER -y
9+
conda activate $ENV_NAME
10+
conda install -c apple tensorflow-deps=$TF_VER -y
11+
pip install tensorflow-macos==$TF_VER
12+
13+
# pip install tensorflow-metal
14+
15+
conda install -c conda-forge -y pandas jupyterlab scipy scikit-learn matplotlib
16+
pip install plotly
17+
pip install -e .
18+
19+
cd examples
20+
python example-fitting-1d.py

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.6"
44+
__version__ = "0.7.0.0"
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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
from __future__ import division
66
from __future__ import print_function
77

8+
import time
89
from keras import backend as K
910
graph_unique_name = K.get_graph().unique_name
1011

1112
from keras.layers import Dense
1213
from keras.layers import Activation
14+
from keras.layers import Dropout
1315
from keras.layers import Concatenate
1416
from keras.layers import Lambda
1517
# from keras.layers import BatchNormalization
@@ -46,6 +48,9 @@
4648
Last layer will have a linear output.
4749
output_activation: defaulted to "linear".
4850
Activation function to be applied to the network output.
51+
dropout_rate: Float.
52+
Dropout rate for the hidden layers. Active only if > 0.
53+
NOTE: Do not use dropout for PINNs.
4954
res_net: (True, False). Constructs a resnet architecture.
5055
Defaulted to False.
5156
kernel_initializer: Initializer of the `Kernel`, from `k.initializers`.
@@ -68,6 +73,7 @@ def Functional(
6873
hidden_layers=None,
6974
activation="tanh",
7075
output_activation="linear",
76+
dropout_rate=0.,
7177
res_net=False,
7278
kernel_initializer=None,
7379
bias_initializer=None,
@@ -116,6 +122,11 @@ def Functional(
116122
)
117123
else:
118124
bias_initializer = [bias_initializer for l in len(hidden_layers) * [activation] + [output_activation]]
125+
# check dropout rate.
126+
if dropout_rate > 0.0:
127+
print("\n NOTE: Dropout layer does not work with PINN setup!!! \n ")
128+
time.sleep(1)
129+
119130
# prepare regularizers.
120131
kernel_regularizer = default_regularizer(kernel_regularizer)
121132
bias_regularizer = default_regularizer(bias_regularizer)
@@ -222,6 +233,11 @@ def Functional(
222233
if res_net is True:
223234
layer = Lambda(lambda xs: (1-xs[0])*xs[1] + xs[0]*xs[2], name=graph_unique_name("ResLayer"))
224235
net[-1] = layer([net[-1]] + res_outputs[:2])
236+
# adding dropout at the end of each layer.
237+
if dropout_rate > 0.0:
238+
layer = Dropout(dropout_rate, name=graph_unique_name("Dropout"))
239+
layers.append(layer)
240+
net[-1] = layer(net[-1])
225241

226242
# Assign to the output variable
227243
if len(net) == 1:

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
setup(
1717
name='SciANN',
18-
version='0.6.8.6',
18+
version='0.7.0.0',
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',
@@ -27,9 +27,9 @@
2727
'six',
2828
'pyyaml',
2929
'h5py',
30-
'sklearn',
30+
'scikit-learn',
3131
'pybtex',
32-
'tensorflow>=2.6.0,<=2.9.5',
32+
#'tensorflow>=2.6.0,<=2.9.5',
3333
],
3434
extras_require={
3535
'visualize': ['pydot>=1.2.4', 'matplotlib'],

0 commit comments

Comments
 (0)