Neural Network Pruning
=======================
Neural network pruning is a technique used to reduce the number of parameters in a neural network while preserving its accuracy. This is essential for deploying models on devices with limited memory or computational resources. In this problem, you will implement a simple neural network pruning technique using weight magnitude pruning.
Example:
Suppose we have a neural network with weights in the range [-1, 1]. We can prune the model by removing weights with magnitude less than a certain threshold.
Constraints:
Test Cases
Test Case 1
Input:
[[0.5, 0.2], [0.1, 0.8]]Expected:
[[0.5, 0], [0, 0.8]]Test Case 2
Input:
[[-1, 1], [0.5, 0.2]]Expected:
[-1, 0]+ 3 hidden test cases