I have a class that can be initialized with a lot of argument and it can keep growing as a add methods. Is there a way to add all the positional arguments in int method to the object's properties authomatically? For example;
class trainer:
def __int__(self, model="unet", encoder_name="resnet18", encoder_weights="imagenet",
in_channels=3, num_classes=1, loss="jaccard",
ignore_index=0, learning_rate=1e4, learning_rate_schedule_patience=10,
ignore_zeros=True):
# authomatically add the initial properties
self.model = model
self.encoder_name = encoder_name
self.encoder_weights = encoder_weights
self.in_channels = in_channels
self.num_classes = num_classes
.
.
.
self.ignore_zeros = ignore_zeros