numpy函数之np.maximum
2017-03-17 15:43
148 查看
numpy的一些函数
1.np.maximum
>>> np.maximum([2, 3, 4], [1, 5, 2]) array([2, 5, 4]) >>> np.maximum(np.eye(2), [0.5, 2]) # broadcasting array([[ 1. , 2. ], [ 0.5, 2. ]]) >>> np.maximum([np.nan, 0, np.nan], [0, np.nan, np.nan]) array([ NaN, NaN, NaN]) >>> np.maximum(np.Inf, 1) inf
值得注意的是,numpy中array的broadcasting特性,非常有用。
一个常用应用是np.maximum(0,array),可作为ReLU gate。
相关文章推荐
- UVa 193 - Graph Coloring(graph theory, brute force, backtracking, NP-complete, maximum independent set.)
- np.max 与 np.maximum
- np.max 与 np.maximum
- 用np.maximum实现relu函数
- Maximum Depth of Binary Tree
- ORA-00059: maximum number of DB_FILES exceeded
- Sliding Window Maximum
- Subarray Sum & Maximum Size Subarray Sum Equals K
- Maximum Product of word lengths
- NP-Hard Problem(cf#360)
- 《leetCode》:Sliding Window Maximum
- HackerRank The Maximum Subarray
- Uva 11827 Maximum GCD(水题、读入杀)
- 搜索 ( BFS )——Maximum Cut Order ( UVA 7460 )
- LeetCode | Maximum Depth of Binary Tree
- [lintcode] Binary Tree Maximum Path Sum II
- Codeforces Round #360 (Div. 1) A. NP-Hard Problem (二分图)
- codeforces 687A - NP-Hard Problem(dfs
- 【LeetCode】 Maximum Depth of Binary Tree 二叉树的最大深度
- Maximum Product of Word Lengths