MCPcopy Create free account
hub / github.com/JunlingWang/Neuronetwork_with_python / normalize

Function normalize

your_first_network.py:23–27  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

21
22#标准化函数
23def 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#向量标准化函数
30def vector_normalize(array):

Callers 3

layer_backwardMethod · 0.85
network_forwardMethod · 0.85
network_backwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected