espnet2.enh.layers.dcunet.unet_decoder_args
Less than 1 minute
espnet2.enh.layers.dcunet.unet_decoder_args
espnet2.enh.layers.dcunet.unet_decoder_args(encoders, *, skip_connections)
Get list of decoder arguments for upsampling (right) side of a symmetric u-net.
This function generates the arguments needed to construct the decoder layers of a U-Net architecture based on the encoder parameters. The output can include skip connections if specified.
- Parameters:
- of (encoders *(*tuple of length N of tuples) – (in_chan, out_chan, kernel_size, stride, padding)): List of arguments used to construct the encoders.
- skip_connections (bool) – Whether to include skip connections in the calculation of decoder input channels.
- Returns: tuple of length N of tuples of : (in_chan, out_chan, kernel_size, stride, padding): Arguments to be used to construct decoders.
Examples
>>> encoder_args = (
... (1, 32, (7, 5), (2, 2), "auto"),
... (32, 64, (7, 5), (2, 2), "auto"),
... )
>>> decoder_args = unet_decoder_args(encoder_args, skip_connections=True)
>>> print(decoder_args)
((64, 32, (7, 5), (2, 2), 'auto'), (64, 1, (7, 5), (2, 2), 'auto'))
NOTE
The decoder input channels are calculated based on the output channels of the corresponding encoder layers and the specified skip connection policy.