tensorflow if语句
来源:互联网 发布:重庆编程培训 编辑:程序博客网 时间:2024/06/11 14:54
tf:
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=y_, labels=y)) # tf.nn.l2_loss(W['out'])
cost_b = tf.nn.l2_loss(W['out'])c_ = tf.cond(cost < cost_b, lambda: 0.85 * cost / cost_b, lambda: c)
cost = cost + cost_b * c_
等价于:
if cost_b > cost:
c_ = 0.85 * cost / cost_b
else:
c_ = c
但lambda:后的对象必须为tf中的对象,且必须有值。
阅读全文
0 0
- tensorflow if语句
- IF语句
- if语句
- if 语句
- if语句
- IF 语句
- #if语句
- if语句
- if语句
- if语句
- if语句
- if语句
- if语句
- if语句
- if语句
- if语句
- if语句
- if语句
- java 读取 并 写入一个新的Excle
- 巧用表值函数
- 无法安装pywin32 蓝屏时提醒which was not found in the registry
- (React-Native 学习之五) HelloWorld RnDemo运行
- Java-运算符
- tensorflow if语句
- /dev/rhdisk5: the requested resource is busy
- 两种事务配置方式
- vue学习笔记4
- Wondershare Data Recovery(数据恢复软件)官方破解版V6.6.1.0下载 | data recovery 注册码
- Android系统呼吸灯源码简单跟踪分析
- 值得收藏的27个机器学习的小抄
- Srping AOP AspectJ 切入点注解说明以及Spring DI注解说明
- appium测试微信公众号的WebView