Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit b6593df

Browse files
author
marcrasi
authored
work around duplicate definition of diff witness (#234)
1 parent 14e694d commit b6593df

File tree

6 files changed

+17
-9
lines changed

6 files changed

+17
-9
lines changed

MiniGo/Models/GoModel.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ struct ConvBN: Layer {
5353
) {
5454
// TODO(jekbradbury): thread through bias and affine boolean arguments
5555
// (behavior is correct for inference but this should be changed for training)
56-
self.conv = Conv2D(filterShape: filterShape, strides: strides, padding: padding)
56+
self.conv = Conv2D(
57+
filterShape: filterShape, strides: strides, padding: padding, activation: identity)
5758
self.norm = BatchNorm(featureCount: filterShape.3, momentum: 0.95, epsilon: 1e-5)
5859
}
5960

Models/ImageClassification/DenseNet121.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ extension DenseNet121 {
7171
conv = Conv2D(
7272
filterShape: (filterSize, filterSize, inputFilterCount, outputFilterCount),
7373
strides: (stride, stride),
74-
padding: .same
74+
padding: .same,
75+
activation: identity
7576
)
7677
}
7778

Models/ImageClassification/LeNet-5.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public struct LeNet: Layer {
3030
public var flatten = Flatten<Float>()
3131
public var fc1 = Dense<Float>(inputSize: 400, outputSize: 120, activation: relu)
3232
public var fc2 = Dense<Float>(inputSize: 120, outputSize: 84, activation: relu)
33-
public var fc3 = Dense<Float>(inputSize: 84, outputSize: 10)
33+
public var fc3 = Dense<Float>(inputSize: 84, outputSize: 10, activation: identity)
3434

3535
public init() {}
3636

Models/ImageClassification/ResNet50.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public struct ConvBN: Layer {
3434
strides: (Int, Int) = (1, 1),
3535
padding: Padding = .valid
3636
) {
37-
self.conv = Conv2D(filterShape: filterShape, strides: strides, padding: padding)
37+
self.conv = Conv2D(
38+
filterShape: filterShape, strides: strides, padding: padding, activation: identity)
3839
self.norm = BatchNorm(featureCount: filterShape.3)
3940
}
4041

Models/ImageClassification/ResNetV2.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public struct Conv2DBatchNorm: Layer {
3030
strides: (Int, Int) = (1, 1),
3131
padding: Padding = .valid
3232
) {
33-
self.conv = Conv2D(filterShape: filterShape, strides: strides, padding: padding)
33+
self.conv = Conv2D(
34+
filterShape: filterShape, strides: strides, padding: padding, activation: identity)
3435
self.norm = BatchNorm(featureCount: filterShape.3)
3536
}
3637

Models/ImageClassification/WideResNet.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ public struct BatchNormConv2DBlock: Layer {
3939
self.conv1 = Conv2D(
4040
filterShape: (kernelSize, kernelSize, featureCounts.0, featureCounts.1),
4141
strides: strides,
42-
padding: padding)
42+
padding: padding,
43+
activation: identity)
4344
self.norm2 = BatchNorm(featureCount: featureCounts.1)
4445
self.conv2 = Conv2D(filterShape: (kernelSize, kernelSize, featureCounts.1, featureCounts.1),
4546
strides: (1, 1),
46-
padding: padding)
47+
padding: padding,
48+
activation: identity)
4749
self.shortcut = Conv2D(filterShape: (1, 1, featureCounts.0, featureCounts.1),
4850
strides: strides,
49-
padding: padding)
51+
padding: padding,
52+
activation: identity)
5053
self.isExpansion = featureCounts.1 != featureCounts.0 || strides != (1, 1)
5154
}
5255

@@ -102,7 +105,8 @@ public struct WideResNet: Layer {
102105
public var classifier: Dense<Float>
103106

104107
public init(depthFactor: Int = 2, widenFactor: Int = 8) {
105-
self.l1 = Conv2D(filterShape: (3, 3, 3, 16), strides: (1, 1), padding: .same)
108+
self.l1 = Conv2D(
109+
filterShape: (3, 3, 3, 16), strides: (1, 1), padding: .same, activation: identity)
106110

107111
self.l2 = WideResNetBasicBlock(
108112
featureCounts: (16, 16 * widenFactor), depthFactor: depthFactor, initialStride: (1, 1))

0 commit comments

Comments
 (0)