GFNOrg / torchgfn

A modular, easy to extend GFlowNet library
https://torchgfn.readthedocs.io/en/latest/
Other
238 stars 31 forks source link

Utility for seamless optimizer param groups creation #72

Closed saleml closed 1 year ago

saleml commented 1 year ago

In train_hypergrid.py, for example

    # 3. Create the optimizer
    params = [
        {
            "params": [
                val
                for key, val in parametrization.parameters.items()
                if "logZ" not in key
            ],
            "lr": args.lr,
        }
    ]
    if "logZ.logZ" in parametrization.parameters:
        params.append(
            {
                "params": [parametrization.parameters["logZ.logZ"]],
                "lr": args.lr_Z,
            }
        )

should ideally be a one liner, using a utility function.

saleml commented 1 year ago

Should be done as part of a fix to #77

saleml commented 1 year ago

Done in #89