官术网_书友最值得收藏!

Cost function and errors

The cost function given the predicted probabilities by the model is as follows:

cost = -T.mean(T.log(model)[T.arange(y.shape[0]), y])

The error is the number of predictions that are different from the true class, averaged by the total number of values, which can be written as a mean:

error = T.mean(T.neq(y_pred, y))

On the contrary, accuracy corresponds to the number of correct predictions divided by the total number of predictions. The sum of error and accuracy is one.

For other types of problems, here are a few other loss functions and implementations:

主站蜘蛛池模板: 嵊州市| 来宾市| 曲沃县| 延津县| 聊城市| 县级市| 霍城县| 托克逊县| 阿克| 镇康县| 沾益县| 广昌县| 凤台县| 乌拉特中旗| 织金县| 平安县| 乌拉特中旗| 柳林县| 咸丰县| 大同市| 濮阳县| 淮滨县| 桑日县| 乌鲁木齐县| 淮安市| 易门县| 博罗县| 蕉岭县| 岢岚县| 邵阳县| 莱阳市| 恭城| 利川市| 玉环县| 钦州市| 吕梁市| 浦县| 苗栗县| 漳平市| 尼玛县| 漳州市|