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

Commit 20a0923

Browse files
jon-towrxwei
authored andcommitted
Add consistent parameter naming in loss docs (#245)
1 parent efc6acf commit 20a0923

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Sources/TensorFlow/Loss.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,35 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
/// Returns the L1 loss between predictions and labels.
15+
/// Returns the L1 loss between predictions and expectations.
1616
///
1717
/// - Parameters:
1818
/// - predicted: Predicted outputs from a neural network.
19-
/// - labels: Expected values, i.e. targets, that correspond to the correct output.
19+
/// - expected: Expected values, i.e. targets, that correspond to the correct output.
2020
@differentiable(wrt: predicted)
2121
public func l1Loss<Scalar: TensorFlowFloatingPoint>(
2222
predicted: Tensor<Scalar>, expected: Tensor<Scalar>
2323
) -> Tensor<Scalar> {
2424
return abs(expected - predicted).sum()
2525
}
2626

27-
/// Returns the L2 loss between predictions and labels.
27+
/// Returns the L2 loss between predictions and expectations.
2828
///
2929
/// - Parameters:
3030
/// - predicted: Predicted outputs from a neural network.
31-
/// - labels: Expected values, i.e. targets, that correspond to the correct output.
31+
/// - expected: Expected values, i.e. targets, that correspond to the correct output.
3232
@differentiable(wrt: predicted)
3333
public func l2Loss<Scalar: TensorFlowFloatingPoint>(
3434
predicted: Tensor<Scalar>, expected: Tensor<Scalar>
3535
) -> Tensor<Scalar> {
3636
return (expected - predicted).squared().sum()
3737
}
3838

39-
/// Returns the mean squared error between predictions and labels.
39+
/// Returns the mean squared error between predictions and expectations.
4040
///
4141
/// - Parameters:
4242
/// - predicted: Predicted outputs from a neural network.
43-
/// - labels: Expected values, i.e. targets, that correspond to the correct output.
43+
/// - expected: Expected values, i.e. targets, that correspond to the correct output.
4444
@differentiable(wrt: predicted)
4545
public func meanSquaredError<Scalar: TensorFlowFloatingPoint>(
4646
predicted: Tensor<Scalar>, expected: Tensor<Scalar>

0 commit comments

Comments
 (0)