(array)
| 21 | |
| 22 | #标准化函数 |
| 23 | def normalize(array): |
| 24 | max_number = np.max(np.absolute(array), axis=1, keepdims=True) |
| 25 | scale_rate = np.where(max_number == 0, 1, 1/max_number) |
| 26 | norm = array * scale_rate |
| 27 | return norm |
| 28 | |
| 29 | #向量标准化函数 |
| 30 | def vector_normalize(array): |
no outgoing calls
no test coverage detected