# helia_edge.models.regnet

## RegNet Model API

This module provides utility functions to generate RegNet models.

Fore more information, please refer to the following paper: https://arxiv.org/abs/2101.00590

Parameters are in ``helia_edge.models.regnet_params``.

**Functions**

| Name | Description |
| --- | --- |
| `build` | RegNet model from ``RegNetParams`` |
| `regnet_core` | RegNet core |
| `regnet_layer` | Generate RegNet model |

## helia_edge.models.regnet.yblock

`function` · `python`

```python
yblock(
    output_filters: int = 0,
    group_width: int = 0,
    kernel_size: int | tuple[int, int] = 3,
    strides: int | tuple[int, int] = 1,
    se_ratio: float = 4,
    activation: str = 'relu6',
    name: str | None = None,
) -> Callable[[keras.KerasTensor], keras.KerasTensor]
```

RegNet Y-Block

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| output_filters | int | 0 | Number of output filters. Defaults to 0. |
| group_width | int | 0 | Group width. Defaults to 0. |
| kernel_size | int \| tuple[int, int] | 3 | Kernel size. Defaults to 3. |
| strides | int \| tuple[int, int] | 1 | Stride length. Defaults to 1. |
| se_ratio | float | 4 | SE ratio. Defaults to 4. |
| activation | str | 'relu6' | Activation function. Defaults to "relu6". |
| name | str \| None | None | Block name. Defaults to None. |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
|  | Callable[[keras.KerasTensor], keras.KerasTensor] | Callable[[keras.KerasTensor], keras.KerasTensor]: Functional layer |

Source: `helia_edge/models/regnet.py:28`

## helia_edge.models.regnet.zblock

`function` · `python`

```python
zblock(
    output_filters: int = 0,
    group_width: int = 0,
    kernel_size: int | tuple[int, int] = 3,
    strides: int | tuple[int, int] = 1,
    se_ratio: float = 4,
    activation: str = 'relu6',
    name: str | None = None,
) -> Callable[[keras.KerasTensor], keras.KerasTensor]
```

RegNet X-Block

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| output_filters | int | 0 | Number of output filters. Defaults to 0. |
| group_width | int | 0 | Group width. Defaults to 0. |
| kernel_size | int \| tuple[int, int] | 3 | Kernel size. Defaults to 3. |
| strides | int \| tuple[int, int] | 1 | Stride length. Defaults to 1. |
| se_ratio | float | 4 | SE ratio. Defaults to 4. |
| activation | str | 'relu6' | Activation function. Defaults to "relu6". |
| name | str \| None | None | Block name. Defaults to None. |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
|  | Callable[[keras.KerasTensor], keras.KerasTensor] | Callable[[keras.KerasTensor], keras.KerasTensor]: Functional layer |

Source: `helia_edge/models/regnet.py:94`

## helia_edge.models.regnet.regnet_core

`function` · `python`

```python
regnet_core(
    blocks: list[RegNetBlockParam],
    block_style: Literal['y', 'z'] = 'y',
) -> Callable[[keras.KerasTensor], keras.KerasTensor]
```

RegNet core

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| blocks | list[RegNetBlockParam] | Required | Block params |
| block_style | float | 'y' | Block style. Defaults to 'y'. |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
|  | Callable[[keras.KerasTensor], keras.KerasTensor] | Callable[[keras.KerasTensor], keras.KerasTensor]: Core |

Source: `helia_edge/models/regnet.py:158`

## helia_edge.models.regnet.regnet_layer

`function` · `python`

```python
regnet_layer(x: keras.KerasTensor, params: RegNetParams) -> keras.KerasTensor
```

Create RegNet TF functional model

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| x | keras.KerasTensor | Required | Input tensor |
| params | RegNetParams | Required | Model parameters. |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
|  | keras.KerasTensor | keras.KerasTensor: Output tensor |

Source: `helia_edge/models/regnet.py:194`

## helia_edge.models.regnet.build

`function` · `python`

```python
build(
    params: RegNetParams,
    input_shape: tuple[int | None, ...],
    *,
    batch_size: int | None = None,
    name: str | None = None,
) -> keras.Model
```

Build a RegNet model.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| params | RegNetParams | Required | Model parameters. |
| input_shape | tuple[int \| None, ...] | Required | Input shape without the batch axis; None for a variable axis. |
| batch_size | int \| None | None | Static batch size; None for a dynamic batch. |
| name | str \| None | None | Model name; the family when None. |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
|  | keras.Model | keras.Model: The model, named ``regnet`` unless ``name`` is given. |

Source: `helia_edge/models/regnet.py:248`
