Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Some Doc errors in Losses and testlosses #229

Merged
merged 1 commit into from
Jun 13, 2019
Merged
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
5 changes: 5 additions & 0 deletions Sources/TensorFlow/Loss.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public func hingeLoss<Scalar: TensorFlowFloatingPoint>(
return max(Tensor(1) - expected * predicted, Tensor(0)).mean()
}

/// Returns the squared hinge loss between predictions and expectations.
///
/// - Parameters:
/// - predicted: Predicted outputs from a neural network.
/// - expected: Expected values, i.e. targets, that correspond to the correct output.
@differentiable(wrt: predicted)
public func squaredHingeLoss<Scalar: TensorFlowFloatingPoint>(
predicted: Tensor<Scalar>, expected: Tensor<Scalar>
Expand Down
2 changes: 1 addition & 1 deletion Tests/TensorFlowTests/LossTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ final class LossTests: XCTestCase {
("testHingeLoss", testHingeLoss),
("testCategoricalHingeLoss", testCategoricalHingeLoss),
("testSquaredHingeLoss", testSquaredHingeLoss),
("testPoissonLoss",testPoissonLoss),
("testPoissonLoss", testPoissonLoss),
("testSoftmaxCrossEntropyWithProbabilitiesLoss",
testSoftmaxCrossEntropyWithProbabilitiesLoss),
("testSoftmaxCrossEntropyWithProbabilitiesGrad",
Expand Down