DepthwiseConv2D

class DepthwiseConv2D(kernelSize: LongArray, strides: LongArray, dilations: LongArray, activation: Activations, depthMultiplier: Int, depthwiseInitializer: Initializer, biasInitializer: Initializer, depthwiseRegularizer: Regularizer?, biasRegularizer: Regularizer?, activityRegularizer: Regularizer?, padding: ConvPadding, useBias: Boolean, name: String) : AbstractConv, NoGradients

Depthwise separable 2D convolution. (e.g. spatial convolution over images).

Depthwise Separable convolutions consist of performing just the first step in a depthwise spatial convolution (which acts on each input channel separately). The depthMultiplier argument controls how many output channels are generated per input channel in the depthwise step.

Since

0.2

Constructors

DepthwiseConv2D
Link copied to clipboard
fun DepthwiseConv2D(kernelSize: LongArray = longArrayOf(3, 3), strides: LongArray = longArrayOf(1, 1, 1, 1), dilations: LongArray = longArrayOf(1, 1, 1, 1), activation: Activations = Activations.Relu, depthMultiplier: Int = 1, depthwiseInitializer: Initializer = HeNormal(), biasInitializer: Initializer = HeUniform(), depthwiseRegularizer: Regularizer? = null, biasRegularizer: Regularizer? = null, activityRegularizer: Regularizer? = null, padding: ConvPadding = ConvPadding.SAME, useBias: Boolean = true, name: String = "")

Creates DepthwiseConv2D object.

Functions

build
Link copied to clipboard
open override fun build(tf: Ops, kGraph: KGraph, inputShape: Shape)

Extend this function to define variables in layer.

buildFromInboundLayers
Link copied to clipboard
fun buildFromInboundLayers(tf: Ops, kGraph: KGraph)

Extend this function to define variables in layer.

computeOutputShape
Link copied to clipboard
open override fun computeOutputShape(inputShape: Shape): Shape

Computes output shape, based on inputShape and Layer type.

computeOutputShapeFromInboundLayers
Link copied to clipboard
open fun computeOutputShapeFromInboundLayers(): TensorShape

Computes output shape, based on input shapes of inbound layers.

forward
Link copied to clipboard
open override fun forward(tf: Ops, input: Operand<Float>, isTraining: Operand<Boolean>, numberOfLosses: Operand<Float>?): Operand<Float>

Builds main layer input transformation with tf. Depends on Layer type.

open fun forward(tf: Ops, input: List<Operand<Float>>, isTraining: Operand<Boolean>, numberOfLosses: Operand<Float>?): Operand<Float>

Builds main layer input transformation with tf. Depends on Layer type.

invoke
Link copied to clipboard
operator fun invoke(vararg layers: Layer): Layer

Important part of functional API. It takes layers as input and saves them to the inboundLayers of the given layer.

toString
Link copied to clipboard
open override fun toString(): String

Properties

activation
Link copied to clipboard
val activation: Activations

Activation function.

activityRegularizer
Link copied to clipboard
val activityRegularizer: Regularizer? = null

Regularizer function applied to the output of the layer (its "activation").

biasInitializer
Link copied to clipboard
val biasInitializer: Initializer

An initializer for the bias vector.

biasRegularizer
Link copied to clipboard
val biasRegularizer: Regularizer? = null

Regularizer function applied to the bias vector.

biasShapeArray
Link copied to clipboard
val biasShapeArray: LongArray

Returns the shape of bias weights.

depthMultiplier
Link copied to clipboard
val depthMultiplier: Int = 1

The number of depthwise convolution output channels for each input channel. The total number of depthwise convolution output channels will be equal to numberOfChannels * depthMultiplier.

depthwiseInitializer
Link copied to clipboard
val depthwiseInitializer: Initializer

An initializer for the depthwise kernel matrix.

depthwiseRegularizer
Link copied to clipboard
val depthwiseRegularizer: Regularizer? = null

Regularizer function applied to the depthwise kernel matrix.

dilations
Link copied to clipboard
val dilations: LongArray

Four numbers, specifying the dilation rate to use for dilated convolution for each dimension of input tensor.

hasActivation
Link copied to clipboard
open override val hasActivation: Boolean

Returns True, if layer has internal activation function.

inboundLayers
Link copied to clipboard
var inboundLayers: MutableList<Layer>

Returns inbound layers.

isTrainable
Link copied to clipboard
var isTrainable: Boolean = true

True, if layer's weights could be changed during training. If false, layer's weights are frozen and could be changed during the training.

kernelShapeArray
Link copied to clipboard
val kernelShapeArray: LongArray

Returns the shape of kernel weights.

kernelSize
Link copied to clipboard
val kernelSize: LongArray

Two long numbers, specifying the height and width of the 2D convolution window.

name
Link copied to clipboard
var name: String
outboundLayers
Link copied to clipboard
var outboundLayers: MutableList<Layer>

Returns outbound layers.

outputShape
Link copied to clipboard
lateinit var outputShape: TensorShape

Output data tensor shape.

padding
Link copied to clipboard
val padding: ConvPadding

The padding method, either 'valid' or 'same' or 'full'.

paramCount
Link copied to clipboard
open override val paramCount: Int

Returns amount of neurons.

parentModel
Link copied to clipboard
var parentModel: TrainableModel? = null

Model where this layer is used.

strides
Link copied to clipboard
val strides: LongArray

Strides of the pooling operation for each dimension of input tensor. NOTE: Specifying any stride value != 1 is incompatible with specifying any dilation_rate value != 1.

useBias
Link copied to clipboard
val useBias: Boolean = true

If true the layer uses a bias vector.

weights
Link copied to clipboard
open override var weights: Map<String, Array<*>>

Layer's weights.