59
59
},
60
60
{
61
61
"cell_type" : " code" ,
62
- "execution_count" : 0 ,
62
+ "execution_count" : null ,
63
63
"metadata" : {
64
64
"colab_type" : " code"
65
65
},
92
92
},
93
93
{
94
94
"cell_type" : " code" ,
95
- "execution_count" : 0 ,
95
+ "execution_count" : null ,
96
96
"metadata" : {
97
97
"colab_type" : " code"
98
98
},
121
121
},
122
122
{
123
123
"cell_type" : " code" ,
124
- "execution_count" : 0 ,
124
+ "execution_count" : null ,
125
125
"metadata" : {
126
126
"colab_type" : " code"
127
127
},
177
177
},
178
178
{
179
179
"cell_type" : " code" ,
180
- "execution_count" : 0 ,
180
+ "execution_count" : null ,
181
181
"metadata" : {
182
182
"colab_type" : " code"
183
183
},
224
224
},
225
225
{
226
226
"cell_type" : " code" ,
227
- "execution_count" : 0 ,
227
+ "execution_count" : null ,
228
228
"metadata" : {
229
229
"colab_type" : " code"
230
230
},
319
319
" else:\n " ,
320
320
" # Linearly project the flat patches\n " ,
321
321
" tokens = self.projection(flat_patches)\n " ,
322
- " return (tokens, patches)\n " ,
323
- " "
322
+ " return (tokens, patches)\n "
324
323
]
325
324
},
326
325
{
334
333
},
335
334
{
336
335
"cell_type" : " code" ,
337
- "execution_count" : 0 ,
336
+ "execution_count" : null ,
338
337
"metadata" : {
339
338
"colab_type" : " code"
340
339
},
397
396
},
398
397
{
399
398
"cell_type" : " code" ,
400
- "execution_count" : 0 ,
399
+ "execution_count" : null ,
401
400
"metadata" : {
402
401
"colab_type" : " code"
403
402
},
418
417
" def call(self, encoded_patches):\n " ,
419
418
" encoded_positions = self.position_embedding(self.positions)\n " ,
420
419
" encoded_patches = encoded_patches + encoded_positions\n " ,
421
- " return encoded_patches\n " ,
422
- " "
420
+ " return encoded_patches\n "
423
421
]
424
422
},
425
423
{
467
465
},
468
466
{
469
467
"cell_type" : " code" ,
470
- "execution_count" : 0 ,
468
+ "execution_count" : null ,
471
469
"metadata" : {
472
470
"colab_type" : " code"
473
471
},
491
489
" attention_output = tf.einsum(\n " ,
492
490
" self._combine_equation, attention_scores_dropout, value\n " ,
493
491
" )\n " ,
494
- " return attention_output, attention_scores\n " ,
495
- " "
492
+ " return attention_output, attention_scores\n "
496
493
]
497
494
},
498
495
{
506
503
},
507
504
{
508
505
"cell_type" : " code" ,
509
- "execution_count" : 0 ,
506
+ "execution_count" : null ,
510
507
"metadata" : {
511
508
"colab_type" : " code"
512
509
},
536
533
},
537
534
{
538
535
"cell_type" : " code" ,
539
- "execution_count" : 0 ,
536
+ "execution_count" : null ,
540
537
"metadata" : {
541
538
"colab_type" : " code"
542
539
},
584
581
" logits = layers.Dense(NUM_CLASSES)(features)\n " ,
585
582
" # Create the Keras model.\n " ,
586
583
" model = keras.Model(inputs=inputs, outputs=logits)\n " ,
587
- " return model\n " ,
588
- " "
584
+ " return model\n "
589
585
]
590
586
},
591
587
{
599
595
},
600
596
{
601
597
"cell_type" : " code" ,
602
- "execution_count" : 0 ,
598
+ "execution_count" : null ,
603
599
"metadata" : {
604
600
"colab_type" : " code"
605
601
},
747
743
},
748
744
"nbformat" : 4 ,
749
745
"nbformat_minor" : 0
750
- }
746
+ }
0 commit comments