We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It would be great if DataLoaders could facilitate data augmentation on batches. I would like to make a proposal for a possible implementation of this.
DataLoader
Start by defining what an augmentation is:
typealias Augmentation = (SomeBatch) -> SomeBatch
Then create a modifier as proposed in #14:
func augmenting(_ augmentation: @escaping Augmentation) -> Self { var mutableSelf = self.copy() mutableSelf.augmentation = augmentation return mutableSelf }
Make this a requirement on all S5TFDataLoaders:
S5TFDataLoaders
var augmentation: Augmentation? { get }
Apply the augmentation when loading data (in getElement(at:)):
getElement(at:)
listOfData.map(augmentation)
Result:
MNIST.train.augmenting(flipRight).augmenting(blur(0.2)).batched(32)
We should offer a list of predefined augmentations using SwiftCV.
Simplified example: https://colab.research.google.com/drive/1YCyx59FXcDXDrtGBHcRFKmbakSNScAJk.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be great if
DataLoader
s could facilitate data augmentation on batches. I would like to make a proposal for a possible implementation of this.Start by defining what an augmentation is:
Then create a modifier as proposed in #14:
Make this a requirement on all
S5TFDataLoaders
:Apply the augmentation when loading data (in
getElement(at:)
):Result:
We should offer a list of predefined augmentations using SwiftCV.
Simplified example: https://colab.research.google.com/drive/1YCyx59FXcDXDrtGBHcRFKmbakSNScAJk.
The text was updated successfully, but these errors were encountered: