In the case of train, it does what you’re looking to do. It’s a bit dangerous though to update an object namespace using an uncontrolled dict like that.
The train2 op is an alternative that uses Python’s SimpleNamespace to provide config vals. In that case, the trainer object access self.config rather than the values directly (e.g. self.x, self.y). I like this approach better as it ensures that config can’t accidentally corrupt your object. That may not work for you though. I provide just as example.