diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index afdda8d..96633e4 100644 --- a/.github/workflows/build-and-run-tests.yml +++ b/.github/workflows/build-and-run-tests.yml @@ -7,7 +7,7 @@ jobs: build: strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/run-examples.yml b/.github/workflows/run-examples.yml index aa209d4..ddf06b6 100644 --- a/.github/workflows/run-examples.yml +++ b/.github/workflows/run-examples.yml @@ -7,7 +7,7 @@ jobs: build: strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: diff --git a/examples/modeling/arad.py b/examples/modeling/arad.py index 846975f..f15d2e4 100644 --- a/examples/modeling/arad.py +++ b/examples/modeling/arad.py @@ -14,7 +14,7 @@ # Config rng = np.random.default_rng(42) OOD_QUANTILE = 0.99 -VERBOSE = True +VERBOSE = False # Some of the following parameters are set low because this example runs on GitHub Actions and # we don't want it taking a bunch of time. # When running this locally, change the values per their corresponding comment, otherwise @@ -54,7 +54,7 @@ arad.predict(gross_train_ss) ood_threshold = np.quantile(gross_train_ss.info.recon_error, OOD_QUANTILE) - reconstructions = arad.predict(test_ss, verbose=True) + reconstructions = arad.predict(test_ss, verbose=VERBOSE) ood = test_ss.info.recon_error.values > ood_threshold false_positive_rate = ood.mean() mean_recon_error = test_ss.info.recon_error.values.mean() diff --git a/examples/modeling/arad_latent_prediction.py b/examples/modeling/arad_latent_prediction.py index 8d9d900..9b23395 100644 --- a/examples/modeling/arad_latent_prediction.py +++ b/examples/modeling/arad_latent_prediction.py @@ -15,7 +15,7 @@ # Config rng = np.random.default_rng(42) -VERBOSE = True +VERBOSE = False # Some of the following parameters are set low because this example runs on GitHub Actions and # we don't want it taking a bunch of time. # When running this locally, change the values per their corresponding comment, otherwise diff --git a/examples/modeling/classifier_comparison.py b/examples/modeling/classifier_comparison.py index 1a872c7..4fce43e 100644 --- a/examples/modeling/classifier_comparison.py +++ b/examples/modeling/classifier_comparison.py @@ -37,7 +37,7 @@ train_fg_ss.normalize() model_nn = MLPClassifier() -model_nn.fit(train_fg_ss, epochs=10, patience=5, verbose=1) +model_nn.fit(train_fg_ss, epochs=10, patience=5) # Create PB model model_pb = PoissonBayesClassifier() diff --git a/examples/modeling/label_proportion_estimation.py b/examples/modeling/label_proportion_estimation.py index 8f3a4ef..b4e5e4c 100644 --- a/examples/modeling/label_proportion_estimation.py +++ b/examples/modeling/label_proportion_estimation.py @@ -55,7 +55,6 @@ batch_size=10, epochs=2, validation_split=0.2, - verbose=True, bg_cps=300 ) diff --git a/examples/modeling/neural_network_classifier.py b/examples/modeling/neural_network_classifier.py index 8ab7d55..277a2dc 100644 --- a/examples/modeling/neural_network_classifier.py +++ b/examples/modeling/neural_network_classifier.py @@ -24,7 +24,7 @@ train_ss.normalize() model = MLPClassifier() -model.fit(train_ss, epochs=10, patience=5, verbose=1) +model.fit(train_ss, epochs=10, patience=5) # Generate some test data static_synth.samples_per_seed = 50 diff --git a/pyproject.toml b/pyproject.toml index 8834eb5..c20c480 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,8 @@ dependencies = [ "seaborn ==0.13.*", # >= 3.8 "tensorflow ==2.16.*", # 3.9 - 3.12 "tensorflow-model-optimization ==0.8.*", # 3.7 - 3.12 - "tf2onnx ==1.16.*", # 3.7 - 3.10 + "onnx ==1.16.1", # 3.7 - 3.10 + "tf2onnx ==1.16.1", # 3.7 - 3.10 "tqdm ==4.66.*", # >= 3.7 "typeguard ==4.3.*", # 3.9 - 3.12 ] diff --git a/riid/models/neural_nets/__init__.py b/riid/models/neural_nets/__init__.py index daa88c4..42443f8 100644 --- a/riid/models/neural_nets/__init__.py +++ b/riid/models/neural_nets/__init__.py @@ -592,7 +592,7 @@ def fit(self, seeds_ss: SampleSet, ss: SampleSet, bg_cps: int = 300, is_gross: b if verbose: print("Finding OOD detection threshold function...") - train_logits = self.model.predict(spectra) + train_logits = self.model.predict(spectra, verbose=0) train_lpes = self.activation(tf.convert_to_tensor(train_logits, dtype=tf.float32)) self.spline_recon_errors = reconstruction_error( tf.convert_to_tensor(spectra, dtype=tf.float32),