Skip to content

Commit eb19601

Browse files
committed
docs: unified nitebooks and checked execution
1 parent e10f2f4 commit eb19601

24 files changed

+6348
-5658
lines changed

docs/notebooks/tensorflow/demo_ash_tf.ipynb

+573-409
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_dknn_tf.ipynb

+553-509
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_energy_tf.ipynb

+549-505
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_entropy_tf.ipynb

+549-502
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_gen_tf.ipynb

+557-520
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_gram_tf.ipynb

+689-621
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_mahalanobis_tf.ipynb

+550-506
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_mls_msp_tf.ipynb

+709-649
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_odin_tf.ipynb

+727-501
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_react_tf.ipynb

+676-536
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_rmds_tf.ipynb

+7-10
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
},
2929
{
3030
"cell_type": "code",
31-
"execution_count": 1,
31+
"execution_count": null,
3232
"metadata": {},
3333
"outputs": [],
3434
"source": [
3535
"%load_ext autoreload\n",
3636
"\n",
3737
"import os\n",
38+
"\n",
3839
"os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"2\"\n",
3940
"\n",
4041
"from IPython.display import clear_output\n",
@@ -101,7 +102,7 @@
101102
},
102103
{
103104
"cell_type": "code",
104-
"execution_count": 3,
105+
"execution_count": null,
105106
"metadata": {},
106107
"outputs": [],
107108
"source": [
@@ -121,9 +122,6 @@
121122
"ds_train, _ = data_handler.split_by_class(ds_train, in_labels)\n",
122123
"ds_in, ds_out = data_handler.split_by_class(data_test, in_labels)\n",
123124
"\n",
124-
"feature_names = data_handler.get_ds_feature_keys(ds_in)\n",
125-
"print(feature_names) # we have to remove \"id\" from the dataset\n",
126-
"\n",
127125
"\n",
128126
"# 3- Prepare data (preprocess, shuffle, batch)\n",
129127
"def preprocess_fn(inputs):\n",
@@ -308,7 +306,7 @@
308306
},
309307
{
310308
"cell_type": "code",
311-
"execution_count": 7,
309+
"execution_count": null,
312310
"metadata": {},
313311
"outputs": [],
314312
"source": [
@@ -324,9 +322,6 @@
324322
"# 1b- Load out-of-distribution dataset: SVHN\n",
325323
"ds_out = data_handler.load_dataset(\"svhn_cropped\", load_kwargs={\"split\": \"test\"})\n",
326324
"\n",
327-
"feature_names = data_handler.get_ds_feature_keys(ds_in)\n",
328-
"print(feature_names) # we have to remove \"id\" from the dataset\n",
329-
"\n",
330325
"\n",
331326
"# 2- prepare data (preprocess, shuffle, batch)\n",
332327
"def preprocess_fn(inputs):\n",
@@ -342,7 +337,9 @@
342337
")\n",
343338
"ds_out = data_handler.prepare(\n",
344339
" ds_out, batch_size, preprocess_fn, columns=[\"image\", \"label\"]\n",
345-
")"
340+
")\n",
341+
"\n",
342+
"clear_output()"
346343
]
347344
},
348345
{

docs/notebooks/tensorflow/demo_scale_tf.ipynb

+12-49
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_she_tf.ipynb

+46-55
Large diffs are not rendered by default.

docs/notebooks/tensorflow/demo_vim_tf.ipynb

+7-10
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@
3333
},
3434
{
3535
"cell_type": "code",
36-
"execution_count": 1,
36+
"execution_count": null,
3737
"metadata": {},
3838
"outputs": [],
3939
"source": [
4040
"%load_ext autoreload\n",
4141
"%autoreload 2\n",
4242
"\n",
4343
"import os\n",
44+
"\n",
4445
"os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"2\"\n",
4546
"\n",
4647
"from IPython.display import clear_output\n",
@@ -107,7 +108,7 @@
107108
},
108109
{
109110
"cell_type": "code",
110-
"execution_count": 7,
111+
"execution_count": null,
111112
"metadata": {},
112113
"outputs": [],
113114
"source": [
@@ -127,9 +128,6 @@
127128
"ds_train, _ = data_handler.split_by_class(ds_train, in_labels)\n",
128129
"ds_in, ds_out = data_handler.split_by_class(data_test, in_labels)\n",
129130
"\n",
130-
"feature_names = data_handler.get_ds_feature_keys(ds_in)\n",
131-
"print(feature_names) # we have to remove \"id\" from the dataset\n",
132-
"\n",
133131
"\n",
134132
"# 3- Prepare data (preprocess, shuffle, batch)\n",
135133
"def preprocess_fn(inputs):\n",
@@ -315,7 +313,7 @@
315313
},
316314
{
317315
"cell_type": "code",
318-
"execution_count": 11,
316+
"execution_count": null,
319317
"metadata": {},
320318
"outputs": [],
321319
"source": [
@@ -331,9 +329,6 @@
331329
"# 1b- Load out-of-distribution dataset: SVHN\n",
332330
"ds_out = data_handler.load_dataset(\"svhn_cropped\", load_kwargs={\"split\": \"test\"})\n",
333331
"\n",
334-
"feature_names = data_handler.get_ds_feature_keys(ds_in)\n",
335-
"print(feature_names) # we have to remove \"id\" from the dataset\n",
336-
"\n",
337332
"\n",
338333
"# 2- prepare data (preprocess, shuffle, batch)\n",
339334
"def preprocess_fn(inputs):\n",
@@ -349,7 +344,9 @@
349344
")\n",
350345
"ds_out = data_handler.prepare(\n",
351346
" ds_out, batch_size, preprocess_fn, columns=[\"image\", \"label\"]\n",
352-
")"
347+
")\n",
348+
"\n",
349+
"clear_output()"
353350
]
354351
},
355352
{

docs/notebooks/torch/demo_dknn_torch.ipynb

+17-154
Large diffs are not rendered by default.

docs/notebooks/torch/demo_energy_torch.ipynb

+8-17
Large diffs are not rendered by default.

docs/notebooks/torch/demo_gen_torch.ipynb

+7-3
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,18 @@
4242
},
4343
{
4444
"cell_type": "code",
45-
"execution_count": 1,
45+
"execution_count": null,
4646
"metadata": {},
4747
"outputs": [],
4848
"source": [
4949
"%load_ext autoreload\n",
5050
"%autoreload 2\n",
5151
"\n",
5252
"import warnings\n",
53+
"\n",
5354
"warnings.filterwarnings(\"ignore\")\n",
5455
"import os\n",
56+
"\n",
5557
"os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"2\"\n",
5658
"\n",
5759
"from IPython.display import clear_output\n",
@@ -119,7 +121,7 @@
119121
},
120122
{
121123
"cell_type": "code",
122-
"execution_count": 3,
124+
"execution_count": null,
123125
"metadata": {},
124126
"outputs": [],
125127
"source": [
@@ -158,7 +160,9 @@
158160
")\n",
159161
"ds_out = data_handler.prepare(\n",
160162
" ds_out, batch_size, preprocess_fn, columns=[\"input\", \"label\"]\n",
161-
")"
163+
")\n",
164+
"\n",
165+
"clear_output()"
162166
]
163167
},
164168
{

0 commit comments

Comments
 (0)