composer
Composer Model API
This module provides utility functions to compose a sequential set of networks/layers.
Classes:
-
ComposerLayerParams
–Composer layer parameters
-
ComposerParams
–Composer Network parameters
-
ComposerModel
–Helper class to generate model from parameters
Functions:
-
composer_layer
–Composes a sequential set of networks/layers
Classes
ComposerLayerParams
ComposerParams
Composer Network parameters
Attributes:
-
layers
(list[ComposerLayerParams]
) –Network layers
-
include_top
(bool
) –Include top
-
output_activation
(str | None
) –Output activation
-
name
(str
) –Model name
ComposerModel
Helper class to generate model from parameters
Functions
layer_from_params
staticmethod
layer_from_params(inputs: keras.Input, params: ComposerParams | dict, num_classes: int | None = None)
Create layer from parameters
Source code in neuralspot_edge/models/composer.py
model_from_params
staticmethod
model_from_params(inputs: keras.Input, params: ComposerParams | dict, num_classes: int | None = None)
Create model from parameters
Source code in neuralspot_edge/models/composer.py
Functions
composer_layer
composer_layer(x: keras.KerasTensor, params: ComposerParams, num_classes: int | None = None) -> keras.KerasTensor
Composes a sequential set of networks/layers. Useful for adding custom layers to a pre-trained model (e.g. foundation).
Parameters:
-
x
(KerasTensor
) –Model input
-
params
(ComposerParams
) –Model parameters
-
num_classes
(int | None
, default:None
) –Number of classes
Returns:
-
KerasTensor
–keras.KerasTensor: Model output