Skip to main content
. 2019 Aug 7;19(16):3445. doi: 10.3390/s19163445
Algorithm 2: Pruning Neurons.
1: Input: The model weights W, the prune rate α, the number of prune iterations iter
2: Get m which is the number of elements in W
3: Get the number of W that need pruning n=αm
4: Calculate the importance of neurons, get the neuron importance score matrix NIS
5: Sorting NIS from large to small
6: Get the prune threshold of neuron importance score thr=NIS[n]
7: While i < m do
8:  if NIS[i] < thr then
9:  W[i] = 0
10: end
11: i++
12: end
13: While k < iter do
14:  Retrain the model to update parameters W according to Algorithm 1
15:  Execute step 2–12
16:  k++
17: end