# L1 Reguarizer in Keras model throwing weight matrix dimension error

Was just experimenting with something when i ran into this error : I am getting matrix dimension errors only when i use L1 Regularizer. I have checked and the regularizer itself doesn't change the shape of the weight matrix. The error is gone if i remove the L1 regularzer in 3rd layer or make the number of nodes = 4 (same) in all the hidden layers. As far as i understand the regularizer should act on its current layer add the norm of the vectors to the cost of current layer and not to the next layer.

Actual Error occurs during model.complie():

ValueError: Dimensions must be equal, but are 4 and 3 for 'loss_15/add_1' (op: 'Add') with input shapes: [4,3], [3,2].