Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/DeepLearning/Layer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public extension Conv2D where Scalar.RawSignificand: FixedWidthInteger {
init<G: RandomNumberGenerator>(
filterShape: (Int, Int, Int, Int),
strides: (Int, Int) = (1, 1),
padding: Padding,
padding: Padding = .valid,
activation: @escaping Activation = identity,
generator: inout G
) {
Expand All @@ -190,7 +190,7 @@ public extension Conv2D where Scalar.RawSignificand: FixedWidthInteger {
init(
filterShape: (Int, Int, Int, Int),
strides: (Int, Int) = (1, 1),
padding: Padding,
padding: Padding = .valid,
activation: @escaping Activation = identity
) {
self.init(filterShape: filterShape, strides: strides, padding: padding,
Expand Down Expand Up @@ -284,7 +284,7 @@ public struct MaxPool2D<Scalar: TensorFlowFloatingPoint>: Layer {
/// The padding algorithm for pooling.
@noDerivative let padding: Padding

public init(poolSize: (Int, Int), strides: (Int, Int), padding: Padding) {
public init(poolSize: (Int, Int), strides: (Int, Int), padding: Padding = .valid) {
self.poolSize = (1, Int32(poolSize.0), Int32(poolSize.1), 1)
self.strides = (1, Int32(strides.0), Int32(strides.1), 1)
self.padding = padding
Expand All @@ -307,7 +307,7 @@ public struct AvgPool2D<Scalar: TensorFlowFloatingPoint>: Layer {
/// The padding algorithm for pooling.
@noDerivative let padding: Padding

public init(poolSize: (Int, Int), strides: (Int, Int), padding: Padding) {
public init(poolSize: (Int, Int), strides: (Int, Int), padding: Padding = .valid) {
self.poolSize = (1, Int32(poolSize.0), Int32(poolSize.1), 1)
self.strides = (1, Int32(strides.0), Int32(strides.1), 1)
self.padding = padding
Expand Down