# 损失

### 支持的损失函数

DL4J支持所有可用的[Keras损失函数](https://keras.io/losses)（除了logcosh），即：

* mean\_squared\_error
* mean\_absolute\_error
* mean\_absolute\_percentage\_error
* mean\_squared\_logarithmic\_error
* squared\_hinge
* hinge
* categorical\_hinge
* logcosh
* categorical\_crossentropy
* sparse\_categorical\_crossentropy
* binary\_crossentropy
* kullback\_leibler\_divergence
* poisson
* cosine\_proximity

Keras的损失函数映射可在[KerasLossUtils](https://github.com/deeplearning4j/deeplearning4j/blob/master/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasLossUtils.java)中找到。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://deeplearning4j.konduit.ai/zhong-wen-v1.0.0/keras-dao-ru/zhi-chi-gong-neng/sun-shi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
