changed decoded_weight_matrix to be 2D instead of 3D when input