Check layer types for Optimizer construction
# What does this PR do?

As pointed out on the [forum](https://discuss.huggingface.co/t/parameter-groups-and-gpt2-layernorm/4239), `Trainer` currently excludes form weight decay layernorm layers by using a name pattern, which is not consistently followed by all models.

This PR actual checks the layer types and adds some tests.