# helia_edge.layers.preprocessing.random_crop

Random crops sharing sampled offsets across spatially aligned leaves.

## helia_edge.layers.preprocessing.random_crop.RandomCrop1D

`class` · `python`

```python
RandomCrop1D(duration: int, unique_batch: bool = False, **kwargs={})
```

Training-only crop; inference leaves the original duration unchanged.



Base class: [BaseAugmentation1D](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation1D).

Inherited from [BaseAugmentation](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation): [augment_masks()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_masks), [augment_sample()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_sample), [augment_targets()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_targets), [batch_augment()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.batch_augment), [call()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.call).

Source: `helia_edge/layers/preprocessing/random_crop.py:18`

### helia_edge.layers.preprocessing.random_crop.RandomCrop1D.joint

`attribute` · `python`

```python
joint = True
```

Source: `helia_edge/layers/preprocessing/random_crop.py:22`

### helia_edge.layers.preprocessing.random_crop.RandomCrop1D.duration

`attribute` · `python`

```python
duration = duration
```

Source: `helia_edge/layers/preprocessing/random_crop.py:28`

### helia_edge.layers.preprocessing.random_crop.RandomCrop1D.unique_batch

`attribute` · `python`

```python
unique_batch = unique_batch
```

Source: `helia_edge/layers/preprocessing/random_crop.py:29`

### helia_edge.layers.preprocessing.random_crop.RandomCrop1D.get_random_transformations

`method` · `python`

```python
get_random_transformations(input_shape)
```

Source: `helia_edge/layers/preprocessing/random_crop.py:31`

### helia_edge.layers.preprocessing.random_crop.RandomCrop1D.augment_samples

`method` · `python`

```python
augment_samples(inputs)
```

Source: `helia_edge/layers/preprocessing/random_crop.py:34`

### helia_edge.layers.preprocessing.random_crop.RandomCrop1D.get_config

`method` · `python`

```python
get_config()
```

Source: `helia_edge/layers/preprocessing/random_crop.py:42`

## helia_edge.layers.preprocessing.random_crop.RandomCrop2D

`class` · `python`

```python
RandomCrop2D(height: int, width: int, unique_batch: bool = False, **kwargs={})
```

Training-only image crop; inference leaves the original extent unchanged.



Base class: [BaseAugmentation2D](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation2D).

Inherited from [BaseAugmentation](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation): [augment_masks()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_masks), [augment_sample()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_sample), [augment_targets()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_targets), [batch_augment()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.batch_augment), [call()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.call).

Source: `helia_edge/layers/preprocessing/random_crop.py:46`

### helia_edge.layers.preprocessing.random_crop.RandomCrop2D.joint

`attribute` · `python`

```python
joint = True
```

Source: `helia_edge/layers/preprocessing/random_crop.py:50`

### helia_edge.layers.preprocessing.random_crop.RandomCrop2D.height

`attribute` · `python`

```python
height = height
```

Source: `helia_edge/layers/preprocessing/random_crop.py:56`

### helia_edge.layers.preprocessing.random_crop.RandomCrop2D.width

`attribute` · `python`

```python
width = width
```

Source: `helia_edge/layers/preprocessing/random_crop.py:57`

### helia_edge.layers.preprocessing.random_crop.RandomCrop2D.unique_batch

`attribute` · `python`

```python
unique_batch = unique_batch
```

Source: `helia_edge/layers/preprocessing/random_crop.py:58`

### helia_edge.layers.preprocessing.random_crop.RandomCrop2D.get_random_transformations

`method` · `python`

```python
get_random_transformations(input_shape)
```

Source: `helia_edge/layers/preprocessing/random_crop.py:60`

### helia_edge.layers.preprocessing.random_crop.RandomCrop2D.augment_samples

`method` · `python`

```python
augment_samples(inputs)
```

Source: `helia_edge/layers/preprocessing/random_crop.py:66`

### helia_edge.layers.preprocessing.random_crop.RandomCrop2D.get_config

`method` · `python`

```python
get_config()
```

Source: `helia_edge/layers/preprocessing/random_crop.py:76`
