Skip to content

Commit 6dfb427

Browse files
Merge pull request #172 from david-thrower/171-upgrade-tf-2190
171 upgrade tf 2190
2 parents 39e3710 + 1de46fc commit 6dfb427

File tree

7 files changed

+375
-66
lines changed

7 files changed

+375
-66
lines changed

.github/workflows/automerge.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Python application
55

66
on:
77
push:
8-
branches: [ "main", "148-tensorflow-upgrades" ]
8+
branches: [ "main", "171-upgrade-tf-2190" ]
99

1010
permissions:
1111
contents: read
@@ -33,25 +33,16 @@ jobs:
3333
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3434
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3535
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36-
# - name: Test by running.
37-
# run: python3 cerebros.py
38-
# - name: Test distributed by running.
39-
# run: python3 test_simple_cerebros_gridsearch.py
40-
# - name: Test distributed random search wine by running.
41-
# run: python3 random_search.py
42-
# - name: Test CerebrosRealNeuronNetwork
43-
# run: python3 realnn-regression-example-ames-no-preproc.py
44-
# timeout-minutes: 45
4536
- name: Test distributed random search Ames by running
4637
run: python3 regression-example-ames-no-preproc.py
4738
- name: Test distributed random search Ames by running - Val set
4839
run: python3 regression-example-ames-no-preproc-val-set.py
49-
- name: Test text classifier - random search - ham-spam
50-
run: python3 text-class-ham-or-spam.py
51-
timeout-minutes: 90
52-
- name: Test image classifier - small subset of CIFAR10
40+
# - name: Test text classifier - random search - ham-spam
41+
# run: python3 text-class-ham-or-spam.py
42+
# timeout-minutes: 90
43+
- name: Test image classifier - small subset of CIFAR10 # add back
5344
timeout-minutes: 90
5445
run: python3 cifar10-example.py
5546
- name: Phishing email detection with GPT2 embedding
56-
timeout-minutes: 120
47+
timeout-minutes: 420
5748
run: python3 phishing_email_detection_gpt2.py

cerebros/neuralnetworkfuture/neural_network_future.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,10 @@ def compile_neural_network(self):
332332
self.materialized_neural_network.compile(
333333
loss=self.loss,
334334
metrics=self.metrics,
335-
optimizer=tf.keras.optimizers.Adam(
336-
learning_rate=self.learning_rate),
335+
optimizer=tf.keras.optimizers.AdamW(
336+
learning_rate=self.learning_rate,
337+
weight_decay=0.004 # Add weight decay parameter
338+
),
337339
jit_compile=jit_compile)
338340

339341
def util_parse_connectivity_csv(self):

cerebros/simplecerebrosrandomsearch/simple_cerebros_random_search.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import numpy as np
33
import pandas as pd
44
import tensorflow as tf
5+
from tqdm import tqdm
56
from cerebros.denseautomlstructuralcomponent.\
67
dense_automl_structural_component \
78
import DenseAutoMlStructuralComponent, DenseLateralConnectivity, \
@@ -519,7 +520,10 @@ def run_moity_permutations(self, spec, subtrial_number, lock):
519520

520521
def run_random_search(self):
521522
processes = []
522-
for i in np.arange(self.number_of_architecture_moities_to_try):
523+
for i in tqdm(np.arange(self.number_of_architecture_moities_to_try),
524+
desc="Global task progress",
525+
colour="#16ceeb"):
526+
523527
self.parse_neural_network_structural_spec_random()
524528
spec = self.get_neural_network_spec()
525529

cicd-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
matplotlib==3.8.4
2-
tensorflow-text==2.15.0
2+
tensorflow-text==2.19.0
33
keras-nlp==0.9.1
44
scikit-learn==1.4.1.post1
55
tensorflow-hub==0.16.1
6+
transformers==4.51.1

cifar10-example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def make_dataset(dataset):
8888

8989
last_relevant_layer = base_new.layers[-2]
9090
# last_relevant_layer_extracted = last_relevant_layer #.output[0][0][0]
91-
base_embedding = tf.keras.Model(inputs=base_new.layers[0].input,
92-
outputs=last_relevant_layer.output)
91+
base_embedding = tf.keras.Model(inputs=base_new.input,
92+
outputs=last_relevant_layer.output)
9393

9494

9595
image_input_0 = tf.keras.layers.Input(shape=INPUT_SHAPES[0])

0 commit comments

Comments
 (0)