# Datasets - how to add augmentations?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdatasets-how-to-add-augmentations%2F59788%3E%5C
**Category:** 🤗Datasets\
**Created:** [October 25, 2023, 4:13am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdatasets-how-to-add-augmentations%2F59788 "2023-10-25T04:13:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ifedorov](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@ifedorov](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fifedorov)%5C
**Post date:** [October 25, 2023, 4:13am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdatasets-how-to-add-augmentations%2F59788%2F1 "2023-10-25T04:13:01Z")

</div>

Hi. I want to add random augmentations to my dataset. Meaning that I do not want to perform augmentations once during the creating of the dataset, but rather to generate the augmentation randomly during training. This is usually implemented in **getitem** method of default pytorch dataset class. Is it possible to make this functionality with current version of Datasets package?

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmariosasko)%5C
**Post date:** [October 25, 2023, 4:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdatasets-how-to-add-augmentations%2F59788%2F2 "2023-10-25T16:09:27Z")

</div>

You can use [`set_transform`](https://huggingface.co/docs/datasets/v2.14.5/en/process#format-transform) for this.
