Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#44)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.12.0 → 23.3.0](psf/black@22.12.0...23.3.0)
- [github.com/asottile/pyupgrade: v3.3.1 → v3.4.0](asottile/pyupgrade@v3.3.1...v3.4.0)
- [github.com/asottile/setup-cfg-fmt: v2.2.0 → v2.3.0](asottile/setup-cfg-fmt@v2.2.0...v2.3.0)
- [github.com/pycqa/flake8: 5.0.4 → 6.0.0](PyCQA/flake8@5.0.4...6.0.0)

* [pre-commit.ci] auto fixes from pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jun 10, 2023
1 parent acad80b commit b21bb91
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: .*\.rpt$

repos:
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.3.0
hooks:
- id: black-jupyter
language_version: python3
Expand Down Expand Up @@ -30,18 +30,18 @@ repos:
args: ["--profile", "black", --line-length=125]

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.4.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
rev: v2.3.0
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
exclude: docs/conf.py
Expand Down
1 change: 0 additions & 1 deletion callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class all_callbacks:
def __init__(
self, stop_patience=10, lr_factor=0.5, lr_patience=1, lr_epsilon=0.001, lr_cooldown=4, lr_minimum=1e-5, outputDir=''
):

self.nl_begin = newline_callbacks_begin(outputDir)
self.nl_end = newline_callbacks_end()

Expand Down
4 changes: 1 addition & 3 deletions part6_cnns.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
"NSTEPS = int(train_size * 0.9) // batch_size # 90% train, 10% validation in 10-fold cross validation\n",
"print('Number of training steps per epoch is {}'.format(NSTEPS))\n",
"\n",
"\n",
"# Prune all convolutional and dense layers gradually from 0 to 50% sparsity every 2 epochs,\n",
"# ending by the 10th epoch\n",
"def pruneFunction(layer):\n",
Expand Down Expand Up @@ -287,7 +288,6 @@
"n_epochs = 30\n",
"\n",
"if train:\n",
"\n",
" LOSS = tf.keras.losses.CategoricalCrossentropy()\n",
" OPTIMIZER = tf.keras.optimizers.Adam(learning_rate=3e-3, beta_1=0.9, beta_2=0.999, epsilon=1e-07, amsgrad=True)\n",
"\n",
Expand Down Expand Up @@ -579,7 +579,6 @@
"outputs": [],
"source": [
"def doWeights(model):\n",
"\n",
" allWeightsByLayer = {}\n",
" for layer in model.layers:\n",
" if (layer._name).find(\"batch\") != -1 or len(layer.get_weights()) < 1:\n",
Expand Down Expand Up @@ -862,7 +861,6 @@
"\n",
"\n",
"def plotROC(Y, y_pred, y_pred_hls4ml, label=\"Model\"):\n",
"\n",
" accuracy_keras = float(accuracy_score(np.argmax(Y, axis=1), np.argmax(y_pred, axis=1)))\n",
" accuracy_hls4ml = float(accuracy_score(np.argmax(Y, axis=1), np.argmax(y_pred_hls4ml, axis=1)))\n",
"\n",
Expand Down
2 changes: 0 additions & 2 deletions plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def plotRoc(fpr, tpr, auc, labels, linestyle, legend=True):


def rocData(y, predict_test, labels):

df = pd.DataFrame()

fpr = {}
Expand All @@ -72,7 +71,6 @@ def rocData(y, predict_test, labels):


def makeRoc(y, predict_test, labels, linestyle='-', legend=True):

if 'j_index' in labels:
labels.remove('j_index')

Expand Down

0 comments on commit b21bb91

Please sign in to comment.