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

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:

主站蜘蛛池模板: 施甸县| 白河县| 固安县| 赤壁市| 永川市| 类乌齐县| 永寿县| 邵阳市| 铁岭市| 尚义县| 冷水江市| 四平市| 西畴县| 辽源市| 衡阳县| 新巴尔虎右旗| 友谊县| 双牌县| 通州区| 泰宁县| 台湾省| 海盐县| 广州市| 德兴市| 永修县| 安庆市| 溧阳市| 万荣县| 梨树县| 河北区| 通辽市| 山阴县| 辽宁省| 南溪县| 华阴市| 饶阳县| 通化市| 建始县| 湖口县| 乐亭县| 扎囊县|