19
19
},
20
20
{
21
21
"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 ,
26
23
"metadata" : {
27
- "id" : " 5Ll7uZ8q72hm" ,
28
- "outputId" : " 56b3117b-e344-481b-a9fc-2798b76d7a60" ,
29
24
"colab" : {
30
25
"base_uri" : " https://localhost:8080/"
31
- }
26
+ },
27
+ "id" : " 5Ll7uZ8q72hm" ,
28
+ "outputId" : " 56b3117b-e344-481b-a9fc-2798b76d7a60"
32
29
},
33
- "execution_count" : 1 ,
34
30
"outputs" : [
35
31
{
36
- "output_type" : " stream" ,
37
32
"name" : " stdout" ,
33
+ "output_type" : " stream" ,
38
34
"text" : [
39
35
" fatal: destination path 'capsa-intro-deep-learning' already exists and is not an empty directory.\n " ,
40
36
" Already on 'HistogramVAEWrapper'\n " ,
41
37
" Your branch is up to date with 'origin/HistogramVAEWrapper'.\n "
42
38
]
43
39
}
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 "
44
44
]
45
45
},
46
46
{
54
54
},
55
55
{
56
56
"cell_type" : " code" ,
57
- "source" : [
58
- " %cd capsa-intro-deep-learning/\n " ,
59
- " %pip install -e .\n " ,
60
- " %cd .."
61
- ],
57
+ "execution_count" : 2 ,
62
58
"metadata" : {
63
- "id" : " SjAn-WZK9lOv" ,
64
- "outputId" : " 35e24600-85b4-4320-c436-061856e56861" ,
65
59
"colab" : {
66
60
"base_uri" : " https://localhost:8080/"
67
- }
61
+ },
62
+ "id" : " SjAn-WZK9lOv" ,
63
+ "outputId" : " 35e24600-85b4-4320-c436-061856e56861"
68
64
},
69
- "execution_count" : 2 ,
70
65
"outputs" : [
71
66
{
72
- "output_type" : " stream" ,
73
67
"name" : " stdout" ,
68
+ "output_type" : " stream" ,
74
69
"text" : [
75
70
" /content/capsa-intro-deep-learning\n " ,
76
71
" Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n " ,
85
80
" /content\n "
86
81
]
87
82
}
83
+ ],
84
+ "source" : [
85
+ " %cd capsa-intro-deep-learning/\n " ,
86
+ " %pip install -e .\n " ,
87
+ " %cd .."
88
88
]
89
89
},
90
90
{
91
91
"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 ,
99
93
"metadata" : {
100
- "id" : " 3pzGVPrh-4LQ" ,
101
- "outputId" : " f4588f12-d290-4746-d819-501a0e3ba390" ,
102
94
"colab" : {
103
95
"base_uri" : " https://localhost:8080/"
104
- }
96
+ },
97
+ "id" : " 3pzGVPrh-4LQ" ,
98
+ "outputId" : " f4588f12-d290-4746-d819-501a0e3ba390"
105
99
},
106
- "execution_count" : 3 ,
107
100
"outputs" : [
108
101
{
109
- "output_type" : " stream" ,
110
102
"name" : " stdout" ,
103
+ "output_type" : " stream" ,
111
104
"text" : [
112
105
" fatal: destination path 'introtodeeplearning' already exists and is not an empty directory.\n " ,
113
106
" Already on '2023'\n " ,
133
126
" /content\n "
134
127
]
135
128
}
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 .."
136
136
]
137
137
},
138
138
{
182
182
"cell_type" : " code" ,
183
183
"execution_count" : 7 ,
184
184
"metadata" : {
185
- "id" : " HIA6EA1D71EW" ,
186
- "outputId" : " df98738c-00d5-4987-bd58-938dd17c8ef4" ,
187
185
"colab" : {
188
186
"base_uri" : " https://localhost:8080/"
189
- }
187
+ },
188
+ "id" : " HIA6EA1D71EW" ,
189
+ "outputId" : " df98738c-00d5-4987-bd58-938dd17c8ef4"
190
190
},
191
191
"outputs" : [
192
192
{
193
- "output_type" : " stream" ,
194
193
"name" : " stdout" ,
194
+ "output_type" : " stream" ,
195
195
"text" : [
196
196
" Opening /root/.keras/datasets/train_face_2023_v2.h5\n " ,
197
197
" Loading data into memory...\n " ,
204
204
" batch_size = 32\n " ,
205
205
" \n " ,
206
206
" # 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 " ,
208
208
" # Instantiate a DatasetLoader using the downloaded dataset\n " ,
209
209
" 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()"
211
212
]
212
213
},
213
214
{
367
368
"cell_type" : " code" ,
368
369
"execution_count" : null ,
369
370
"metadata" : {
370
- "id" : " NmshVdLM71Ed" ,
371
- "outputId" : " 48155283-4767-46e7-e84b-dfd3ac8c1917" ,
372
371
"colab" : {
373
372
"base_uri" : " https://localhost:8080/"
374
- }
373
+ },
374
+ "id" : " NmshVdLM71Ed" ,
375
+ "outputId" : " 48155283-4767-46e7-e84b-dfd3ac8c1917"
375
376
},
376
377
"outputs" : [
377
378
{
378
- "output_type" : " stream" ,
379
379
"name" : " stdout" ,
380
+ "output_type" : " stream" ,
380
381
"text" : [
381
382
" Epoch 1/6\n "
382
383
]
383
384
},
384
385
{
385
- "output_type" : " stream" ,
386
386
"name" : " stderr" ,
387
+ "output_type" : " stream" ,
387
388
"text" : [
388
389
" 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 " ,
389
390
" 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 "
390
391
]
391
392
},
392
393
{
393
- "output_type" : " stream" ,
394
394
"name" : " stdout" ,
395
+ "output_type" : " stream" ,
395
396
"text" : [
396
397
" 102/2404 [>.............................] - ETA: 5:58 - vae_compiled_loss: 0.8147 - vae_compiled_binary_accuracy: 0.4792 - vae_wrapper_loss: 3385.2124"
397
398
]
707
708
" dbvae = HistogramVAEWrapper(standard_classifier, latent_dim=100, num_bins=5, queue_size=2000, decoder=make_face_decoder_network())\n " ,
708
709
" dbvae.compile(optimizer=tf.keras.optimizers.Adam(1e-4),\n " ,
709
710
" 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()])"
712
712
]
713
713
},
714
714
{
832
832
}
833
833
],
834
834
"metadata" : {
835
+ "accelerator" : " GPU" ,
836
+ "colab" : {
837
+ "provenance" : []
838
+ },
839
+ "gpuClass" : " standard" ,
835
840
"kernelspec" : {
836
841
"display_name" : " Python 3" ,
837
842
"language" : " python" ,
848
853
"nbconvert_exporter" : " python" ,
849
854
"pygments_lexer" : " ipython3" ,
850
855
"version" : " 3.8.10"
851
- },
852
- "colab" : {
853
- "provenance" : []
854
- },
855
- "accelerator" : " GPU" ,
856
- "gpuClass" : " standard"
856
+ }
857
857
},
858
858
"nbformat" : 4 ,
859
859
"nbformat_minor" : 0
860
- }
860
+ }
0 commit comments