2019年11月26日
摘要: where 得到mask中的Ture在原张量中的位置,根据坐标系根据条件需求(a>0)有目的的选择 scatter_nd 根据坐标有目的性的更新 meshgrid 生成数据点(x,y) 1、where ,得到mask在Ture在a对应的元素的位置坐标,然后通过gather进行收集 (1) where 阅读全文
posted @ 2019-11-26 16:55 Luaser 阅读(303) 评论(0) 推荐(0) 编辑
摘要: clip_by_value 根据具体数值进行裁剪 relu 相当于tf.maxinum( ) clip_by_norm 根据总体的范数来裁剪张量 gradient clipping 1、clip_by_value 根据具体数值进行裁剪 (1)下限幅:max(0,x) ,if x < 0,result 阅读全文
posted @ 2019-11-26 15:44 Luaser 阅读(226) 评论(0) 推荐(0) 编辑
摘要: pad 填充 tile 复制 broadcast_to 1、pad (1)[[A,B],[C,D]]最外层括号表示要进行填充的维度,A表示在左边填充的单元个数,B表示在右边填充的单元个数,C表示在上面填充的单元个数,D表示在下面填充的单元个数,默认都是用0进行填充。 1 a = tf.reshape 阅读全文
posted @ 2019-11-26 15:40 Luaser 阅读(752) 评论(0) 推荐(0) 编辑
摘要: sort/argsort topk top-5 Acc 1、sort,argsort sort:对序列进行一个完全的排序 argsort:返回排序后的index (1)tf.random.shuffle(),沿着张量的第一个维度进行打乱 1 a = tf.range(5) 2 b = tf.rand 阅读全文
posted @ 2019-11-26 14:15 Luaser 阅读(547) 评论(0) 推荐(0) 编辑
摘要: tf.norm tf.reduce_min/max tf.argmax/argmin tf.equal tf.unique 1、norm,向量的范数 1 #向量的范数,默认为2范数,平方和开根号 2 a = tf.ones([2,2]) 3 print(tf.norm(a)) # tf.Tensor 阅读全文
posted @ 2019-11-26 11:06 Luaser 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1、concat,拼接 例:统计班级的学生的分数 a = [class1-4,student,scores],4个班级,35个学生,8门课的分数 b = [class5-6,student,scores],2个班级,35个学生,8门课的分数 cancat要求除了指定合并的维度之外,其余的维度要大小要 阅读全文
posted @ 2019-11-26 10:40 Luaser 阅读(276) 评论(0) 推荐(0) 编辑