Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Docs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwharris committed Apr 21, 2021
1 parent 42f8db4 commit 349c88c
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 35 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ First, finetune:
```python
# import our libraries
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.vision import ImageClassificationData, ImageClassifier

# 1. Download the data
Expand Down Expand Up @@ -170,7 +170,7 @@ Flash has an Image embedding task to encodes an image into a vector of image fea
<summary>View example</summary>

```python
from flash.core.data import download_data
from flash.data.utils import download_data
from flash.vision import ImageEmbedder

# 1. Download the data
Expand All @@ -197,7 +197,7 @@ Flash has a Summarization task to sum up text from a larger article into a short
```python
# import our libraries
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.text import SummarizationData, SummarizationTask

# 1. Download the data
Expand Down Expand Up @@ -244,7 +244,7 @@ To illustrate, say we want to build a model to predict if a passenger survived o
# import our libraries
from torchmetrics.classification import Accuracy, Precision, Recall
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.tabular import TabularClassifier, TabularData

# 1. Download the data
Expand Down Expand Up @@ -295,7 +295,7 @@ To illustrate, say we want to build a model on a tiny coco dataset.
```python
# import our libraries
import flash
from flash.core.data import download_data
from flash.data.utils import download_data
from flash.vision import ObjectDetectionData, ObjectDetector

# 1. Download the data
Expand Down
2 changes: 1 addition & 1 deletion docs/source/general/finetuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Here are the steps in code
.. code-block:: python
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.vision import ImageClassificationData, ImageClassifier
# 1. download and organize the data
Expand Down
8 changes: 3 additions & 5 deletions docs/source/general/predictions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Predict on a single sample of data

You can pass in a sample of data (image file path, a string of text, etc) to the :func:`~flash.core.model.Task.predict` method.


.. code-block:: python
from flash import Trainer
from flash.core.data import download_data
from flash.data.utils import download_data
from flash.vision import ImageClassificationData, ImageClassifier
Expand All @@ -37,7 +37,7 @@ Predict on a csv file

.. code-block:: python
from flash.core.data import download_data
from flash.data.utils import download_data
from flash.tabular import TabularClassifier
# 1. Download the data
Expand All @@ -51,5 +51,3 @@ Predict on a csv file
# 3. Generate predictions from a csv file! Who would survive?
predictions = model.predict("data/titanic/titanic.csv")
print(predictions)
6 changes: 3 additions & 3 deletions docs/source/general/training.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Some Flash tasks have been pretrained on large data sets. To accelerate your tra
.. code-block:: python
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.vision import ImageClassificationData, ImageClassifier
# 1. download and organize the data
Expand Down Expand Up @@ -48,7 +48,7 @@ Flash tasks supports many advanced training functionalities out-of-the-box, such
# train on 1 GPU
flash.Trainer(gpus=1)
* Training on multiple GPUs

.. code-block:: python
Expand All @@ -60,7 +60,7 @@ Flash tasks supports many advanced training functionalities out-of-the-box, such
# train on gpu 1, 3, 5 (3 gpus total)
flash.Trainer(gpus=[1, 3, 5])
* Using mixed precision training

.. code-block:: python
Expand Down
6 changes: 3 additions & 3 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For getting started with Deep Learning

Easy to learn
^^^^^^^^^^^^^
If you are just getting started with deep learning, Flash offers common deep learning tasks you can use out-of-the-box in a few lines of code, no math, fancy nn.Modules or research experience required!
If you are just getting started with deep learning, Flash offers common deep learning tasks you can use out-of-the-box in a few lines of code, no math, fancy nn.Modules or research experience required!

Easy to scale
^^^^^^^^^^^^^
Expand Down Expand Up @@ -70,7 +70,7 @@ You can install flash using pip or conda:
Tasks
=====

Flash is comprised of a collection of Tasks. The Flash tasks are laser-focused objects designed to solve a well-defined type of problem, using state-of-the-art methods.
Flash is comprised of a collection of Tasks. The Flash tasks are laser-focused objects designed to solve a well-defined type of problem, using state-of-the-art methods.

The Flash tasks contain all the relevant information to solve the task at hand- the number of class labels you want to predict, number of columns in your dataset, as well as details on the model architecture used such as loss function, optimizers, etc.

Expand Down Expand Up @@ -137,7 +137,7 @@ Here's an example of finetuning.
.. code-block:: python
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.vision import ImageClassificationData, ImageClassifier
# 1. Download the data
Expand Down
4 changes: 2 additions & 2 deletions docs/source/reference/image_classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Use the :class:`~flash.vision.ImageClassifier` pretrained model for inference on
# import our libraries
from flash import Trainer
from flash import download_data
from flash.data.utils import download_data
from flash.vision import ImageClassificationData, ImageClassifier
# 1. Download the data
Expand Down Expand Up @@ -90,7 +90,7 @@ Now all we need is three lines of code to build to train our task!
.. code-block:: python
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.vision import ImageClassificationData, ImageClassifier
# 1. Download the data
Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/image_embedder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ To tailor this image embedder to your dataset, finetune first.
.. code-block:: python
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.vision import ImageClassificationData, ImageEmbedder
# 1. Download the data
Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/object_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ To tailor the object detector to your dataset, you would need to have it in `COC
.. code-block:: python
import flash
from flash.core.data import download_data
from flash.data.utils import download_data
from flash.vision import ObjectDetectionData, ObjectDetector
# 1. Download the data
Expand Down
4 changes: 2 additions & 2 deletions docs/source/reference/summarization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Or on a given dataset, use :class:`~flash.core.trainer.Trainer` `predict` method
# import our libraries
from flash import Trainer
from flash import download_data
from flash.data.utils import download_data
from flash.text import SummarizationData, SummarizationTask
# 1. Download data
Expand Down Expand Up @@ -104,7 +104,7 @@ All we need is three lines of code to train our model!
# import our libraries
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.text import SummarizationData, SummarizationTask
# 1. Download data
Expand Down
6 changes: 3 additions & 3 deletions docs/source/reference/tabular_classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Next, we create the :class:`~flash.tabular.TabularClassifier` task, using the Da
.. code-block:: python
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.tabular import TabularClassifier, TabularData
from torchmetrics.classification import Accuracy, Precision, Recall
Expand Down Expand Up @@ -92,7 +92,7 @@ You can make predcitions on a pretrained model, that has already been trained fo
.. code-block:: python
from flash.core.data import download_data
from flash.data.utils import download_data
from flash.tabular import TabularClassifier
# 1. Download the data
Expand All @@ -113,7 +113,7 @@ Or you can finetune your own model and use that for prediction:
.. code-block:: python
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.tabular import TabularClassifier, TabularData
# 1. Load the data
Expand Down
4 changes: 2 additions & 2 deletions docs/source/reference/text_classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Use the :class:`~flash.text.classification.model.TextClassifier` pretrained mode
from pytorch_lightning import Trainer
from flash import download_data
from flash.data.utils import download_data
from flash.text import TextClassificationData, TextClassifier
Expand Down Expand Up @@ -77,7 +77,7 @@ All we need is three lines of code to train our model!
.. code-block:: python
import flash
from flash.core.data import download_data
from flash.data.utils import download_data
from flash.text import TextClassificationData, TextClassifier
# 1. Download the data
Expand Down
4 changes: 2 additions & 2 deletions docs/source/reference/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Or on a given dataset, use :class:`~flash.core.trainer.Trainer` `predict` method
# import our libraries
from flash import Trainer
from flash import download_data
from flash.data.utils import download_data
from flash.text import TranslationData, TranslationTask
# 1. Download data
Expand Down Expand Up @@ -86,7 +86,7 @@ All we need is three lines of code to train our model! By default, we use a `mBA
# import our libraries
import flash
from flash import download_data
from flash.data.utils import download_data
from flash.text import TranslationData, TranslationTask
# 1. Download data
Expand Down
6 changes: 3 additions & 3 deletions flash_examples/finetuning/summarization.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.
import torch

import flash
from flash import download_data, Trainer
from flash import Trainer
from flash.data.utils import download_data
from flash.text import SummarizationData, SummarizationTask

# 1. Download the data
Expand All @@ -33,7 +33,7 @@
model = SummarizationTask()

# 4. Create the trainer. Run once on data
trainer = flash.Trainer(gpus=int(torch.cuda.is_available()), fast_dev_run=True)
trainer = Trainer(gpus=int(torch.cuda.is_available()), fast_dev_run=True)

# 5. Fine-tune the model
trainer.finetune(model, datamodule=datamodule)
Expand Down
2 changes: 1 addition & 1 deletion flash_examples/finetuning/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import torch

import flash
from flash import download_data
from flash.data.utils import download_data
from flash.text import TranslationData, TranslationTask

# 1. Download the data
Expand Down
2 changes: 1 addition & 1 deletion flash_examples/predict/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
from pytorch_lightning import Trainer

from flash import download_data
from flash.data.utils import download_data
from flash.text import TranslationData, TranslationTask

# 1. Download the data
Expand Down

0 comments on commit 349c88c

Please sign in to comment.