Model Compression
===============
In machine learning, model compression is the process of reducing the size of a trained neural network model 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 model compression technique using weight quantization.
Example:
Suppose we have a neural network with weights in the range [-1, 1]. We can compress the model by quantizing the weights to 8-bit integers.
Constraints:
Test Cases
Test Case 1
Input:
[[0.5, 0.2], [0.1, 0.8]]Expected:
[[0, -1], [0, 1]]Test Case 2
Input:
[[-1, 1], [0.5, 0.2]]Expected:
[-1, 1]+ 3 hidden test cases