|
12 | 12 | // See the License for the specific language governing permissions and
|
13 | 13 | // limitations under the License.
|
14 | 14 |
|
15 |
| -/// Returns the L1 loss between predictions and labels. |
| 15 | +/// Returns the L1 loss between predictions and expectations. |
16 | 16 | ///
|
17 | 17 | /// - Parameters:
|
18 | 18 | /// - 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. |
20 | 20 | @differentiable(wrt: predicted)
|
21 | 21 | public func l1Loss<Scalar: TensorFlowFloatingPoint>(
|
22 | 22 | predicted: Tensor<Scalar>, expected: Tensor<Scalar>
|
23 | 23 | ) -> Tensor<Scalar> {
|
24 | 24 | return abs(expected - predicted).sum()
|
25 | 25 | }
|
26 | 26 |
|
27 |
| -/// Returns the L2 loss between predictions and labels. |
| 27 | +/// Returns the L2 loss between predictions and expectations. |
28 | 28 | ///
|
29 | 29 | /// - Parameters:
|
30 | 30 | /// - 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. |
32 | 32 | @differentiable(wrt: predicted)
|
33 | 33 | public func l2Loss<Scalar: TensorFlowFloatingPoint>(
|
34 | 34 | predicted: Tensor<Scalar>, expected: Tensor<Scalar>
|
35 | 35 | ) -> Tensor<Scalar> {
|
36 | 36 | return (expected - predicted).squared().sum()
|
37 | 37 | }
|
38 | 38 |
|
39 |
| -/// Returns the mean squared error between predictions and labels. |
| 39 | +/// Returns the mean squared error between predictions and expectations. |
40 | 40 | ///
|
41 | 41 | /// - Parameters:
|
42 | 42 | /// - 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. |
44 | 44 | @differentiable(wrt: predicted)
|
45 | 45 | public func meanSquaredError<Scalar: TensorFlowFloatingPoint>(
|
46 | 46 | predicted: Tensor<Scalar>, expected: Tensor<Scalar>
|
|
0 commit comments