{"id":13737842,"url":"https://github.com/geyang/params-proto","last_synced_at":"2026-02-01T11:04:10.293Z","repository":{"id":57450758,"uuid":"102591640","full_name":"geyang/params-proto","owner":"geyang","description":"params_proto, a collection of decorators that makes shell argument passing declarative","archived":false,"fork":false,"pushed_at":"2026-01-23T22:14:19.000Z","size":1597,"stargazers_count":18,"open_issues_count":4,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T10:22:22.056Z","etag":null,"topics":["cli-parsing","hyper-parameter","machine-learning"],"latest_commit_sha":null,"homepage":"https://params-proto.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geyang.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-09-06T09:45:12.000Z","updated_at":"2026-01-23T22:02:13.000Z","dependencies_parsed_at":"2023-02-08T08:01:57.023Z","dependency_job_id":"c56b6a3f-2930-4baf-9132-64a8480fe520","html_url":"https://github.com/geyang/params-proto","commit_stats":null,"previous_names":["episodeyang/params_proto","geyang/params-proto","geyang/params_proto"],"tags_count":86,"template":false,"template_full_name":null,"purl":"pkg:github/geyang/params-proto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fparams-proto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fparams-proto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fparams-proto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fparams-proto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geyang","download_url":"https://codeload.github.com/geyang/params-proto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geyang%2Fparams-proto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28977316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T09:57:52.632Z","status":"ssl_error","status_checked_at":"2026-02-01T09:57:49.143Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-parsing","hyper-parameter","machine-learning"],"created_at":"2024-08-03T03:02:02.878Z","updated_at":"2026-02-01T11:04:10.288Z","avatar_url":"https://github.com/geyang.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"``params-proto``, Modern Hyper Parameter Management for Machine Learning\n========================================================================\n\n-  2022/07/04:\n\n   -  Move ``neo_proto`` to top-level, move older ``params_proto`` to\n      ``v1`` namespace.\n   -  Implement nested update via `global\n      prefix \u003chttps://github.com/geyang/params_proto/blob/master/test_params_proto/test_neo_proto.py#L278\u003e`__.\n      No relative update via ``**kwargs``, yet\n   -  Fix ``to_value`` bug in Flag\n\n-  2021/06/16: Proto now supports using environment variables as\n   default.\n-  2021/06/13: 5 month into my postdoc at MIT, add\n   ``sweep.save(\"sweep.jsonl\")`` to dump the sweep into a ``jsonl`` file\n   for large scale experiments on AWS.\n-  2019/12/09: Just finished my DeepMind Internship. Now\n   ``params-proto`` contain a new proto implementation, and a\n   complementary hyperparameter search library! See ``neo_proto`` and\n   ``neo_hyper``.\n-  2019/06/11: Now supports ``tab-completion`` at the command line!\n-  2018/11/08: Now supports both python ``3.52`` as well as ``3.6``!\n   :bangbang::star:\n\nWhat is “Experiment Parameter Hell”?\n------------------------------------\n\n“Experiemnt Parameter Hell” occurs when you have more than twenty\nparameters for your ML project that are all defined as string/function\nparameters with ``click`` or ``argparse``. Sometimes these parameters\nare defined in a launch script and passes through five layers of\nfunction calls during an experiment.\n\nYour Python IDEs work very hard on static code-block analysis to intelligently\nmake you more productive, and the “parameter hell” breaks all of that.\n\nStep 1: Declarative Pattern to the Rescue!\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFor this reason, you want to avoid using dictionaries or opaque\n``argparse`` definitions as much as possible. Instead, you want to write\nthose declaratively, so that your IDE can actually help you navigate\nthrough those layers of function calls. The hyper-parameter library,\n``params_proto`` makes this easy, by integrating python namespaces (a\nbare python class) with ``argparse``, so that on the python side you get\nauto-completion, and from the command line you can pass in changes.\n\n**Installation**\n\nFirst let’s install ``params-proto`` and its supporting module\n``waterbear``\n\n.. code-block:: bash\n\n   pip install params-proto waterbear\n\nThen to declare your hyperparameters, you can write the following in a\n``your_project/soft_ac/config.py`` file:\n\n.. code-block:: python\n\n   import sys\n   from params_proto.v2.proto import ParamsProto, Flag, Proto, PrefixProto\n\n\n   # this is the first config schema\n   class Args(PrefixProto):\n       \"\"\"Soft-actor Critic Implementation with SOTA Performance\n       \"\"\"\n\n       debug = True if \"pydevd\" in sys.modules else False\n\n       cuda = Flag(\"cuda tend to be slower.\")\n       seed = 42\n       env_name = \"FetchReach-v1\"\n       n_workers = 1 if debug else 12\n       v_lr = 1e-3\n       pi_lr = 1e-3\n       n_initial_rollouts = 0 if debug else 100\n       n_test_rollouts = 15\n       demo_length = 20\n       clip_inputs = Flag()\n       normalize_inputs = Flag()\n\n\n   # this is the second schema\n   class LfGR(PrefixProto):\n       # reporting\n       use_lfgr = True\n       start = 0 if Args.debug else 10\n       store_interval = 10\n       visualization_interval = 10\n\nStep 2: Sweeping Hyper-parameters :fire:\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThen you an sweep the hyperparameter via the following declarative\npattern:\n\n.. code-block:: python\n\n   from rl import main, Args\n   from params_proto.v2.hyper import Sweep\n\n   if __name__ == '__main__':\n       from lp_analysis import instr\n\n       with Sweep(Args, LfGR) as sweep:\n           # override the default\n           Args.pi_lr = 3e-3\n           Args.clip_inputs = True  # this was a flag\n\n           # override the second config object\n           LfGR.visualization_interval = 40\n\n           # product between the zipped and the seed\n           with sweep.product:\n               # similar to python zip, unpacks a list of values.\n               with sweep.zip:\n                   Args.env_name = ['FetchReach-v1', 'FetchPush-v1', 'FetchPickAndPlace-v1', 'FetchSlide-v1']\n                   Args.n_epochs = [4, 12, 12, 20]\n                   Args.n_workers = [5, 150, 200, 500]\n\n                   # the seed is sweeped at last\n               Args.seed = [100, 200, 300, 400, 500, 600]\n\n       # You can save the sweep into a `jsonl` file\n       sweep.save('sweep.jsonl')\n\n       for i, deps in sweep.items():\n           thunk = instr(main, deps, _job_postfix=f\"{Args.env_name}\")\n           print(deps)\n\nand it should print out a list of dictionaries that looks like:\n\n.. code-block:: bash\n\n   {Args.pi_lr: 3e-3, Args.clip_inputs: True, LfGR.visualization_interval: 40, Args.env_name: \"FetchReach-v1\", ... Args.seed: 100}\n   {Args.pi_lr: 3e-3, Args.clip_inputs: True, LfGR.visualization_interval: 40, Args.env_name: \"FetchReach-v1\", ... Args.seed: 200}\n   {Args.pi_lr: 3e-3, Args.clip_inputs: True, LfGR.visualization_interval: 40, Args.env_name: \"FetchReach-v1\", ... Args.seed: 300}\n   ...\n\n## Where Can I find Documentation?\n\nLook at the specification file at\n`https://github.com/episodeyang/params_proto/blob/master/test_params_proto/\\*.py \u003ctest_params_proto\u003e`__ , which is part of the\nintegrated test. These scripts contains the most comprehensive set of\nusage patters!!\n\nThe new version has a ``neo_`` prefix. We will deprecate the older\n(non-neo) version in a few month.\n\nWriting documentation as uhm…, man page?\n----------------------------------------\n\n``Params-Proto`` exposes your argument namespace’s doc string as the\nusage note. For users of your code-block, there is no better help than the one\nthat comes with the script itself!\n\n   With ``params-proto``, your help is only one ``-h`` away :)\n\nAnd **Your code-block becomes the documentation.**\n\nTab-completion for your script!\n-------------------------------\n\n``params_proto`` uses ``argparse`` together with ``argcomplete``, which\nenables command line autocomplete on tabs! To enable run\n\n.. code-block:: python\n\n   pip install params-proto\n   # then:\n   activate-global-python-argcomplete\n\nFor details, see ```argcomplete``\\ ’s\ndocumentation \u003chttps://github.com/kislyuk/argcomplete#installation\u003e`__.\n\nWhy Use Params_Proto Instead of Click or Argparse?\n--------------------------------------------------\n\nBecause this declarative, singleton pattern allows you to:\n\n   Place all of the arguments under a namespace that can be statically\n   checked.\n\nso that your IDE can:\n\n1. Find usage of each argument\n2. jump from *anywhere* in your code-block base to the declaration of that\n   argument\n3. refactor your argument name **in the entire code-block base** automatically\n\n``Params_proto`` is the declarative way to write command line arguments,\nand is the way to go for ML projects.\n\nHow to override when calling from python\n----------------------------------------\n\nIt is very easy to over-ride the parameters when you call your function:\nhave most of your training code-block **directly** reference the parser\nnamespace (your configuration namespace really), and just monkey patch\nthe attribute.\n\n``params-proto`` works very well with the clound ML launch tool\n`jaynes \u003chttps://github.com/episodeyang/jaynes\u003e`__. Take a look at the\nautomagic awesomeness of\n`jaynes \u003chttps://github.com/episodeyang/jaynes\u003e`__:)\n\nTo Develop And Contribute\n-------------------------\n\n.. code-block:: bash\n\n   git clone https://github.com/episodeyang/params_proto.git\n   cd params_proto\n   make dev\n\nTo test, run the following under both python ``3.52`` and ``3.6``.\n\n.. code-block:: bash\n\n   make test\n\nThis ``make dev`` command should build the wheel and install it in your\ncurrent python environment. Take a look at the\n`https://github.com/episodeyang/params_proto/blob/master/Makefile \u003chttps://github.com/episodeyang/params_proto/blob/master/Makefile\u003e`__ for details.\n\n**To publish**, first update the version number, then do:\n\n.. code-block:: bash\n\n   make publish\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeyang%2Fparams-proto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeyang%2Fparams-proto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeyang%2Fparams-proto/lists"}