且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

keras 如何定义“准确度"?和“损失"?

更新时间:2023-02-26 18:39:54

看看 metrics.py,在那里你可以找到所有可用指标的定义,包括不同类型的准确性.除非您在编译模型时将其添加到所需指标列表中,否则不会打印准确度.

Have a look at metrics.py, there you can find definition of all available metrics including different types of accuracy. Accuracy is not printed unless you add it to the list of desired metrics when you compile your model.

根据定义,正则化器被添加到损失中.例如,请参见 Layer 类的/a> 方法.

Regularizers are by definition added to the loss. For example, see add_loss method of the Layerclass.

更新

accuracy 的类型是根据目标函数确定的,参见training.py.默认选择是 categorical_accuracy.当目标函数是二进制或稀疏时,选择其他类型,如 binary_accuracysparse_categorical_accuracy.

The type of accuracy is determined based on the objective function, see training.py. The default choice is categorical_accuracy. Other types like binary_accuracy and sparse_categorical_accuracy are selected when the objective function is either binary or sparse.