67
67
},
68
68
{
69
69
"cell_type" : " code" ,
70
- "execution_count" : 0 ,
70
+ "execution_count" : null ,
71
71
"metadata" : {
72
72
"colab_type" : " code"
73
73
},
97
97
},
98
98
{
99
99
"cell_type" : " code" ,
100
- "execution_count" : 0 ,
100
+ "execution_count" : null ,
101
101
"metadata" : {
102
102
"colab_type" : " code"
103
103
},
126
126
},
127
127
{
128
128
"cell_type" : " code" ,
129
- "execution_count" : 0 ,
129
+ "execution_count" : null ,
130
130
"metadata" : {
131
131
"colab_type" : " code"
132
132
},
182
182
},
183
183
{
184
184
"cell_type" : " code" ,
185
- "execution_count" : 0 ,
185
+ "execution_count" : null ,
186
186
"metadata" : {
187
187
"colab_type" : " code"
188
188
},
229
229
},
230
230
{
231
231
"cell_type" : " code" ,
232
- "execution_count" : 0 ,
232
+ "execution_count" : null ,
233
233
"metadata" : {
234
234
"colab_type" : " code"
235
235
},
324
324
" else:\n " ,
325
325
" # Linearly project the flat patches\n " ,
326
326
" tokens = self.projection(flat_patches)\n " ,
327
- " return (tokens, patches)\n " ,
328
- " "
327
+ " return (tokens, patches)\n "
329
328
]
330
329
},
331
330
{
339
338
},
340
339
{
341
340
"cell_type" : " code" ,
342
- "execution_count" : 0 ,
341
+ "execution_count" : null ,
343
342
"metadata" : {
344
343
"colab_type" : " code"
345
344
},
402
401
},
403
402
{
404
403
"cell_type" : " code" ,
405
- "execution_count" : 0 ,
404
+ "execution_count" : null ,
406
405
"metadata" : {
407
406
"colab_type" : " code"
408
407
},
423
422
" def call(self, encoded_patches):\n " ,
424
423
" encoded_positions = self.position_embedding(self.positions)\n " ,
425
424
" encoded_patches = encoded_patches + encoded_positions\n " ,
426
- " return encoded_patches\n " ,
427
- " "
425
+ " return encoded_patches\n "
428
426
]
429
427
},
430
428
{
472
470
},
473
471
{
474
472
"cell_type" : " code" ,
475
- "execution_count" : 0 ,
473
+ "execution_count" : null ,
476
474
"metadata" : {
477
475
"colab_type" : " code"
478
476
},
496
494
" attention_output = tf.einsum(\n " ,
497
495
" self._combine_equation, attention_scores_dropout, value\n " ,
498
496
" )\n " ,
499
- " return attention_output, attention_scores\n " ,
500
- " "
497
+ " return attention_output, attention_scores\n "
501
498
]
502
499
},
503
500
{
511
508
},
512
509
{
513
510
"cell_type" : " code" ,
514
- "execution_count" : 0 ,
511
+ "execution_count" : null ,
515
512
"metadata" : {
516
513
"colab_type" : " code"
517
514
},
541
538
},
542
539
{
543
540
"cell_type" : " code" ,
544
- "execution_count" : 0 ,
541
+ "execution_count" : null ,
545
542
"metadata" : {
546
543
"colab_type" : " code"
547
544
},
589
586
" logits = layers.Dense(NUM_CLASSES)(features)\n " ,
590
587
" # Create the Keras model.\n " ,
591
588
" model = keras.Model(inputs=inputs, outputs=logits)\n " ,
592
- " return model\n " ,
593
- " "
589
+ " return model\n "
594
590
]
595
591
},
596
592
{
604
600
},
605
601
{
606
602
"cell_type" : " code" ,
607
- "execution_count" : 0 ,
603
+ "execution_count" : null ,
608
604
"metadata" : {
609
605
"colab_type" : " code"
610
606
},
754
750
},
755
751
"nbformat" : 4 ,
756
752
"nbformat_minor" : 0
757
- }
753
+ }
0 commit comments