espnet2.enh.layers.adapt_layers.make_adapt_layer
espnet2.enh.layers.adapt_layers.make_adapt_layer
espnet2.enh.layers.adapt_layers.make_adapt_layer(type, indim, enrolldim, ninputs=1)
Creates an adaptation layer based on the specified type.
This function returns an instance of an adaptation layer class defined in the adaptation_layer_types dictionary. The type of layer to create is specified by the type argument. The input dimensions and enrollment dimensions must also be provided.
espnet2.enh.layers.adapt_layers.type
The type of adaptation layer to create. Possible values are “concat”, “muladd”, and “mul”.
- Type: str
espnet2.enh.layers.adapt_layers.indim
The input dimension for the adaptation layer.
- Type: int
espnet2.enh.layers.adapt_layers.enrolldim
The enrollment dimension for the adaptation layer.
- Type: int
espnet2.enh.layers.adapt_layers.ninputs
The number of input tensors to the layer. Defaults to 1.
Type: int, optional
Parameters:
- type (str) – The type of adaptation layer to create.
- indim (int) – The input dimension for the adaptation layer.
- enrolldim (int) – The enrollment dimension for the adaptation layer.
- ninputs (int , optional) – The number of input tensors to the layer. Defaults to 1.
Returns: An instance of the specified adaptation layer class.
Return type: nn.Module
Raises:KeyError – If the specified type does not exist in adaptation_layer_types.
Examples
>>> layer = make_adapt_layer("concat", 128, 256)
>>> print(layer)
ConcatAdaptLayer(...)
>>> layer = make_adapt_layer("muladd", 128, 256, ninputs=2)
>>> print(layer)
MulAddAdaptLayer(...)