Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Autoencoder/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct Autoencoder: Layer {
activation: tanh)

@differentiable
func call(_ input: Input) -> Output {
func callAsFunction(_ input: Input) -> Output {
let encoder = input.sequenced(through: encoder1, encoder2, encoder3, encoder4)
return encoder.sequenced(through: decoder1, decoder2, decoder3, decoder4)
}
Expand Down
2 changes: 1 addition & 1 deletion Gym/CartPole/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct Net: Layer {
}

@differentiable
func call(_ input: Input) -> Output {
func callAsFunction(_ input: Input) -> Output {
return input.sequenced(through: l1, l2)
}
}
Expand Down
2 changes: 1 addition & 1 deletion MNIST/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct Classifier: Layer {
var layer1b = Dense<Float>(inputSize: 128, outputSize: 10, activation: softmax)

@differentiable
func call(_ input: Input) -> Output {
func callAsFunction(_ input: Input) -> Output {
let convolved = input.sequenced(through: conv1a, conv1b, pool1)
return convolved.sequenced(through: dropout1a, flatten, layer1a, dropout1b, layer1b)
}
Expand Down
6 changes: 3 additions & 3 deletions MiniGo/Models/GoModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct ConvBN: Layer {
}

@differentiable
func call(_ input: Tensor<Float>) -> Tensor<Float> {
func callAsFunction(_ input: Tensor<Float>) -> Tensor<Float> {
return norm(conv(input))
}
}
Expand Down Expand Up @@ -90,7 +90,7 @@ struct ResidualIdentityBlock: Layer {
}

@differentiable
func call(_ input: Tensor<Float>) -> Tensor<Float> {
func callAsFunction(_ input: Tensor<Float>) -> Tensor<Float> {
var tmp = relu(layer1(input))
tmp = layer2(tmp)
return relu(tmp + input)
Expand Down Expand Up @@ -158,7 +158,7 @@ public struct GoModel: Layer {
}

@differentiable(wrt: (self, input), vjp: _vjpCall)
public func call(_ input: Tensor<Float>) -> GoModelOutput {
public func callAsFunction(_ input: Tensor<Float>) -> GoModelOutput {
let batchSize = input.shape[0]
var output = relu(initialConv(input))

Expand Down