|
12 | 12 | },
|
13 | 13 | {
|
14 | 14 | "cell_type": "code",
|
15 |
| - "execution_count": 0, |
| 15 | + "execution_count": null, |
16 | 16 | "metadata": {
|
17 | 17 | "cellView": "form",
|
18 | 18 | "colab": {},
|
|
107 | 107 | },
|
108 | 108 | {
|
109 | 109 | "cell_type": "code",
|
110 |
| - "execution_count": 0, |
| 110 | + "execution_count": null, |
111 | 111 | "metadata": {
|
112 | 112 | "colab": {},
|
113 | 113 | "colab_type": "code",
|
|
120 | 120 | },
|
121 | 121 | {
|
122 | 122 | "cell_type": "code",
|
123 |
| - "execution_count": 0, |
| 123 | + "execution_count": null, |
124 | 124 | "metadata": {
|
125 | 125 | "colab": {},
|
126 | 126 | "colab_type": "code",
|
|
151 | 151 | },
|
152 | 152 | {
|
153 | 153 | "cell_type": "code",
|
154 |
| - "execution_count": 0, |
| 154 | + "execution_count": null, |
155 | 155 | "metadata": {
|
156 | 156 | "colab": {},
|
157 | 157 | "colab_type": "code",
|
|
202 | 202 | },
|
203 | 203 | {
|
204 | 204 | "cell_type": "code",
|
205 |
| - "execution_count": 0, |
| 205 | + "execution_count": null, |
206 | 206 | "metadata": {
|
207 | 207 | "colab": {},
|
208 | 208 | "colab_type": "code",
|
|
257 | 257 | },
|
258 | 258 | {
|
259 | 259 | "cell_type": "code",
|
260 |
| - "execution_count": 0, |
| 260 | + "execution_count": null, |
261 | 261 | "metadata": {
|
262 | 262 | "colab": {},
|
263 | 263 | "colab_type": "code",
|
|
319 | 319 | },
|
320 | 320 | {
|
321 | 321 | "cell_type": "code",
|
322 |
| - "execution_count": 0, |
| 322 | + "execution_count": null, |
323 | 323 | "metadata": {
|
324 | 324 | "colab": {},
|
325 | 325 | "colab_type": "code",
|
|
351 | 351 | },
|
352 | 352 | {
|
353 | 353 | "cell_type": "code",
|
354 |
| - "execution_count": 0, |
| 354 | + "execution_count": null, |
355 | 355 | "metadata": {
|
356 | 356 | "colab": {},
|
357 | 357 | "colab_type": "code",
|
|
378 | 378 | },
|
379 | 379 | {
|
380 | 380 | "cell_type": "code",
|
381 |
| - "execution_count": 0, |
| 381 | + "execution_count": null, |
382 | 382 | "metadata": {
|
383 | 383 | "colab": {},
|
384 | 384 | "colab_type": "code",
|
|
420 | 420 | "Both `tfmot.sparsity.keras.strip_pruning` and applying a standard compression algorithm (e.g. via gzip) are necessary to see the compression\n",
|
421 | 421 | "benefits of pruning.\n",
|
422 | 422 | "\n",
|
| 423 | + "* `strip_pruning` is necessary since it removes every tf.Variable that pruning only needs during training, which would otherwise add to model size during inference\n", |
| 424 | + "* Applying a standard compression algorithm is necessary since the serialized weight matrices are the same size as they were before pruning. However, pruning makes most of the weights zeros, which is\n", |
| 425 | + "added redundancy that algorithms can utilize to further compress the model.\n", |
| 426 | + "\n", |
423 | 427 | "First, create a compressible model for TensorFlow."
|
424 | 428 | ]
|
425 | 429 | },
|
426 | 430 | {
|
427 | 431 | "cell_type": "code",
|
428 |
| - "execution_count": 0, |
| 432 | + "execution_count": null, |
429 | 433 | "metadata": {
|
430 | 434 | "colab": {},
|
431 | 435 | "colab_type": "code",
|
|
452 | 456 | },
|
453 | 457 | {
|
454 | 458 | "cell_type": "code",
|
455 |
| - "execution_count": 0, |
| 459 | + "execution_count": null, |
456 | 460 | "metadata": {
|
457 | 461 | "colab": {},
|
458 | 462 | "colab_type": "code",
|
|
483 | 487 | },
|
484 | 488 | {
|
485 | 489 | "cell_type": "code",
|
486 |
| - "execution_count": 0, |
| 490 | + "execution_count": null, |
487 | 491 | "metadata": {
|
488 | 492 | "colab": {},
|
489 | 493 | "colab_type": "code",
|
|
515 | 519 | },
|
516 | 520 | {
|
517 | 521 | "cell_type": "code",
|
518 |
| - "execution_count": 0, |
| 522 | + "execution_count": null, |
519 | 523 | "metadata": {
|
520 | 524 | "colab": {},
|
521 | 525 | "colab_type": "code",
|
|
550 | 554 | },
|
551 | 555 | {
|
552 | 556 | "cell_type": "code",
|
553 |
| - "execution_count": 0, |
| 557 | + "execution_count": null, |
554 | 558 | "metadata": {
|
555 | 559 | "colab": {},
|
556 | 560 | "colab_type": "code",
|
|
595 | 599 | },
|
596 | 600 | {
|
597 | 601 | "cell_type": "code",
|
598 |
| - "execution_count": 0, |
| 602 | + "execution_count": null, |
599 | 603 | "metadata": {
|
600 | 604 | "colab": {},
|
601 | 605 | "colab_type": "code",
|
|
647 | 651 | },
|
648 | 652 | {
|
649 | 653 | "cell_type": "code",
|
650 |
| - "execution_count": 0, |
| 654 | + "execution_count": null, |
651 | 655 | "metadata": {
|
652 | 656 | "colab": {},
|
653 | 657 | "colab_type": "code",
|
|
0 commit comments