Skip to content

Commit 85f4b0e

Browse files
committed
Add .md and .ipynb
1 parent 00e82a6 commit 85f4b0e

8 files changed

+125054
-238
lines changed
Loading
Loading
Loading
Loading
Loading
Loading

examples/vision/ipynb/vit_small_ds.ipynb

+16-20
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
},
6060
{
6161
"cell_type": "code",
62-
"execution_count": 0,
62+
"execution_count": null,
6363
"metadata": {
6464
"colab_type": "code"
6565
},
@@ -92,7 +92,7 @@
9292
},
9393
{
9494
"cell_type": "code",
95-
"execution_count": 0,
95+
"execution_count": null,
9696
"metadata": {
9797
"colab_type": "code"
9898
},
@@ -121,7 +121,7 @@
121121
},
122122
{
123123
"cell_type": "code",
124-
"execution_count": 0,
124+
"execution_count": null,
125125
"metadata": {
126126
"colab_type": "code"
127127
},
@@ -177,7 +177,7 @@
177177
},
178178
{
179179
"cell_type": "code",
180-
"execution_count": 0,
180+
"execution_count": null,
181181
"metadata": {
182182
"colab_type": "code"
183183
},
@@ -224,7 +224,7 @@
224224
},
225225
{
226226
"cell_type": "code",
227-
"execution_count": 0,
227+
"execution_count": null,
228228
"metadata": {
229229
"colab_type": "code"
230230
},
@@ -319,8 +319,7 @@
319319
" else:\n",
320320
" # Linearly project the flat patches\n",
321321
" tokens = self.projection(flat_patches)\n",
322-
" return (tokens, patches)\n",
323-
""
322+
" return (tokens, patches)\n"
324323
]
325324
},
326325
{
@@ -334,7 +333,7 @@
334333
},
335334
{
336335
"cell_type": "code",
337-
"execution_count": 0,
336+
"execution_count": null,
338337
"metadata": {
339338
"colab_type": "code"
340339
},
@@ -397,7 +396,7 @@
397396
},
398397
{
399398
"cell_type": "code",
400-
"execution_count": 0,
399+
"execution_count": null,
401400
"metadata": {
402401
"colab_type": "code"
403402
},
@@ -418,8 +417,7 @@
418417
" def call(self, encoded_patches):\n",
419418
" encoded_positions = self.position_embedding(self.positions)\n",
420419
" encoded_patches = encoded_patches + encoded_positions\n",
421-
" return encoded_patches\n",
422-
""
420+
" return encoded_patches\n"
423421
]
424422
},
425423
{
@@ -467,7 +465,7 @@
467465
},
468466
{
469467
"cell_type": "code",
470-
"execution_count": 0,
468+
"execution_count": null,
471469
"metadata": {
472470
"colab_type": "code"
473471
},
@@ -491,8 +489,7 @@
491489
" attention_output = tf.einsum(\n",
492490
" self._combine_equation, attention_scores_dropout, value\n",
493491
" )\n",
494-
" return attention_output, attention_scores\n",
495-
""
492+
" return attention_output, attention_scores\n"
496493
]
497494
},
498495
{
@@ -506,7 +503,7 @@
506503
},
507504
{
508505
"cell_type": "code",
509-
"execution_count": 0,
506+
"execution_count": null,
510507
"metadata": {
511508
"colab_type": "code"
512509
},
@@ -536,7 +533,7 @@
536533
},
537534
{
538535
"cell_type": "code",
539-
"execution_count": 0,
536+
"execution_count": null,
540537
"metadata": {
541538
"colab_type": "code"
542539
},
@@ -584,8 +581,7 @@
584581
" logits = layers.Dense(NUM_CLASSES)(features)\n",
585582
" # Create the Keras model.\n",
586583
" model = keras.Model(inputs=inputs, outputs=logits)\n",
587-
" return model\n",
588-
""
584+
" return model\n"
589585
]
590586
},
591587
{
@@ -599,7 +595,7 @@
599595
},
600596
{
601597
"cell_type": "code",
602-
"execution_count": 0,
598+
"execution_count": null,
603599
"metadata": {
604600
"colab_type": "code"
605601
},
@@ -747,4 +743,4 @@
747743
},
748744
"nbformat": 4,
749745
"nbformat_minor": 0
750-
}
746+
}

0 commit comments

Comments
 (0)