Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: fix broken links (#141) #142

Merged
merged 5 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions docs/how-to/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,22 @@ 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 <https://github.com/ROCm/rocAL/blob/master/docs/examples/pytorch/toynet_training/train.py#L78>`_.

.. 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 <https://github.com/ROCm/rocAL/blob/master/docs/examples/pytorch/toynet_training/train.py#L179>`_.
Expand Down Expand Up @@ -130,7 +130,7 @@ Create Data-loading Pipeline

Follow these steps:

1. Import libraries for `rocAL_pybind <https://github.com/ROCm/rocAL/blob/master/docs/examples/tf/pets_training/train.py.py#L22>`_.
1. Import libraries for `rocAL_pybind <https://github.com/ROCm/rocAL/blob/master/docs/examples/tf/pets_training/train.py#L22>`_.

.. code-block:: python
:caption: Import libraries
Expand All @@ -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 <https://github.com/ROCm/rocAL/blob/master/docs/examples/tf/pets_training/train.py.py#L128>`_.
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 <https://github.com/ROCm/rocAL/blob/master/docs/examples/tf/pets_training/train.py#L128>`_.

.. code-block:: python
:caption: Pipeline for TensorFlow
Expand Down Expand Up @@ -170,7 +170,7 @@ Follow these steps:
trainPipe.build()


3. Import libraries for `TensorFlow <https://github.com/ROCm/rocAL/blob/master/docs/examples/tf/pets_training/train.py.py#L174>`_.
3. Import libraries for `TensorFlow <https://github.com/ROCm/rocAL/blob/master/docs/examples/tf/pets_training/train.py#L174>`_.

.. code-block:: python
:caption: Import libraries for TensorFlow
Expand All @@ -193,7 +193,6 @@ Follow these steps:

4. To see and run a sample training script, refer to `rocAL TensorFlow example <https://github.com/ROCm/rocAL/tree/master/rocAL/docs/examples/tf/pets_training>`_.


.. __resnet50:

Run Resnet50 classification training with rocAL
yhuiYH marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -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 <https://github.com/ROCm/rocAL/tree/master/rocAL/docs/examples/pytorch/imagenet_training>`_.
#. To see and run a sample training script, refer to `rocAL Imagenet example <https://github.com/ROCm/rocAL/tree/master/docs/examples/pytorch/imagenet_training>`_.


22 changes: 5 additions & 17 deletions docs/how-to/using-with-python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<https://github.com/ROCm/rocAL/blob/master/rocAL_pybind/amd/rocal/pipeline.py#L29>`__.

.. code-block:: shell
:caption: Pipeline Class
Expand Down Expand Up @@ -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 `<https://github.com/ROCm/rocAL/blob/master/tests/python_api/unit_test.py#L168>`__.

.. code-block:: python
:caption: Run the Pipeline
Expand Down Expand Up @@ -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 `<https://github.com/ROCm/rocAL/blob/master/tests/python_api/unit_test.py#L77>`__

.. code-block:: python
:caption: Perform Augmentations
Expand Down Expand Up @@ -261,7 +249,7 @@ To run the pipeline, see:
rocAL Data Types
=========================

All the rocAL data types are defined under `amd.rocal.types <https://github.com/ROCm/rocAL/blob/master/rocAL/rocAL_pybind/amd/rocal/types.py>`_. 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 <https://github.com/ROCm/rocAL/blob/master/rocAL_pybind/amd/rocal/types.py>`_. 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:

Expand All @@ -280,7 +268,7 @@ Here are some of the commonly used rocAL data types:
* tensor_dtype = types.FLOAT
yhuiYH marked this conversation as resolved.
Show resolved Hide resolved
* 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 `<https://github.com/ROCm/rocAL/blob/master/rocAL_pybind/amd/rocal/pipeline.py#L97>`__.

.. code-block:: python

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/_toc.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down