tensor flow :tf.where()
在tf的学习过程中,编写自己的损失函数中有这样一行代码:loss = tf.reduce_sum(tf.where(tf.greater(y,y_),(y-y_)*loss_more,y_-y)*loss_less)其中,tf.where()让人很难理解。
其实,可以简单的这样理解,tf.where(a,b,c)
a条件为true时候,返回b
a条件为false时候,返回c
原创
2018-04-02 20:52:19 ·
296 阅读 ·
0 评论