From e777ac9442a2a66c0e2160cf3d7c954b1099264c Mon Sep 17 00:00:00 2001 From: Brian Pugh Date: Fri, 20 May 2022 09:29:38 -0700 Subject: [PATCH] Add more to readme examples --- README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 571a2a9..ac4d140 100644 --- a/README.rst +++ b/README.rst @@ -78,9 +78,8 @@ for looking up subclasses. print(f"{len(Pokemon)} Pokemon registered:") print(f" {list(Pokemon)}") - charmander = Pokemon["cHaRmAnDer"]( - level=7, hp=31 - ) # By default, lookup is case-insensitive + # By default, lookup is case-insensitive + charmander = Pokemon["cHaRmAnDer"](level=7, hp=31) print(f"Created Pokemon: {charmander}") This code block produces the following output: @@ -139,6 +138,9 @@ Create a registry for another python module. optims = Registry(torch.optim) + # "adamw" and ``lr`` could be coming from a configuration file. + optimizer = optims["adamw"](model.parameterse(), lr=3e-3) + assert list(optims) == [ "asgd", "adadelta",