Skip to content

[FEATURE] swanlab.init->config支持像Argparse一样调用 #178

@Zeyi-Lin

Description

@Zeyi-Lin

For example, the following code:

# Initialize swanlab
run = swanlab.init(
    config={
        "lr": 1e-4,
        "num_epochs": 40,
    }
)

optimizer = torch.optim.Adam(model.parameters(), lr=run.config.lr)

for epoch in range(run.cofig.num_epochs):
    ···

run is an instance after the initialization of swanlab, so the content in config can be called in the form of run.config.lr or run.config.num_epochs.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions