def mean_squared_error(y_true, y_pred):
if not K.is_tensor(y_pred):
y_pred = K.constant(y_pred)
y_true = K.cast(y_true, y_pred.dtype)
return K.mean(K.square(y_pred - y_true), axis=-1) def mean_absolute_error(y_true, y_pred):
if not K.is_tensor(y_pred):
y_pred = K.constant(y_pred)
y_true = K.cast(y_true, y_pred.dtype)
return K.mean(K.abs(y_pred - y_true), axis=-1) def mean_absolute_percentage_error(y_true, y_pred):
if not K.is_tensor(y_pred):
y_pred = K.constant(y_pred)
y_true = K.cast(y_true, y_pred.dtype)
diff = K.abs((y_true - y_pred) / K.clip(K.abs(y_true),
K.epsilon(),
None))
return 100. * K.mean(diff, axis=-1) def mean_squared_logarithmic_error(y_true, y_pred):
if not K.is_tensor(y_pred):
y_pred = K.constant(y_pred)
y_true = K.cast(y_true, y_pred.dtype)
first_log = K.log(K.clip(y_pred, K.epsilon(), None) + 1.)
second_log = K.log(K.clip(y_true, K.epsilon(), None) + 1.)
return K.mean(K.square(first_log - second_log), axis=-1)

最新文章

  1. 堆排序算法 java 实现
  2. ios--个人资料修改
  3. python post
  4. VS2010 项目引用了微软企业库,但是编译时提示:未能找到类型或命名空间名称
  5. 翻阅《数据结构与算法javascript描述》--数组篇
  6. poj 1005 I Think I Need a Houseboat
  7. HDU 1274 展开字符串 (递归+string类)
  8. 用CSS3 做的星体
  9. JAVA虚拟机环境变量设置
  10. ecshop和jQuery冲突
  11. OV2685翻转问题
  12. [开源]快速构建一个WebApi项目
  13. python数据类型:字典dict常用操作
  14. (sort)P1068 分数线划定 洛谷
  15. opencv之内存存储器——CvMemStorage与CvSeq
  16. poj1185 [NOI2001炮兵阵地]
  17. GitHub使用指南之快速入门
  18. MyEclipse SVN 下面切换用户的解决方案
  19. .NET Framework 4安装失败
  20. 将新浪博客里的表情包存入MySQL数据库不完整版本一堆可能用到的散乱代码

热门文章

  1. VirtualBox主机虚拟机互通
  2. spring(一) IOC 控制反转 、DI 依赖注入
  3. if you wanna the rainbow, you have to deal with the rain.
  4. 7.安装pycharm----导入Nmap模块----netcat反向shell----metasploitable靶机环境
  5. java基础/java调用shell命令和脚本
  6. 深入理解java:2.3.2. 并发编程concurrent包 之重入锁/读写锁/条件锁
  7. [Python3] 042 日志
  8. js获取url中的参数(解决中文乱码)
  9. Scrapy 教程(五)-分页策略
  10. 数学: HDU1005 Number Sequence