Convolution..::..Conv2D Method (Variable, Int32, Tuple<(Of <(<'Int32, Int32>)>)>, Tuple<(Of <(<'Int32, Int32>)>)>, Boolean, Tuple<(Of <(<'Int32, Int32>)>)>, String, Boolean, String, String)

2D convolution layer (e.g. spatial convolution over images). This layer creates a convolution kernel that is convolved with the layer input to produce a tensor of outputs. If use_bias is True, a bias vector is created and added to the outputs. Finally, if activation is not None, it is applied to the outputs as well.

Namespace:  SiaNet.NN
Assembly:  SiaNet (in SiaNet.dll)

Syntax


public static Function Conv2D(
	Variable layer,
	int channels,
	Tuple<int, int> kernalSize,
	Tuple<int, int> strides,
	bool padding,
	Tuple<int, int> dialation,
	string activation,
	bool useBias,
	string weightInitializer,
	string biasInitializer
)
Public Shared Function Conv2D ( _
	layer As Variable, _
	channels As Integer, _
	kernalSize As Tuple(Of Integer, Integer), _
	strides As Tuple(Of Integer, Integer), _
	padding As Boolean, _
	dialation As Tuple(Of Integer, Integer), _
	activation As String, _
	useBias As Boolean, _
	weightInitializer As String, _
	biasInitializer As String _
) As Function
public:
static Function^ Conv2D(
	Variable^ layer, 
	int^ channels, 
	Tuple<int^, int^>^ kernalSize, 
	Tuple<int^, int^>^ strides, 
	bool^ padding, 
	Tuple<int^, int^>^ dialation, 
	String^ activation, 
	bool^ useBias, 
	String^ weightInitializer, 
	String^ biasInitializer
)

Parameters

layer
Type: Variable
The output of the last layer.
channels
Type: Int32
Integer, the dimensionality of the output space.
kernalSize
Type: Tuple<(Of <(<'Int32, Int32>)>)>
A tuple of 2 integers, specifying the width and height of the 2D convolution window. Can be a single integer to specify the same value for all spatial dimensions.
strides
Type: Tuple<(Of <(<'Int32, Int32>)>)>
A tuple of 2 integers, specifying the strides of the convolution along the width and height. Can be a single integer to specify the same value for all spatial dimensions. Specifying any stride value != 1 is incompatible with specifying any dilation_rate value != 1.
padding
Type: Boolean
Boolean, if true results in padding the input such that the output has the same length as the original input.
dialation
Type: Tuple<(Of <(<'Int32, Int32>)>)>
A tuple of 2 integers, specifying the dilation rate to use for dilated convolution. Can be a single integer to specify the same value for all spatial dimensions. Currently, specifying any dilation_rate value != 1 is incompatible with specifying any stride value != 1.
activation
Type: String
Activation function to use. If you don't specify anything, no activation is applied (ie. "linear" activation: a(x) = x). OptActivations
useBias
Type: Boolean
Boolean, whether the layer uses a bias vector.
weightInitializer
Type: String
Initializer for the kernel weights matrix. OptInitializers
biasInitializer
Type: String
Initializer for the bias vector. OptInitializers

Return Value