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

Commit fe4db75

Browse files
jrabaryeaplatanios
andauthored
Improve doc string
Co-Authored-By: Anthony Platanios <[email protected]>
1 parent cdfcd14 commit fe4db75

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/TensorFlow/Loss.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,10 @@ public func sigmoidCrossEntropy<Scalar: TensorFlowFloatingPoint>(
293293

294294
/// Returns the Huber loss between predictions and expectations.
295295
///
296-
/// For each value x in error = exprected - predicted
297-
/// loss = 0.5 * x^2 if |x| <= ∂
298-
/// loss = 0.5 * ∂^2 + ∂ * (|x| - ∂) if |x| > ∂
299-
/// See: https://en.wikipedia.org/wiki/Huber_loss
296+
/// For each value `x` in the difference `exprected - predicted`, the loss equals `0.5 * x^2` if
297+
/// `abs(x) <= δ`, or `0.5 * δ^2 + δ * (|x| - δ)` otherwise.
298+
///
299+
/// - Source: [Uncyclopedia article](https://en.wikipedia.org/wiki/Huber_loss).
300300
///
301301
/// - Parameters:
302302
/// - predicted: Predicted outputs from a neural network.
@@ -316,4 +316,4 @@ public func huberLoss<Scalar: TensorFlowFloatingPoint>(
316316
let quadratic = min(absError, delta)
317317
let linear = absError - quadratic
318318
return reduction((0.5 * quadratic * quadratic) + (delta * linear))
319-
}
319+
}

0 commit comments

Comments
 (0)