{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Modify Display Utils" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Utilities for collecting/checking `fastai` user environment" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from fastai.utils.mod_display import *" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [], "source": [ "from fastai.gen_doc.nbdoc import *\n", "from fastai.utils.collect_env import * " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [ { "data": { "text/markdown": [ "

class progress_disabled[source][test]

\n", "\n", "> progress_disabled(**`learner`**:[`Learner`](/basic_train.html#Learner))\n", "\n", "
×

No tests found for progress_disabled. To contribute a test please refer to this guide and this discussion.

\n", "\n", "Context manager to disable the progress update bar and Recorder print " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "show_doc(progress_disabled)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide_input": true }, "outputs": [], "source": [ "from fastai.vision import *\n", "path = untar_data(URLs.MNIST_SAMPLE)\n", "data = ImageDataBunch.from_folder(path)\n", "learn = cnn_learner(data, models.resnet18, metrics=accuracy)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`learn.fit()` will display a progress bar and give the final results once completed:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/html": [ "Total time: 00:06

\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
epochtrain_lossvalid_lossaccuracytime
00.1398250.0817910.97497500:06
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "learn.fit(1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`progress_disabled(learn)` will remove all that update and only show the total time once completed." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total time: 00:05\n" ] } ], "source": [ "with progress_disabled(learn) as learn:\n", " learn.fit(1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Undocumented Methods - Methods moved below this line will intentionally be hidden" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 2 }