ResidualBlock
public struct ResidualBlock<Element, Device> : LayerType where Element : RandomizableType, Device : DeviceType
Residual block with two convolution and batch normalization layers as well as an optional downsampling block.
-
Declaration
Swift
public var parameterPaths: [WritableKeyPath<`Self`, Tensor<Element, Device>>] { get }
-
Declaration
Swift
public var parameters: [Tensor<Element, Device>] { get }
-
First convolution layer
Declaration
Swift
public var conv1: Convolution2D<Element, Device>
-
Second convolution layer
Declaration
Swift
public var conv2: Convolution2D<Element, Device>
-
First batch normalization layer
Declaration
Swift
public var bn1: BatchNorm<Element, Device>
-
Second batch normalization layer
Declaration
Swift
public var bn2: BatchNorm<Element, Device>
-
Optional downsampling layer (conv+batchnorm)
Declaration
Swift
public var downsample: Sequential<Convolution2D<Element, Device>, BatchNorm<Element, Device>>?
-
Undocumented
Declaration
Swift
public init(inputShape: [Int], outPlanes: Int, downsample: Int)