Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance may be degraded by the initialization scheme #90

Open
miranska opened this issue Jan 4, 2024 · 1 comment
Open

Performance may be degraded by the initialization scheme #90

miranska opened this issue Jan 4, 2024 · 1 comment

Comments

@miranska
Copy link
Contributor

miranska commented Jan 4, 2024

System information

  • OS Platform and Distribution: MacOS 14.2.1
  • Python version: 3.11.7
  • DeepTables version: 0.2.6
  • Other Python packages(run pip list):
Package                      Version                                                                                                                                                                                                                                                                                                                                                        
---------------------------- ------------
absl-py                      2.0.0
asttokens                    2.4.1
astunparse                   1.6.3
attrs                        23.2.0
bcrypt                       4.1.2
cachetools                   5.3.2
category-encoders            2.6.3
certifi                      2023.11.17
cffi                         1.16.0
charset-normalizer           3.3.2
cryptography                 41.0.7
decorator                    5.1.1
deeptables                   0.2.6
eli5                         0.13.0
executing                    2.0.1
flatbuffers                  23.5.26
fsspec                       2023.12.2
gast                         0.5.4
google-auth                  2.26.1
google-auth-oauthlib         1.2.0
google-pasta                 0.2.0
graphviz                     0.20.1
grpcio                       1.60.0
h5py                         3.10.0
hypernets                    0.3.1
idna                         3.6
ipython                      8.19.0
jedi                         0.19.1
Jinja2                       3.1.2
joblib                       1.3.2
keras                        2.15.0
libclang                     16.0.6
lightgbm                     4.2.0
Markdown                     3.5.1
MarkupSafe                   2.1.3
matplotlib-inline            0.1.6
ml-dtypes                    0.2.0
numpy                        1.26.3
oauthlib                     3.2.2
opt-einsum                   3.3.0
packaging                    23.2
pandas                       2.1.4
paramiko                     3.4.0
parso                        0.8.3
patsy                        0.5.6
pexpect                      4.9.0
pip                          23.3.2
prettytable                  3.9.0
prompt-toolkit               3.0.43
protobuf                     4.23.4
psutil                       5.9.7
ptyprocess                   0.7.0
pure-eval                    0.2.2
pyasn1                       0.5.1
pyasn1-modules               0.3.0
pycparser                    2.21
Pygments                     2.17.2
PyNaCl                       1.5.0
python-dateutil              2.8.2
pytz                         2023.3.post1
PyYAML                       6.0.1
requests                     2.31.0
requests-oauthlib            1.3.1
rsa                          4.9
scikit-learn                 1.3.2
scipy                        1.11.4
setuptools                   69.0.3
six                          1.16.0
stack-data                   0.6.3
statsmodels                  0.14.1
tabulate                     0.9.0
tensorboard                  2.15.1
tensorboard-data-server      0.7.2
tensorflow                   2.15.0
tensorflow-estimator         2.15.0
tensorflow-io-gcs-filesystem 0.34.0
tensorflow-macos             2.15.0
termcolor                    2.4.0
threadpoolctl                3.2.0
tornado                      6.4
tqdm                         4.66.1
traitlets                    5.14.1
typing_extensions            4.9.0
tzdata                       2023.4
urllib3                      2.1.0
wcwidth                      0.2.12
Werkzeug                     3.0.1
wheel                        0.42.0
wrapt                        1.14.1
XlsxWriter                   3.1.9

Describe the current behavior

I run sample classification code from the documentation:

During execution, I see the following message in the logs:

01-04 14:38:13 I deeptables.m.deepmodel.py 231 - Building model...
./miniforge3/envs/sample_deeptable/lib/python3.11/site-packages/keras/src/initializers/initializers.py:120: UserWarning: The initializer RandomUniform is unseeded and being called multiple times, which will return identical values each time (even if the initializer is unseeded). Please update your code to provide a seed to the initializer, or avoid using the same initializer instance more than once.

Describe the expected behavior

There seems to be a need to modify the initialization schema of the WideDeep layer to improve performance and eliminate the warning.

Standalone code to reproduce the issue

# sample code from https://deeptables.readthedocs.io/en/latest/examples.html
from deeptables.models.deeptable import DeepTable, ModelConfig
from deeptables.models.deepnets import WideDeep
from deeptables.datasets import dsutils
from sklearn.model_selection import train_test_split

# Adult Data Set from UCI Machine Learning Repository: https://archive.ics.uci.edu/ml/datasets/Adult
df_train = dsutils.load_adult()
y = df_train.pop(14)
X = df_train

conf = ModelConfig(nets=WideDeep, metrics=["AUC", "accuracy"], auto_discrete=True)
dt = DeepTable(config=conf)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

model, history = dt.fit(X_train, y_train, epochs=100)
@oaksharks
Copy link
Collaborator

oaksharks commented Jul 19, 2024

This warning seems to have appeared in high versions of TensorFlow, at this stage, versions below <=2.9 can be used to avoid it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants