EscVM / EscVM/RAMS

Data augmentation seemingly not doing anything

Open
#15 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
94
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Hello @fsalv ,

I'm curious about the random flips and rotations.

In training.py, [LL119-121](https://github.com/EscVM/RAMS/blob/bc16e52b8e2d7b5e23560e14045f13f181d03f77/utils/training.py#L120):

```python
if data_aug:
train_ds.map(random_rotate, num_parallel_calls=tf.data.experimental.AUTOTUNE)
train_ds.map(random_flip, num_parallel_calls=tf.data.experimental.AUTOTUNE)
```

I believe ``.map`` is NOT an in-place operator so I don't think this is doing anything. To check this, we can adapt the example from the Tensorflow documentation here: https://www.tensorflow.org/api_docs/python/tf/data/Dataset#map

```python
from tensorflow.data import Dataset
dataset = Dataset.range(1, 6) # ==> [ 1, 2, 3, 4, 5 ]
dataset.map(lambda x: x + 1)
list(dataset.as_numpy_iterator()) # [1, 2, 3, 4, 5] map had no effect

dataset = Dataset.range(1, 6) # ==> [ 1, 2, 3, 4, 5 ]
dataset = dataset.map(lambda x: x + 1)
list(dataset.as_numpy_iterator()) # [2, 3, 4, 5, 6] expected output
```

Does this seem like a bug to you? If so, could you please advise if you think your pretrained models were affected?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.