ONE - On-device Neural Engine
Loading...
Searching...
No Matches
mse.py
Go to the documentation of this file.
1
from
typing
import
Literal
2
import
numpy
as
np
3
from
.loss
import
LossFunction
4
5
6
class
MeanSquaredError
(
LossFunction
):
7
"""
8
Mean Squared Error (MSE) Loss Function with reduction type.
9
"""
10
def
__init__
(self, reduction: Literal[
"mean"
,
"sum"
] =
"mean"
) ->
None
:
11
"""
12
Initialize the MSE loss function.
13
Args:
14
reduction (str): Reduction type ('mean', 'sum').
15
"""
16
super().
__init__
(reduction)
package.experimental.train.losses.loss.LossFunction
Definition
loss.py:5
package.experimental.train.losses.mse.MeanSquaredError
Definition
mse.py:6
package.experimental.train.losses.mse.MeanSquaredError.__init__
None __init__(self, Literal["mean", "sum"] reduction="mean")
Definition
mse.py:10
runtime
onert
api
python
package
experimental
train
losses
mse.py
Generated by
1.9.8