diff --git a/docs/how-to/framework.rst b/docs/how-to/framework.rst index eafc2eb34..27f459ad5 100644 --- a/docs/how-to/framework.rst +++ b/docs/how-to/framework.rst @@ -75,9 +75,9 @@ Follow these steps: .. code-block:: python :caption: Import libraries for PyTorch - import torch.nn as nn - import torch.nn.functional as F - import torch.optim as optim + import torch.nn as nn + import torch.nn.functional as F + import torch.optim as optim 4. Call the training pipeline with rocAL classification data `loader `_. @@ -85,12 +85,12 @@ Follow these steps: .. code-block:: python :caption: Call the training pipeline - Def get_pytorch_train_loader(self): - print(“in get_pytorch_train_loader function”) - pipe_train = trainPipeline(self.data_path, self.batch_size, self.num_classes, self.one_hot, self.local_rank, - self.world_size, self.num_thread, self.crop, self.rocal_cpu, self.fp16) - pipe_train.build() - train_loader = ROCALClassificationIterator(pipe_train, device=”cpu” if self.rocal_cpu else “cuda”, device_id = self.local_rank) + Def get_pytorch_train_loader(self): + print(“in get_pytorch_train_loader function”) + pipe_train = trainPipeline(self.data_path, self.batch_size, self.num_classes, self.one_hot, self.local_rank, + self.world_size, self.num_thread, self.crop, self.rocal_cpu, self.fp16) + pipe_train.build() + train_loader = ROCALClassificationIterator(pipe_train, device=”cpu” if self.rocal_cpu else “cuda”, device_id = self.local_rank) 5. Run the `training script `_. @@ -130,7 +130,7 @@ Create Data-loading Pipeline Follow these steps: -1. Import libraries for `rocAL_pybind `_. +1. Import libraries for `rocAL_pybind `_. .. code-block:: python :caption: Import libraries @@ -141,7 +141,7 @@ Follow these steps: import amd.rocal.types as types -2. See a rocAL pipeline for TensorFlow below. It reads data from the TFRecords using TFRecord Reader and uses ``fn.decoders.image`` to decode the raw `images `_. +2. See a rocAL pipeline for TensorFlow below. It reads data from the TFRecords using TFRecord Reader and uses ``fn.decoders.image`` to decode the raw `images `_. .. code-block:: python :caption: Pipeline for TensorFlow @@ -170,7 +170,7 @@ Follow these steps: trainPipe.build() -3. Import libraries for `TensorFlow `_. +3. Import libraries for `TensorFlow `_. .. code-block:: python :caption: Import libraries for TensorFlow @@ -193,7 +193,6 @@ Follow these steps: 4. To see and run a sample training script, refer to `rocAL TensorFlow example `_. - .. __resnet50: Run Resnet50 classification training with rocAL @@ -216,6 +215,6 @@ Run Resnet50 classification training with rocAL * Option to map the localhost directory with imagenet dataset folder to be accessed on the docker image. * Usage: ``-v {LOCAL_HOST_DIRECTORY_PATH}:{DOCKER_DIRECTORY_PATH}`` -#. To see and run a sample training script, refer to `rocAL Imagenet example `_. +#. To see and run a sample training script, refer to `rocAL Imagenet example `_. diff --git a/docs/how-to/using-with-python.rst b/docs/how-to/using-with-python.rst index d5257ac69..46ec1209f 100644 --- a/docs/how-to/using-with-python.rst +++ b/docs/how-to/using-with-python.rst @@ -90,23 +90,11 @@ Given below is an example of a file reader, which takes a folder of images as in jpegs, _ = fn.readers.file(file_root=data_path, shard_id=local_rank, num_shards=world_size, random_shuffle=True) images = fn.decoders.image(jpegs, file_root=data_path, device=decoder_device, output_type=types.RGB, shard_id=0, num_shards=1, random_shuffle=True) images = fn.resize(images, device=rocal_device, resize_x=300, resize_y=300) -<<<<<<< HEAD:docs/user_guide/ch4.md -``` - -## 4.1.2 Defining the Pipeline - -To define a pipeline, see https://github.com/ROCm/rocAL/blob/master/rocAL_pybind/amd/rocal/pipeline.py#L29. - -``` -class Pipeline(object): -======= ->>>>>>> 80a9d60 (Documentation - reorg for diataxis (#102)):docs/how-to/using-with-python.rst - Defining the Pipeline ------------------------ -To define a pipeline, see `https://github.com/ROCm/rocAL/blob/master/rocAL_pybind/amd/rocal/pipeline.py#L29`. +To define a pipeline, see ``__. .. code-block:: shell :caption: Pipeline Class @@ -203,7 +191,7 @@ Running the Pipeline To run/use the pipeline, simply create a data loader using the pipeline and iterate through it to get the next batch of images with labels. -To run the pipeline, see `https://github.com/ROCm/rocAL/blob/master/tests/python_api/unit_test.py#L168` +To run the pipeline, see ``__. .. code-block:: python :caption: Run the Pipeline @@ -231,7 +219,7 @@ Performing Augmentations rocAL not only reads images from the disk and batches them into tensors, it can also perform various augmentations on those images. -To read images, decode them, and rotate them in the pipeline, see `https://github.com/ROCm/rocAL/blob/master/tests/python_api/unit_test.py#L77` +To read images, decode them, and rotate them in the pipeline, see ``__ .. code-block:: python :caption: Perform Augmentations @@ -261,7 +249,7 @@ To run the pipeline, see: rocAL Data Types ========================= -All the rocAL data types are defined under `amd.rocal.types `_. Import this library in the application to access the various data types such as rocAL status, processing mode, tensor output type, image size evaluation policy, image color, tensor layout, decode device, resize scaling mode, and resize interpolation type. +All the rocAL data types are defined under `amd.rocal.types `_. Import this library in the application to access the various data types such as rocAL status, processing mode, tensor output type, image size evaluation policy, image color, tensor layout, decode device, resize scaling mode, and resize interpolation type. Here are some of the commonly used rocAL data types: @@ -280,7 +268,7 @@ Here are some of the commonly used rocAL data types: * tensor_dtype = types.FLOAT * tensor_dtype = types.FLOAT16 -To see the usage of the above-mentioned data types, see `https://github.com/ROCm/rocAL/blob/master/rocAL_pybind/amd/rocal/pipeline.py#L97` +To see the usage of the above-mentioned data types, see ``__. .. code-block:: python diff --git a/docs/index.rst b/docs/index.rst index 500491d3d..499d91353 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -29,7 +29,7 @@ The rocAL documentation is structured as follows: * :ref:`install` - .. grid-item-card:: How-to + .. grid-item-card:: How to * :ref:`overview` * :ref:`architecture` diff --git a/docs/sphinx/_toc.yml.in b/docs/sphinx/_toc.yml.in index 313992e13..af228f647 100644 --- a/docs/sphinx/_toc.yml.in +++ b/docs/sphinx/_toc.yml.in @@ -7,7 +7,7 @@ subtrees: - file: install/install.rst title: Installation - file: how-to/index.rst - title: How To + title: How to subtrees: - entries: - file: how-to/overview.rst