Skip to content

Commit

Permalink
Fixes for Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
tymorrow committed Aug 15, 2024
1 parent 9591c0d commit 504fe33
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions examples/modeling/arad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion examples/modeling/arad_latent_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/modeling/classifier_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion examples/modeling/label_proportion_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
batch_size=10,
epochs=2,
validation_split=0.2,
verbose=True,
bg_cps=300
)

Expand Down
2 changes: 1 addition & 1 deletion examples/modeling/neural_network_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down
2 changes: 1 addition & 1 deletion riid/models/neural_nets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 504fe33

Please sign in to comment.