机器学习|model.compile()用法
作者:佚名 阅读量:次 发表时间:2024-04-15 12:27
“优化器(optimizer) 的主要功能是在梯度下降的过程中,使得梯度更快更好的下降,从而尽快找到目标函数的最小值。可以理解为通过何种方式去最快的寻找最优的“损失”(loss)。
- SGD
- RMSprop
- Adam
- Adadelta
- Adagrad
- Adamax
- Nadam
- Ftrl
损失函数(loss function)或代价函数(cost function)是将随机事件或其有关随机变量的取值映射为非负实数以表示该随机事件的“风险”或“损失”的函数。神经网络以某个指标为线索寻找最优权重参数。这里我理解为:“损失”描述的是真实值与预测值之间的信息差,而损失函数的目的是去计算其中“损失量”的大小,进而得出一个损失/信息熵尽可能小的解,即最优权重参数。
(如图:随着训练轮次增加,损失值下降的过程)
概率损失(Probabilistic losses)
- BinaryCrossentropy class
- CategoricalCrossentropy class
- SparseCategoricalCrossentropy class
- Poisson class
- binary_crossentropy function
- categorical_crossentropy function
- sparse_categorical_crossentropy function
- poisson function
- KLDivergence class
- kl_divergence function
回归损失(Regression losses)
- MeanSquaredError class
- MeanAbsoluteError class
- MeanAbsolutePercentageError class
- MeanSquaredLogarithmicError class
- CosineSimilarity class
- mean_squared_error function
- mean_absolute_error function
- mean_absolute_percentage_error function
- mean_squared_logarithmic_error function
- cosine_similarity function
- Huber class
- huber function
- LogCosh class
- log_cosh function
最大间隔分类(maximum-margin classification)
- Hinge class
- SquaredHinge class
- CategoricalHinge class
- hinge function
- squared_hinge function
- categorical_hinge function
准确性评价函数用在评估模型预测的准确性。在模型训练的过程中,我们会记录模型在训练集、验证集上的预测准确性,之后会据此绘制准确率随着训练次数的变化曲线。
- BinaryAccuracy class
- CategoricalAccuracy class
- SparseCategoricalAccuracy class
- TopKCategoricalAccuracy class
- SparseTopKCategoricalAccuracy class
Probabilistic metrics
- BinaryCrossentropy class
- CategoricalCrossentropy class
- SparseCategoricalCrossentropy class
- KLDivergence class
- Poisson class
Regression metrics
- MeanSquaredError class
- RootMeanSquaredError class
- MeanAbsoluteError class
- MeanAbsolutePercentageError class
- MeanSquaredLogarithmicError class
- CosineSimilarity class
- LogCoshError class
Classification metrics based on True/False positives & negatives
- AUC class
- Precision class
- Recall class
- TruePositives class
- TrueNegatives class
- FalsePositives class
- FalseNegatives class
- PrecisionAtRecall class
- SensitivityAtSpecificity class
- SpecificityAtSensitivity class
Image segmentation metrics
Hinge metrics for "maximum-margin" classification
- Hinge class
- SquaredHinge class
- CategoricalHinge class