Skip to content

Commit

Permalink
20211123
Browse files Browse the repository at this point in the history
  • Loading branch information
sun1638650145 committed Nov 23, 2021
1 parent 24a53be commit 6c38643
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions TensorFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,17 @@ from tensorflow.keras.losses import CategoricalCrossentropy
loss = CategoricalCrossentropy(from_logits=False) # bool|False|是否将预测值解释为张量.
```

#### 1.14.8.3.Loss()
#### 1.14.8.3.Huber()

实例化Huber损失函数.

```python
from tensorflow.keras.losses import Huber

loss = Huber()
```

#### 1.14.8.4.Loss()

自定义一个符合tf.keras接口的损失函数.

Expand All @@ -1749,7 +1759,7 @@ class MyLoss(Loss):
return loss
```

#### 1.14.8.4.MeanAbsoluteError()
#### 1.14.8.5.MeanAbsoluteError()

实例化平均绝对误差损失函数.

Expand All @@ -1759,7 +1769,7 @@ from tensorflow.keras.losses import MeanAbsoluteError
loss = MeanAbsoluteError()
```

#### 1.14.8.5.SparseCategoricalCrossentropy()
#### 1.14.8.6.SparseCategoricalCrossentropy()

实例化多分类交叉熵损失函数(稀释编码).

Expand Down

0 comments on commit 6c38643

Please sign in to comment.