augmentation
Classes
Functions
create_augmentation_layer
Create an augmentation layer from a configuration
Parameters:
-
(augmentationNamedParams) –Augmentation configuration
-
(sampling_rateint) –Sampling rate of the data
Returns:
-
Layer–keras.Layer: Augmentation layer
Example:
import heartkit as hk
x = keras.random.normal
layer = hk.datasets.augmentation.create_augmentation_layer(
hk.NamedParams(name="random_noise", params={"factor": 0.01}),
sampling_rate=100
)
y = layer(x)
Source code in heartkit/datasets/augmentation.py
create_augmentation_pipeline
create_augmentation_pipeline(
augmentations: list[NamedParams], sampling_rate: int
) -> helia.layers.preprocessing.AugmentationPipeline
Create an augmentation pipeline from a list of augmentation configurations.
This is useful when running from a configuration file to hydrate the pipeline.
Parameters:
-
(augmentationslist[NamedParams]) –List of augmentation configurations
-
(sampling_rateint) –Sampling rate of the data
Returns:
-
AugmentationPipeline–helia.layers.preprocessing.AugmentationPipeline: Augmentation pipeline
Example:
```python import heartkit as hk x = keras.random.normal(shape=(256, 1), dtype="float32")
augmenter = hk.datasets.create_augmentation_pipeline([ hk.NamedParams(name="random_noise", params={"factor": 0.01}), hk.NamedParams(name="random_cutout", params={"factor": 0.01, "cutouts": 2}), ], sampling_rate=100)
y = augmenter(x)