UpSampling2D

class UpSampling2D(size: IntArray, interpolation: InterpolationMethod, name: String) : AbstractUpSampling

Upsampling layer for 2D input.

Repeats each row (second axis) and columns (third axis) of the input by size[0] and size[1] times, respectively.

Input shape: 4D tensor with shape (batch_size, rows, cols, channels).

Output shape: 4D tensor with shape (batch_size, rows * size[0], cols * size[1], channels).

Since

0.3

Constructors

UpSampling2D
Link copied to clipboard
fun UpSampling2D(size: IntArray = intArrayOf(2, 2), interpolation: InterpolationMethod = InterpolationMethod.NEAREST, name: String = "")

Functions

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

Extend this function to define variables in the layer and compute layer output.

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

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.

interpolation
Link copied to clipboard
val interpolation: InterpolationMethod

Interpolation method; could be either of InterpolationMethod.NEAREST or InterpolationMethod.BILINEAR.

interpolationInternal
Link copied to clipboard
val interpolationInternal: InterpolationMethod

Interpolation method used for filling values (only applicable to 2D data for the moment).

name
Link copied to clipboard
var name: String

Layer name. A new name is generated during model compilation when provided name is empty.

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.

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

Model where this layer is used.

size
Link copied to clipboard
val size: IntArray

Upsampling factor array of size 2 (i.e. number of repeats per rows and columns).

sizeInternal
Link copied to clipboard
val sizeInternal: IntArray

UpSampling size factors; currently, they are not used in the implementation of this abstract class and each subclassed layer uses its own copy of the upsampling size factors.