Conv2DOutput
- class lib.model.nn_blocks.Conv2DOutput(filters: int, kernel_size: int | tuple[int], activation: str = 'sigmoid', padding: str = 'same', **kwargs)
Bases:
objectA Convolution 2D layer that separates out the activation layer to explicitly set the data type on the activation to float 32 to fully support mixed precision training.
The Convolution 2D layer uses default parameters to be more appropriate for Faceswap architecture.
Parameters are the same, with the same defaults, as a standard
keras.layers.Conv2Dexcept where listed below. The default initializer is updated to HeUniform or convolutional aware based on user config settings.- Parameters:
filters (int) – The dimensionality of the output space (i.e. the number of output filters in the convolution)
kernel_size (int or tuple/list of 2 ints) – The height and width of the 2D convolution window. Can be a single integer to specify the same value for all spatial dimensions.
activation (str, optional) – The activation function to apply to the output. Default: “sigmoid”
padding (str, optional) – One of “valid” or “same” (case-insensitive). Default: “same”. Note that “same” is slightly inconsistent across backends with strides != 1, as described here.
kwargs (dict) – Any additional Keras standard layer keyword arguments to pass to the Convolutional 2D layer
Methods Summary
__call__(inputs)Call the Faceswap Convolutional Output Layer.
Methods Documentation
- __call__(inputs: KerasTensor) KerasTensor
Call the Faceswap Convolutional Output Layer.
- Parameters:
inputs (
keras.KerasTensor) – The input to the layer- Returns:
The output tensor from the Convolution 2D Layer
- Return type:
keras.KerasTensor
- __call__(inputs: KerasTensor) KerasTensor
Call the Faceswap Convolutional Output Layer.
- Parameters:
inputs (
keras.KerasTensor) – The input to the layer- Returns:
The output tensor from the Convolution 2D Layer
- Return type:
keras.KerasTensor