From 6aa1659d6238d1a366222af884dfbec2ee4b40cd Mon Sep 17 00:00:00 2001 From: Joseph Viviano Date: Sat, 24 Feb 2024 16:46:17 -0500 Subject: [PATCH 1/2] black formatting update --- tutorials/examples/train_box.py | 9 ++++++--- tutorials/examples/train_discreteebm.py | 1 + tutorials/examples/train_hypergrid.py | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tutorials/examples/train_box.py b/tutorials/examples/train_box.py index 5a3cf8dd..632d5b78 100644 --- a/tutorials/examples/train_box.py +++ b/tutorials/examples/train_box.py @@ -6,6 +6,7 @@ python train_box.py --delta {0.1, 0.25} --tied {--uniform_pb} --loss {TB, DB} """ + from argparse import ArgumentParser import numpy as np @@ -189,9 +190,11 @@ def main(args): # noqa: C901 if not args.uniform_pb: optimizer.add_param_group( { - "params": pb_module.last_layer.parameters() - if args.tied - else pb_module.parameters(), + "params": ( + pb_module.last_layer.parameters() + if args.tied + else pb_module.parameters() + ), "lr": args.lr, } ) diff --git a/tutorials/examples/train_discreteebm.py b/tutorials/examples/train_discreteebm.py index 3574fa2d..562bb2b4 100644 --- a/tutorials/examples/train_discreteebm.py +++ b/tutorials/examples/train_discreteebm.py @@ -10,6 +10,7 @@ [Learning GFlowNets from partial episodes for improved convergence and stability](https://arxiv.org/abs/2209.12782) python train_hypergrid.py --ndim {2, 4} --height 12 --R0 {1e-3, 1e-4} --tied --loss {TB, DB, SubTB} """ + from argparse import ArgumentParser import torch diff --git a/tutorials/examples/train_hypergrid.py b/tutorials/examples/train_hypergrid.py index 4d4e3a25..f52932e9 100644 --- a/tutorials/examples/train_hypergrid.py +++ b/tutorials/examples/train_hypergrid.py @@ -10,6 +10,7 @@ [Learning GFlowNets from partial episodes for improved convergence and stability](https://arxiv.org/abs/2209.12782) python train_hypergrid.py --ndim {2, 4} --height 12 --R0 {1e-3, 1e-4} --tied --loss {TB, DB, SubTB} """ + from argparse import ArgumentParser import torch From f1a5c7f016b36d1c2ba2809da7eeb7add63c6b1e Mon Sep 17 00:00:00 2001 From: Joseph Viviano Date: Sat, 24 Feb 2024 16:53:02 -0500 Subject: [PATCH 2/2] extended excludes --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3d05ed8c..36947af0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,7 +88,7 @@ all = [ [tool.black] target_version = ["py310"] include = '\.pyi?$' -exclude = '''/(\.git|\.hg|\.mypy_cache|\.tox|\.venv|build)/g''' +extend-exclude = '''/(\.git|\.hg|\.mypy_cache|\.ipynb|\.tox|\.venv|build)/g''' [tool.tox] legacy_tox_ini = '''