From 2f085e10cc5d523c5ce728b2d40bc0afcf15488e Mon Sep 17 00:00:00 2001 From: Georg Date: Tue, 23 Apr 2024 22:29:36 -0400 Subject: [PATCH] update tensorflow and fix unit tests --- pypress/tests/test_layers.py | 6 ++++-- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pypress/tests/test_layers.py b/pypress/tests/test_layers.py index aacb74d..b1665dd 100644 --- a/pypress/tests/test_layers.py +++ b/pypress/tests/test_layers.py @@ -48,7 +48,8 @@ def test_use_in_model_works(): feats, y = _test_data(n_samples=1000) model = tf.keras.Sequential() - model.add(layers.PredictiveStateSimplex(5, input_dim=feats.shape[1])) + model.add(tf.keras.layers.Input(shape=(feats.shape[1],))) + model.add(layers.PredictiveStateSimplex(5)) model.add(layers.PredictiveStateMeans(1, "linear")) model.compile(loss="mse", optimizer=tf.keras.optimizers.Nadam(learning_rate=0.01)) @@ -65,7 +66,8 @@ def test_press_in_model_works(): feats, y = _test_data(n_samples=1000) model = tf.keras.Sequential() - model.add(layers.PRESS(units=1, n_states=5, input_dim=feats.shape[1])) + model.add(tf.keras.layers.Input(shape=(feats.shape[1],))) + model.add(layers.PRESS(units=1, n_states=5)) model.compile(loss="mse", optimizer=tf.keras.optimizers.Nadam(learning_rate=0.01)) model.fit(feats, y, epochs=4) diff --git a/requirements.txt b/requirements.txt index 88efef3..1b12273 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -tensorflow~=2.11.0 +tensorflow>=2.11.0 numpy>=1.11.5 pandas>=1.0.0 diff --git a/setup.py b/setup.py index c39acbb..137b6d4 100644 --- a/setup.py +++ b/setup.py @@ -8,5 +8,5 @@ author_email="im@gmge.org", description="Predictive State Smoothing (PRESS) in Python (keras)", packages=find_packages(), - install_requires=["numpy >= 1.11.0", "tensorflow ~= 2.11.0", "pandas >= 1.0.0"], + install_requires=["numpy >= 1.11.0", "tensorflow >= 2.11.0", "pandas >= 1.0.0"], )