Hi, is it possible to specify the pruning rate in each layer and ensure there is really no value instead of setting to 0.
for example, in the following easy model, the shape of weight of the first Conv2D is (3,3,1,32), I want to prune to (3,3,1,10) according to the L1 magnitude. Is it possible?
input_shape = (28, 28, 1)
num_classes = 10
model = keras.Sequential(
[
keras.Input(shape=input_shape),
layers.Conv2D(32, kernel_size=(3, 3), activation="relu"),
layers.MaxPooling2D(pool_size=(2, 2)),
layers.Conv2D(64, kernel_size=(3, 3), activation="relu"),
layers.MaxPooling2D(pool_size=(2, 2)),
layers.Flatten(),
layers.Dropout(0.5),
layers.Dense(num_classes, activation="softmax"),
]
)
model.summary()
I also try to manually run layer.set_weights, but I was informed that
Layer conv2d weight shape (3, 3, 1, 32) is not compatible with provided weight shape (3, 3, 1, 10)
Thanks for any advice.