Skip to content

Commit 4150f18

Browse files
committed
changed dataset
1 parent 8d5c2da commit 4150f18

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

lab3/solutions/Lab3_Bias_And_Uncertainty.ipynb

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@
1919
},
2020
{
2121
"cell_type": "code",
22-
"source": [
23-
"!git clone https://github.com/slolla/capsa-intro-deep-learning.git\n",
24-
"!cd capsa-intro-deep-learning/ && git checkout HistogramVAEWrapper\n"
25-
],
22+
"execution_count": 1,
2623
"metadata": {
27-
"id": "5Ll7uZ8q72hm",
28-
"outputId": "56b3117b-e344-481b-a9fc-2798b76d7a60",
2924
"colab": {
3025
"base_uri": "https://localhost:8080/"
31-
}
26+
},
27+
"id": "5Ll7uZ8q72hm",
28+
"outputId": "56b3117b-e344-481b-a9fc-2798b76d7a60"
3229
},
33-
"execution_count": 1,
3430
"outputs": [
3531
{
36-
"output_type": "stream",
3732
"name": "stdout",
33+
"output_type": "stream",
3834
"text": [
3935
"fatal: destination path 'capsa-intro-deep-learning' already exists and is not an empty directory.\n",
4036
"Already on 'HistogramVAEWrapper'\n",
4137
"Your branch is up to date with 'origin/HistogramVAEWrapper'.\n"
4238
]
4339
}
40+
],
41+
"source": [
42+
"!git clone https://github.com/slolla/capsa-intro-deep-learning.git\n",
43+
"!cd capsa-intro-deep-learning/ && git checkout HistogramVAEWrapper\n"
4444
]
4545
},
4646
{
@@ -54,23 +54,18 @@
5454
},
5555
{
5656
"cell_type": "code",
57-
"source": [
58-
"%cd capsa-intro-deep-learning/\n",
59-
"%pip install -e .\n",
60-
"%cd .."
61-
],
57+
"execution_count": 2,
6258
"metadata": {
63-
"id": "SjAn-WZK9lOv",
64-
"outputId": "35e24600-85b4-4320-c436-061856e56861",
6559
"colab": {
6660
"base_uri": "https://localhost:8080/"
67-
}
61+
},
62+
"id": "SjAn-WZK9lOv",
63+
"outputId": "35e24600-85b4-4320-c436-061856e56861"
6864
},
69-
"execution_count": 2,
7065
"outputs": [
7166
{
72-
"output_type": "stream",
7367
"name": "stdout",
68+
"output_type": "stream",
7469
"text": [
7570
"/content/capsa-intro-deep-learning\n",
7671
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
@@ -85,29 +80,27 @@
8580
"/content\n"
8681
]
8782
}
83+
],
84+
"source": [
85+
"%cd capsa-intro-deep-learning/\n",
86+
"%pip install -e .\n",
87+
"%cd .."
8888
]
8989
},
9090
{
9191
"cell_type": "code",
92-
"source": [
93-
"!git clone https://github.com/aamini/introtodeeplearning.git\n",
94-
"!cd introtodeeplearning/ && git checkout 2023\n",
95-
"%cd introtodeeplearning/\n",
96-
"%pip install -e .\n",
97-
"%cd .."
98-
],
92+
"execution_count": 3,
9993
"metadata": {
100-
"id": "3pzGVPrh-4LQ",
101-
"outputId": "f4588f12-d290-4746-d819-501a0e3ba390",
10294
"colab": {
10395
"base_uri": "https://localhost:8080/"
104-
}
96+
},
97+
"id": "3pzGVPrh-4LQ",
98+
"outputId": "f4588f12-d290-4746-d819-501a0e3ba390"
10599
},
106-
"execution_count": 3,
107100
"outputs": [
108101
{
109-
"output_type": "stream",
110102
"name": "stdout",
103+
"output_type": "stream",
111104
"text": [
112105
"fatal: destination path 'introtodeeplearning' already exists and is not an empty directory.\n",
113106
"Already on '2023'\n",
@@ -133,6 +126,13 @@
133126
"/content\n"
134127
]
135128
}
129+
],
130+
"source": [
131+
"!git clone https://github.com/aamini/introtodeeplearning.git\n",
132+
"!cd introtodeeplearning/ && git checkout 2023\n",
133+
"%cd introtodeeplearning/\n",
134+
"%pip install -e .\n",
135+
"%cd .."
136136
]
137137
},
138138
{
@@ -182,16 +182,16 @@
182182
"cell_type": "code",
183183
"execution_count": 7,
184184
"metadata": {
185-
"id": "HIA6EA1D71EW",
186-
"outputId": "df98738c-00d5-4987-bd58-938dd17c8ef4",
187185
"colab": {
188186
"base_uri": "https://localhost:8080/"
189-
}
187+
},
188+
"id": "HIA6EA1D71EW",
189+
"outputId": "df98738c-00d5-4987-bd58-938dd17c8ef4"
190190
},
191191
"outputs": [
192192
{
193-
"output_type": "stream",
194193
"name": "stdout",
194+
"output_type": "stream",
195195
"text": [
196196
"Opening /root/.keras/datasets/train_face_2023_v2.h5\n",
197197
"Loading data into memory...\n",
@@ -204,10 +204,11 @@
204204
"batch_size = 32\n",
205205
"\n",
206206
"# Get the training data: both images from CelebA and ImageNet\n",
207-
"path_to_training_data = tf.keras.utils.get_file('train_face_2023_v2.h5', 'https://www.dropbox.com/s/b5z1cd317y5u1tr/train_face_2023_v2.h5?dl=1')\n",
207+
"path_to_training_data = tf.keras.utils.get_file('train_face_perturbed_small.h5', 'https://www.dropbox.com/s/tbra3danrk5x8h5/train_face_2023_perturbed_small.h5?dl=1')\n",
208208
"# Instantiate a DatasetLoader using the downloaded dataset\n",
209209
"train_loader = lab3.DatasetLoader(path_to_training_data, training=True, batch_size= batch_size)\n",
210-
"test_loader = lab3.DatasetLoader(path_to_training_data, training=False, batch_size = batch_size)"
210+
"test_loader = lab3.DatasetLoader(path_to_training_data, training=False, batch_size = batch_size)\n",
211+
"train_imgs = train_loader.get_all_faces()"
211212
]
212213
},
213214
{
@@ -367,31 +368,31 @@
367368
"cell_type": "code",
368369
"execution_count": null,
369370
"metadata": {
370-
"id": "NmshVdLM71Ed",
371-
"outputId": "48155283-4767-46e7-e84b-dfd3ac8c1917",
372371
"colab": {
373372
"base_uri": "https://localhost:8080/"
374-
}
373+
},
374+
"id": "NmshVdLM71Ed",
375+
"outputId": "48155283-4767-46e7-e84b-dfd3ac8c1917"
375376
},
376377
"outputs": [
377378
{
378-
"output_type": "stream",
379379
"name": "stdout",
380+
"output_type": "stream",
380381
"text": [
381382
"Epoch 1/6\n"
382383
]
383384
},
384385
{
385-
"output_type": "stream",
386386
"name": "stderr",
387+
"output_type": "stream",
387388
"text": [
388389
"WARNING:tensorflow:Gradients do not exist for variables ['dense_1/kernel:0', 'dense_1/bias:0'] when minimizing the loss. If you're using `model.compile()`, did you forget to provide a `loss`argument?\n",
389390
"WARNING:tensorflow:Gradients do not exist for variables ['dense_1/kernel:0', 'dense_1/bias:0'] when minimizing the loss. If you're using `model.compile()`, did you forget to provide a `loss`argument?\n"
390391
]
391392
},
392393
{
393-
"output_type": "stream",
394394
"name": "stdout",
395+
"output_type": "stream",
395396
"text": [
396397
" 102/2404 [>.............................] - ETA: 5:58 - vae_compiled_loss: 0.8147 - vae_compiled_binary_accuracy: 0.4792 - vae_wrapper_loss: 3385.2124"
397398
]
@@ -707,8 +708,7 @@
707708
"dbvae = HistogramVAEWrapper(standard_classifier, latent_dim=100, num_bins=5, queue_size=2000, decoder=make_face_decoder_network())\n",
708709
"dbvae.compile(optimizer=tf.keras.optimizers.Adam(1e-4),\n",
709710
" loss=tf.keras.losses.BinaryCrossentropy(),\n",
710-
" metrics=[tf.keras.metrics.BinaryAccuracy()])\n",
711-
"train_imgs = train_loader.get_all_faces()"
711+
" metrics=[tf.keras.metrics.BinaryAccuracy()])"
712712
]
713713
},
714714
{
@@ -832,6 +832,11 @@
832832
}
833833
],
834834
"metadata": {
835+
"accelerator": "GPU",
836+
"colab": {
837+
"provenance": []
838+
},
839+
"gpuClass": "standard",
835840
"kernelspec": {
836841
"display_name": "Python 3",
837842
"language": "python",
@@ -848,13 +853,8 @@
848853
"nbconvert_exporter": "python",
849854
"pygments_lexer": "ipython3",
850855
"version": "3.8.10"
851-
},
852-
"colab": {
853-
"provenance": []
854-
},
855-
"accelerator": "GPU",
856-
"gpuClass": "standard"
856+
}
857857
},
858858
"nbformat": 4,
859859
"nbformat_minor": 0
860-
}
860+
}

0 commit comments

Comments
 (0)