用法:
mxnet.metric.create(metric, *args, **kwargs)
- metric:(
str
or
callable
) -指定要創建的指標。此參數必須是以下之一:- 度量的名稱。
EvalMetric
的一個實例。- 一個列表,其中的每個元素都是一個度量或度量名稱。
- 計算給定批次標簽和預測的自定義指標的評估函數。
- *args:(
list
) - 度量構造函數的附加參數。僅在 metric 為 str 時使用。 - **kwargs:(
dict
) - 度量構造函數的附加參數。僅在 metric 為 str 時使用
- metric:(
參數:
從指標名稱或EvalMetric 實例或自定義指標函數創建評估指標。
例子:
>>> def custom_metric(label, pred): ... return np.mean(np.abs(label - pred)) ... >>> metric1 = mx.metric.create('acc') >>> metric2 = mx.metric.create(custom_metric) >>> metric3 = mx.metric.create([metric1, metric2, 'rmse'])
相關用法
- Python mxnet.metric.F1用法及代碼示例
- Python mxnet.metric.TopKAccuracy用法及代碼示例
- Python mxnet.metric.CompositeEvalMetric用法及代碼示例
- Python mxnet.metric.RMSE用法及代碼示例
- Python mxnet.metric.MAE用法及代碼示例
- Python mxnet.metric.MCC用法及代碼示例
- Python mxnet.metric.MSE用法及代碼示例
- Python mxnet.metric.CrossEntropy用法及代碼示例
- Python mxnet.metric.CustomMetric用法及代碼示例
- Python mxnet.metric.np用法及代碼示例
- Python mxnet.metric.Accuracy用法及代碼示例
- Python mxnet.metric.PCC用法及代碼示例
- Python mxnet.metric.Perplexity用法及代碼示例
- Python mxnet.metric.PearsonCorrelation用法及代碼示例
- Python mxnet.metric.NegativeLogLikelihood用法及代碼示例
- Python mxnet.module.BaseModule.get_outputs用法及代碼示例
- Python mxnet.module.BaseModule.forward用法及代碼示例
- Python mxnet.module.BaseModule.bind用法及代碼示例
- Python mxnet.module.BaseModule.init_params用法及代碼示例
- Python mxnet.module.BaseModule.get_params用法及代碼示例
注:本文由純淨天空篩選整理自apache.org大神的英文原創作品 mxnet.metric.create。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。