In some scenarios I want the result of cfn.Config, to be a partial function. E. g.:
adamw = cfn.Config(
functools.partial,
torch.optim.AdamW,
lr=1e-3,
weight_decay=0.01
)
@cfn.config(optimizer=adamw)
def train(optimizer: Callable):
model = Model()
opt = optimizer(model.params())
...
Should we make some shortcut for such scenarios? Since with this implementation it wouldn't be possible to change the class of adamw (we have no support for *args override yet). The shortcut could look like:
optimizer = cfn.partial_config(torch.optim.AdamW, lr=1e-3, weight_decay=0.01)
@cfn.config(optimizer=optimizer)
def train(optimizer: Callable):
model = Model()
opt = optimizer(model.params())
...
In some scenarios I want the result of
cfn.Config, to be a partial function. E. g.:Should we make some shortcut for such scenarios? Since with this implementation it wouldn't be possible to change the class of
adamw(we have no support for *args override yet). The shortcut could look like: