AbstractConv

abstract class AbstractConv(filtersInternal: Long, kernelSizeInternal: LongArray, stridesInternal: LongArray, dilationsInternal: LongArray, activationInternal: Activations, kernelInitializerInternal: Initializer, biasInitializerInternal: Initializer, kernelRegularizerInternal: Regularizer?, biasRegularizerInternal: Regularizer?, activityRegularizerInternal: Regularizer?, paddingInternal: ConvPadding, useBiasInternal: Boolean, kernelVariableName: String, biasVariableName: String, name: String) : Layer

Abstract Convolutional layer is a base block for building base types of convolutional layers of any dimensionality. It should simplify the internal calculations needed in most convolutional layers and abstract the naming weights for these layers. It keeps the actual implementation of convolutional layers, i.e., the kernel and bias learnable variables that should be used in child classes in actual implementations of these layers. If the child class uses some values for its implementation in other form than it is kept in this child class, then this abstract class internal properties should keep the implementation values while the child class properties should keep the printable values that are more representative. But in most cases, the internal and child values will be the same.

Parameters

name

of the layer to name its variables

Constructors

AbstractConv
Link copied to clipboard
fun AbstractConv(filtersInternal: Long, kernelSizeInternal: LongArray, stridesInternal: LongArray, dilationsInternal: LongArray, activationInternal: Activations, kernelInitializerInternal: Initializer, biasInitializerInternal: Initializer, kernelRegularizerInternal: Regularizer?, biasRegularizerInternal: Regularizer?, activityRegularizerInternal: Regularizer?, paddingInternal: ConvPadding, useBiasInternal: Boolean, kernelVariableName: String, biasVariableName: String, name: String)

Creates AbstractConv 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.

Properties

biasShapeArray
Link copied to clipboard
val biasShapeArray: LongArray

Returns the shape of bias weights.

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.

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.

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.

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

Layer's weights.

Inheritors

Conv1D
Link copied to clipboard
Conv2D
Link copied to clipboard
Conv3D
Link copied to clipboard
DepthwiseConv2D
Link copied to clipboard