[{"data":1,"prerenderedAt":3462},["ShallowReactive",2],{"navigation":3,"api-navigation":184,"\u002Flearn\u002Ftutorials\u002Ffirst-steps":206,"docyard:crossref-index":3461},[4,8,155,174,180],{"title":5,"path":6,"stem":7},"Getting Started","\u002Fgetting-started","1.getting-started",{"title":9,"path":10,"stem":11,"children":12},"Learn","\u002Flearn","2.learn",[13,15,66,99,133],{"title":9,"path":10,"stem":14},"2.learn\u002Findex",{"title":16,"path":17,"stem":18,"children":19},"Tutorials","\u002Flearn\u002Ftutorials","2.learn\u002F1.tutorials\u002Findex",[20,21,26,30,34,38,42,46,50,54,58,62],{"title":16,"path":17,"stem":18},{"title":22,"path":23,"stem":24,"icon":25},"Why Laco?","\u002Flearn\u002Ftutorials\u002Fwhy-laco","2.learn\u002F1.tutorials\u002F01.why-laco","i-lucide-notebook",{"title":27,"path":28,"stem":29,"icon":25},"First Steps with Laco","\u002Flearn\u002Ftutorials\u002Ffirst-steps","2.learn\u002F1.tutorials\u002F02.first-steps",{"title":31,"path":32,"stem":33,"icon":25},"Lazy Call and Partial","\u002Flearn\u002Ftutorials\u002Flazy-call-and-partial","2.learn\u002F1.tutorials\u002F03.lazy-call-and-partial",{"title":35,"path":36,"stem":37,"icon":25},"Hyperparameters and Interpolation","\u002Flearn\u002Ftutorials\u002Fhyperparameters-and-interpolation","2.learn\u002F1.tutorials\u002F04.hyperparameters-and-interpolation",{"title":39,"path":40,"stem":41,"icon":25},"Loading, Saving, and the CLI","\u002Flearn\u002Ftutorials\u002Floading-saving-cli","2.learn\u002F1.tutorials\u002F05.loading-saving-cli",{"title":43,"path":44,"stem":45,"icon":25},"Nested Configs and Containers","\u002Flearn\u002Ftutorials\u002Fnested-configs-and-containers","2.learn\u002F1.tutorials\u002F06.nested-configs-and-containers",{"title":47,"path":48,"stem":49,"icon":25},"Typed Groups and Schemas","\u002Flearn\u002Ftutorials\u002Ftyped-groups-and-schemas","2.learn\u002F1.tutorials\u002F07.typed-groups-and-schemas",{"title":51,"path":52,"stem":53,"icon":25},"Pipeline Configs","\u002Flearn\u002Ftutorials\u002Fpipeline-configs","2.learn\u002F1.tutorials\u002F08.pipeline-configs",{"title":55,"path":56,"stem":57,"icon":25},"Tasks and the App Loop","\u002Flearn\u002Ftutorials\u002Ftasks-and-app-loop","2.learn\u002F1.tutorials\u002F09.tasks-and-app-loop",{"title":59,"path":60,"stem":61,"icon":25},"Tracing","\u002Flearn\u002Ftutorials\u002Ftracing","2.learn\u002F1.tutorials\u002F10.tracing",{"title":63,"path":64,"stem":65,"icon":25},"Production Patterns","\u002Flearn\u002Ftutorials\u002Fproduction-patterns","2.learn\u002F1.tutorials\u002F11.production-patterns",{"title":67,"path":68,"stem":69,"children":70},"Concepts","\u002Flearn\u002Fconcepts","2.learn\u002F2.concepts\u002Findex",[71,72,76,80,84,88,92,95],{"title":67,"path":68,"stem":69},{"title":73,"path":74,"stem":75},"Config as Python","\u002Flearn\u002Fconcepts\u002Fconfig-as-python","2.learn\u002F2.concepts\u002F1.config-as-python",{"title":77,"path":78,"stem":79},"Lazy Construction","\u002Flearn\u002Fconcepts\u002Flazy-construction","2.learn\u002F2.concepts\u002F2.lazy-construction",{"title":81,"path":82,"stem":83},"Lie-Typing","\u002Flearn\u002Fconcepts\u002Flie-typing","2.learn\u002F2.concepts\u002F3.lie-typing",{"title":85,"path":86,"stem":87},"Interpolation","\u002Flearn\u002Fconcepts\u002Finterpolation","2.learn\u002F2.concepts\u002F4.interpolation",{"title":89,"path":90,"stem":91},"Typed Groups","\u002Flearn\u002Fconcepts\u002Ftyped-groups","2.learn\u002F2.concepts\u002F5.typed-groups",{"title":59,"path":93,"stem":94},"\u002Flearn\u002Fconcepts\u002Ftracing","2.learn\u002F2.concepts\u002F6.tracing",{"title":96,"path":97,"stem":98},"App Loop","\u002Flearn\u002Fconcepts\u002Fapp-loop","2.learn\u002F2.concepts\u002F7.app-loop",{"title":100,"path":101,"stem":102,"children":103},"How-To Guides","\u002Flearn\u002Fhow-to","2.learn\u002F3.how-to\u002Findex",[104,105,109,113,117,121,125,129],{"title":100,"path":101,"stem":102},{"title":106,"path":107,"stem":108},"Override Configs","\u002Flearn\u002Fhow-to\u002Foverride-configs","2.learn\u002F3.how-to\u002F1.override-configs",{"title":110,"path":111,"stem":112},"Safe Loading","\u002Flearn\u002Fhow-to\u002Fsafe-loading","2.learn\u002F3.how-to\u002F2.safe-loading",{"title":114,"path":115,"stem":116},"Custom Resolvers","\u002Flearn\u002Fhow-to\u002Fcustom-resolvers","2.learn\u002F3.how-to\u002F3.custom-resolvers",{"title":118,"path":119,"stem":120},"Lint and Strict Mode","\u002Flearn\u002Fhow-to\u002Flint-and-strict","2.learn\u002F3.how-to\u002F4.lint-and-strict",{"title":122,"path":123,"stem":124},"Publishing a reproducible app with laco app","\u002Flearn\u002Fhow-to\u002Flaco-app","2.learn\u002F3.how-to\u002F5.laco-app",{"title":126,"path":127,"stem":128},"Reproduce an Experiment","\u002Flearn\u002Fhow-to\u002Freproduce-experiment","2.learn\u002F3.how-to\u002F6.reproduce-experiment",{"title":130,"path":131,"stem":132},"Migrate from argparse","\u002Flearn\u002Fhow-to\u002Fmigrate-from-argparse","2.learn\u002F3.how-to\u002F7.migrate-from-argparse",{"title":134,"path":135,"stem":136,"children":137},"Examples Curriculum","\u002Flearn\u002Fexamples","2.learn\u002F4.examples\u002Findex",[138,139,143,147,151],{"title":134,"path":135,"stem":136},{"title":140,"path":141,"stem":142},"Foundation Examples","\u002Flearn\u002Fexamples\u002Ffoundations","2.learn\u002F4.examples\u002F1.foundations",{"title":144,"path":145,"stem":146},"Building Blocks","\u002Flearn\u002Fexamples\u002Fbuilding-blocks","2.learn\u002F4.examples\u002F2.building-blocks",{"title":148,"path":149,"stem":150},"Typed-Group Variants","\u002Flearn\u002Fexamples\u002Ftyped-variants","2.learn\u002F4.examples\u002F3.typed-variants",{"title":152,"path":153,"stem":154},"End-to-End Pipelines","\u002Flearn\u002Fexamples\u002Fpipelines","2.learn\u002F4.examples\u002F4.pipelines",{"title":156,"path":157,"stem":158,"children":159},"Resources","\u002Fresources","3.resources",[160,162,166,170],{"title":156,"path":157,"stem":161},"3.resources\u002Findex",{"title":163,"path":164,"stem":165},"Integrations","\u002Fresources\u002Fintegrations","3.resources\u002F1.integrations",{"title":167,"path":168,"stem":169},"Migration guide: Laco 0.x → 1.0","\u002Fresources\u002Fmigration-0.x-to-1.0","3.resources\u002F2.migration-0.x-to-1.0",{"title":171,"path":172,"stem":173},"Laco vs hydra-zen","\u002Fresources\u002Flaco-vs-hydra-zen","3.resources\u002F3.laco-vs-hydra-zen",{"title":175,"path":176,"stem":177,"children":178},"API Reference","\u002Fapi","4.api\u002Findex",[179],{"title":175,"path":176,"stem":177},{"title":181,"path":182,"stem":183},"Lazy Configuration for Python","\u002F","index",[185,188,191,194,197,200,203],{"title":186,"path":187},"cli","\u002Fapi\u002Fcli",{"title":189,"path":190},"compat","\u002Fapi\u002Fcompat",{"title":192,"path":193},"handler","\u002Fapi\u002Fhandler",{"title":195,"path":196},"keys","\u002Fapi\u002Fkeys",{"title":198,"path":199},"language","\u002Fapi\u002Flanguage",{"title":201,"path":202},"ops","\u002Fapi\u002Fops",{"title":204,"path":205},"utils","\u002Fapi\u002Futils",{"id":207,"title":27,"body":208,"description":3455,"extension":3456,"meta":3457,"navigation":3458,"path":28,"seo":3459,"stem":29,"__hash__":3460},"content\u002F2.learn\u002F1.tutorials\u002F02.first-steps.md",{"type":209,"value":210,"toc":3430},"minimark",[211,215,228,242,245,324,327,335,342,548,553,556,561,579,621,636,654,778,781,784,804,806,813,819,937,940,943,948,974,984,987,1164,1167,1170,1172,1176,1179,1357,1360,1365,1437,1454,1457,1493,1496,1510,1517,1520,1783,1786,1799,1801,1805,1813,1824,1830,1953,1956,1963,2003,2006,2052,2055,2101,2104,2124,2127,2299,2302,2304,2311,2326,2406,2409,2466,2469,2595,2598,2603,2658,2670,2672,2680,2683,2766,2775,2780,2825,2841,2843,2847,2850,3323,3326,3329,3331,3335,3338,3346,3359,3365,3371,3377,3383,3390,3409,3411,3426],[212,213,27],"h1",{"id":214},"first-steps-with-laco",[216,217,218,222,223,227],"p",{},[219,220,221],"strong",{},"Prerequisites:"," ",[224,225,226],"code",{},"01.why-laco.ipynb"," (the lie-typing contract).",[216,229,230,233,234,237,238,241],{},[219,231,232],{},"Dependencies:"," Only ",[224,235,236],{},"laco"," is required to run the first four sections. Cells that\nrequire PyTorch are labeled with a ",[224,239,240],{},"# torch required"," comment.",[216,243,244],{},"By the end of this notebook you will be comfortable with the four core tools:",[246,247,248,261],"table",{},[249,250,251],"thead",{},[252,253,254,258],"tr",{},[255,256,257],"th",{},"Tool",[255,259,260],{},"What it does",[262,263,264,283,296,306],"tbody",{},[252,265,266,272],{},[267,268,269],"td",{},[224,270,271],{},"L.call(T)(**kw)",[267,273,274,275,279,280],{},"Build a ",[276,277,278],"em",{},"recipe"," that will call ",[224,281,282],{},"T(**kw)",[252,284,285,290],{},[267,286,287],{},[224,288,289],{},"laco.instantiate(cfg)",[267,291,292,293],{},"Execute the recipe: returns a real ",[224,294,295],{},"T",[252,297,298,303],{},[267,299,300],{},[224,301,302],{},"laco.dump(cfg)",[267,304,305],{},"Serialize a recipe to a YAML string",[252,307,308,313],{},[267,309,310],{},[224,311,312],{},"laco.load(uri)",[267,314,315,316,319,320,323],{},"Load a recipe from a ",[224,317,318],{},".py"," or ",[224,321,322],{},".yaml"," config file",[325,326],"hr",{},[328,329,331,332],"h2",{"id":330},"section-1-your-first-lcall","Section 1: Your First ",[224,333,334],{},"L.call",[216,336,337,338,341],{},"Start with a plain Python ",[224,339,340],{},"dict",", no torch needed, so you can run this cell\nimmediately.",[343,344,349],"pre",{"className":345,"code":346,"language":347,"meta":348,"style":348},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","import laco\nimport laco.language as L\n\n# Build a recipe that says: \"call dict(a=1, b=2, c=3)\"\ncfg = L.call(dict)(a=1, b=2, c=3)\n\nprint(\"Value  :\", cfg)\nprint(\"Type   :\", type(cfg))\nprint(\"_target_:\", cfg._target_)  # noqa: LACO001\n","python","",[224,350,351,364,385,392,399,461,466,492,519],{"__ignoreMap":348},[352,353,356,360],"span",{"class":354,"line":355},"line",1,[352,357,359],{"class":358},"sVHd0","import",[352,361,363],{"class":362},"su5hD"," laco\n",[352,365,367,369,372,376,379,382],{"class":354,"line":366},2,[352,368,359],{"class":358},[352,370,371],{"class":362}," laco",[352,373,375],{"class":374},"sP7_E",".",[352,377,198],{"class":378},"skxfh",[352,380,381],{"class":358}," as",[352,383,384],{"class":362}," L\n",[352,386,388],{"class":354,"line":387},3,[352,389,391],{"emptyLinePlaceholder":390},true,"\n",[352,393,395],{"class":354,"line":394},4,[352,396,398],{"class":397},"sutJx","# Build a recipe that says: \"call dict(a=1, b=2, c=3)\"\n",[352,400,402,405,409,412,414,418,421,424,427,431,433,437,440,443,445,448,450,453,455,458],{"class":354,"line":401},5,[352,403,404],{"class":362},"cfg ",[352,406,408],{"class":407},"smGrS","=",[352,410,411],{"class":362}," L",[352,413,375],{"class":374},[352,415,417],{"class":416},"slqww","call",[352,419,420],{"class":374},"(",[352,422,340],{"class":423},"sZMiF",[352,425,426],{"class":374},")(",[352,428,430],{"class":429},"s99_P","a",[352,432,408],{"class":407},[352,434,436],{"class":435},"srdBf","1",[352,438,439],{"class":374},",",[352,441,442],{"class":429}," b",[352,444,408],{"class":407},[352,446,447],{"class":435},"2",[352,449,439],{"class":374},[352,451,452],{"class":429}," c",[352,454,408],{"class":407},[352,456,457],{"class":435},"3",[352,459,460],{"class":374},")\n",[352,462,464],{"class":354,"line":463},6,[352,465,391],{"emptyLinePlaceholder":390},[352,467,469,473,475,479,483,485,487,490],{"class":354,"line":468},7,[352,470,472],{"class":471},"sptTA","print",[352,474,420],{"class":374},[352,476,478],{"class":477},"sjJ54","\"",[352,480,482],{"class":481},"s_sjI","Value  :",[352,484,478],{"class":477},[352,486,439],{"class":374},[352,488,489],{"class":416}," cfg",[352,491,460],{"class":374},[352,493,495,497,499,501,504,506,508,511,513,516],{"class":354,"line":494},8,[352,496,472],{"class":471},[352,498,420],{"class":374},[352,500,478],{"class":477},[352,502,503],{"class":481},"Type   :",[352,505,478],{"class":477},[352,507,439],{"class":374},[352,509,510],{"class":423}," type",[352,512,420],{"class":374},[352,514,515],{"class":416},"cfg",[352,517,518],{"class":374},"))\n",[352,520,522,524,526,528,531,533,535,537,539,542,545],{"class":354,"line":521},9,[352,523,472],{"class":471},[352,525,420],{"class":374},[352,527,478],{"class":477},[352,529,530],{"class":481},"_target_:",[352,532,478],{"class":477},[352,534,439],{"class":374},[352,536,489],{"class":416},[352,538,375],{"class":374},[352,540,541],{"class":378},"_target_",[352,543,544],{"class":374},")",[352,546,547],{"class":397},"  # noqa: LACO001\n",[549,550],"docyard-notebook-output",{"data":551,"kind":552},"VmFsdWUgIDogeydfdGFyZ2V0Xyc6ICdidWlsdGlucy5kaWN0JywgJ19jb252ZXJ0Xyc6ICdhbGwnLCAnYSc6IDEsICdiJzogMiwgJ2MnOiAzfQpUeXBlICAgOiA8Y2xhc3MgJ29tZWdhY29uZi5kaWN0Y29uZmlnLkRpY3RDb25maWcnPgpfdGFyZ2V0XzogYnVpbHRpbnMuZGljdAo=","stream",[549,554],{"data":555,"kind":552},"PGNlbGwtMTI+OjU6IExhenlDYWxsSW50cm9zcGVjdGlvbldhcm5pbmc6IEwuY2FsbChkaWN0LCBzdHJpY3Q9VHJ1ZSk6IGNhbm5vdCBpbnRyb3NwZWN0IHRhcmdldCBzaWduYXR1cmU7IHN0cmljdC1tb2RlIGt3YXJnIHZhbGlkYXRpb24gaXMgZGlzYWJsZWQgZm9yIHRoaXMgY2FsbC4gUGFzcyBgc3RyaWN0PUZhbHNlYCBleHBsaWNpdGx5IHRvIHNpbGVuY2UgdGhpcyB3YXJuaW5nLgogIGNmZyA9IEwuY2FsbChkaWN0KShhPTEsIGI9MiwgYz0zKQo=",[216,557,558],{},[219,559,560],{},"What just happened?",[216,562,563,566,567,570,571,574,575,578],{},[224,564,565],{},"L.call(dict)"," returns a ",[276,568,569],{},"callable factory",": think of it like a curried constructor.\nWhen you call it with ",[224,572,573],{},"(a=1, b=2, c=3)"," you get back a ",[224,576,577],{},"DictConfig"," (an OmegaConf\nstructured dict) that stores:",[580,581,582,594,612],"ul",{},[583,584,585,587,588,590,591],"li",{},[224,586,541],{},": the fully-qualified import path of ",[224,589,340],{}," → ",[224,592,593],{},"\"builtins.dict\"",[583,595,596,598,599,598,602,605,606,598,608,598,610],{},[224,597,430],{},", ",[224,600,601],{},"b",[224,603,604],{},"c",": ",[224,607,436],{},[224,609,447],{},[224,611,457],{},[583,613,614,605,617,620],{},[224,615,616],{},"_convert_",[224,618,619],{},"\"all\""," (how OmegaConf types are converted on instantiation; more on\nthis in Section 3)",[216,622,623,624,626,627,629,630,632,633,375],{},"No ",[224,625,340],{}," has been constructed yet. ",[224,628,515],{}," is a ",[276,631,278],{},", not a ",[276,634,635],{},"result",[637,638,639],"blockquote",{},[216,640,641,644,645,647,648,650,651,653],{},[219,642,643],{},"The lie-typing contract:"," your type checker (pyright, mypy, VS Code) sees ",[224,646,515],{}," as\ntype ",[224,649,340],{},". At runtime it is a ",[224,652,577],{},". This lets you nest configs while keeping\nstatic types.",[343,655,657],{"className":345,"code":656,"language":347,"meta":348,"style":348},"# A slightly more interesting example: build a recipe for dict\ncfg2 = L.call(dict)(name=\"laco\", version=1)\nprint(\"target :\", cfg2._target_)  # noqa: LACO001\nprint(\"name   :\", cfg2.name)\nprint(\"version:\", cfg2.version)\n",[224,658,659,664,705,731,754],{"__ignoreMap":348},[352,660,661],{"class":354,"line":355},[352,662,663],{"class":397},"# A slightly more interesting example: build a recipe for dict\n",[352,665,666,669,671,673,675,677,679,681,683,686,688,690,692,694,696,699,701,703],{"class":354,"line":366},[352,667,668],{"class":362},"cfg2 ",[352,670,408],{"class":407},[352,672,411],{"class":362},[352,674,375],{"class":374},[352,676,417],{"class":416},[352,678,420],{"class":374},[352,680,340],{"class":423},[352,682,426],{"class":374},[352,684,685],{"class":429},"name",[352,687,408],{"class":407},[352,689,478],{"class":477},[352,691,236],{"class":481},[352,693,478],{"class":477},[352,695,439],{"class":374},[352,697,698],{"class":429}," version",[352,700,408],{"class":407},[352,702,436],{"class":435},[352,704,460],{"class":374},[352,706,707,709,711,713,716,718,720,723,725,727,729],{"class":354,"line":387},[352,708,472],{"class":471},[352,710,420],{"class":374},[352,712,478],{"class":477},[352,714,715],{"class":481},"target :",[352,717,478],{"class":477},[352,719,439],{"class":374},[352,721,722],{"class":416}," cfg2",[352,724,375],{"class":374},[352,726,541],{"class":378},[352,728,544],{"class":374},[352,730,547],{"class":397},[352,732,733,735,737,739,742,744,746,748,750,752],{"class":354,"line":394},[352,734,472],{"class":471},[352,736,420],{"class":374},[352,738,478],{"class":477},[352,740,741],{"class":481},"name   :",[352,743,478],{"class":477},[352,745,439],{"class":374},[352,747,722],{"class":416},[352,749,375],{"class":374},[352,751,685],{"class":378},[352,753,460],{"class":374},[352,755,756,758,760,762,765,767,769,771,773,776],{"class":354,"line":401},[352,757,472],{"class":471},[352,759,420],{"class":374},[352,761,478],{"class":477},[352,763,764],{"class":481},"version:",[352,766,478],{"class":477},[352,768,439],{"class":374},[352,770,722],{"class":416},[352,772,375],{"class":374},[352,774,775],{"class":378},"version",[352,777,460],{"class":374},[549,779],{"data":780,"kind":552},"dGFyZ2V0IDogYnVpbHRpbnMuZGljdApuYW1lICAgOiBsYWNvCnZlcnNpb246IDEK",[549,782],{"data":783,"kind":552},"PGNlbGwtMTM+OjI6IExhenlDYWxsSW50cm9zcGVjdGlvbldhcm5pbmc6IEwuY2FsbChkaWN0LCBzdHJpY3Q9VHJ1ZSk6IGNhbm5vdCBpbnRyb3NwZWN0IHRhcmdldCBzaWduYXR1cmU7IHN0cmljdC1tb2RlIGt3YXJnIHZhbGlkYXRpb24gaXMgZGlzYWJsZWQgZm9yIHRoaXMgY2FsbC4gUGFzcyBgc3RyaWN0PUZhbHNlYCBleHBsaWNpdGx5IHRvIHNpbGVuY2UgdGhpcyB3YXJuaW5nLgogIGNmZzIgPSBMLmNhbGwoZGljdCkobmFtZT0ibGFjbyIsIHZlcnNpb249MSkK",[216,785,786,787,790,791,793,794,796,797,800,801,375],{},"Notice that you can read ",[276,788,789],{},"back"," the stored kwargs as attributes on the ",[224,792,577],{},".\nThis is because ",[224,795,577],{}," behaves like both a dict and an object: ",[224,798,799],{},"cfg2.name"," is\nthe same as ",[224,802,803],{},"cfg2[\"name\"]",[325,805],{},[328,807,809,810],{"id":808},"section-2-materialising-with-lacoinstantiate","Section 2: Materialising with ",[224,811,812],{},"laco.instantiate",[216,814,815,816,818],{},"A recipe is useless until you bake it. ",[224,817,812],{}," is the oven.",[343,820,822],{"className":345,"code":821,"language":347,"meta":348,"style":348},"cfg = L.call(dict)(a=1, b=2, c=3)\n\nresult = laco.instantiate(cfg)\n\nprint(\"result      :\", result)\nprint(\"type(result):\", type(result))\n",[224,823,824,866,870,890,894,914],{"__ignoreMap":348},[352,825,826,828,830,832,834,836,838,840,842,844,846,848,850,852,854,856,858,860,862,864],{"class":354,"line":355},[352,827,404],{"class":362},[352,829,408],{"class":407},[352,831,411],{"class":362},[352,833,375],{"class":374},[352,835,417],{"class":416},[352,837,420],{"class":374},[352,839,340],{"class":423},[352,841,426],{"class":374},[352,843,430],{"class":429},[352,845,408],{"class":407},[352,847,436],{"class":435},[352,849,439],{"class":374},[352,851,442],{"class":429},[352,853,408],{"class":407},[352,855,447],{"class":435},[352,857,439],{"class":374},[352,859,452],{"class":429},[352,861,408],{"class":407},[352,863,457],{"class":435},[352,865,460],{"class":374},[352,867,868],{"class":354,"line":366},[352,869,391],{"emptyLinePlaceholder":390},[352,871,872,875,877,879,881,884,886,888],{"class":354,"line":387},[352,873,874],{"class":362},"result ",[352,876,408],{"class":407},[352,878,371],{"class":362},[352,880,375],{"class":374},[352,882,883],{"class":416},"instantiate",[352,885,420],{"class":374},[352,887,515],{"class":416},[352,889,460],{"class":374},[352,891,892],{"class":354,"line":394},[352,893,391],{"emptyLinePlaceholder":390},[352,895,896,898,900,902,905,907,909,912],{"class":354,"line":401},[352,897,472],{"class":471},[352,899,420],{"class":374},[352,901,478],{"class":477},[352,903,904],{"class":481},"result      :",[352,906,478],{"class":477},[352,908,439],{"class":374},[352,910,911],{"class":416}," result",[352,913,460],{"class":374},[352,915,916,918,920,922,925,927,929,931,933,935],{"class":354,"line":463},[352,917,472],{"class":471},[352,919,420],{"class":374},[352,921,478],{"class":477},[352,923,924],{"class":481},"type(result):",[352,926,478],{"class":477},[352,928,439],{"class":374},[352,930,510],{"class":423},[352,932,420],{"class":374},[352,934,635],{"class":416},[352,936,518],{"class":374},[549,938],{"data":939,"kind":552},"cmVzdWx0ICAgICAgOiB7J2EnOiAxLCAnYic6IDIsICdjJzogM30KdHlwZShyZXN1bHQpOiA8Y2xhc3MgJ2RpY3QnPgo=",[549,941],{"data":942,"kind":552},"PGNlbGwtMTQ+OjE6IExhenlDYWxsSW50cm9zcGVjdGlvbldhcm5pbmc6IEwuY2FsbChkaWN0LCBzdHJpY3Q9VHJ1ZSk6IGNhbm5vdCBpbnRyb3NwZWN0IHRhcmdldCBzaWduYXR1cmU7IHN0cmljdC1tb2RlIGt3YXJnIHZhbGlkYXRpb24gaXMgZGlzYWJsZWQgZm9yIHRoaXMgY2FsbC4gUGFzcyBgc3RyaWN0PUZhbHNlYCBleHBsaWNpdGx5IHRvIHNpbGVuY2UgdGhpcyB3YXJuaW5nLgogIGNmZyA9IEwuY2FsbChkaWN0KShhPTEsIGI9MiwgYz0zKQo=",[216,944,945,947],{},[224,946,812],{}," works by:",[949,950,951,959,965],"ol",{},[583,952,953,954,605,957],{},"Reading ",[224,955,956],{},"cfg._target_",[224,958,593],{},[583,960,961,962],{},"Importing the target: ",[224,963,964],{},"import builtins; cls = builtins.dict",[583,966,967,968,605,971],{},"Calling ",[224,969,970],{},"cls(**remaining_kwargs)",[224,972,973],{},"dict(a=1, b=2, c=3)",[216,975,976,977,980,981,983],{},"If the recipe contains ",[276,978,979],{},"nested"," recipes (e.g. a model config that contains an\noptimizer config), ",[224,982,883],{}," recurses depth-first by default.",[216,985,986],{},"Let's see a nested example with pure stdlib types:",[343,988,990],{"className":345,"code":989,"language":347,"meta":348,"style":348},"from collections import OrderedDict\n\n# Outer recipe: a dict whose 'mapping' value is itself a recipe\ninner_cfg = L.call(dict)(x=10, y=20)\nouter_cfg = L.call(dict)(label=\"point\", coords=inner_cfg)\n\n# Instantiate the outer recipe — inner is instantiated first (recursive=True by default)\nresult = laco.instantiate(outer_cfg)\nprint(result)\nprint(type(result[\"coords\"]))   # dict, not DictConfig\n",[224,991,992,1005,1009,1014,1053,1096,1100,1105,1124,1134],{"__ignoreMap":348},[352,993,994,997,1000,1002],{"class":354,"line":355},[352,995,996],{"class":358},"from",[352,998,999],{"class":362}," collections ",[352,1001,359],{"class":358},[352,1003,1004],{"class":362}," OrderedDict\n",[352,1006,1007],{"class":354,"line":366},[352,1008,391],{"emptyLinePlaceholder":390},[352,1010,1011],{"class":354,"line":387},[352,1012,1013],{"class":397},"# Outer recipe: a dict whose 'mapping' value is itself a recipe\n",[352,1015,1016,1019,1021,1023,1025,1027,1029,1031,1033,1036,1038,1041,1043,1046,1048,1051],{"class":354,"line":394},[352,1017,1018],{"class":362},"inner_cfg ",[352,1020,408],{"class":407},[352,1022,411],{"class":362},[352,1024,375],{"class":374},[352,1026,417],{"class":416},[352,1028,420],{"class":374},[352,1030,340],{"class":423},[352,1032,426],{"class":374},[352,1034,1035],{"class":429},"x",[352,1037,408],{"class":407},[352,1039,1040],{"class":435},"10",[352,1042,439],{"class":374},[352,1044,1045],{"class":429}," y",[352,1047,408],{"class":407},[352,1049,1050],{"class":435},"20",[352,1052,460],{"class":374},[352,1054,1055,1058,1060,1062,1064,1066,1068,1070,1072,1075,1077,1079,1082,1084,1086,1089,1091,1094],{"class":354,"line":401},[352,1056,1057],{"class":362},"outer_cfg ",[352,1059,408],{"class":407},[352,1061,411],{"class":362},[352,1063,375],{"class":374},[352,1065,417],{"class":416},[352,1067,420],{"class":374},[352,1069,340],{"class":423},[352,1071,426],{"class":374},[352,1073,1074],{"class":429},"label",[352,1076,408],{"class":407},[352,1078,478],{"class":477},[352,1080,1081],{"class":481},"point",[352,1083,478],{"class":477},[352,1085,439],{"class":374},[352,1087,1088],{"class":429}," coords",[352,1090,408],{"class":407},[352,1092,1093],{"class":416},"inner_cfg",[352,1095,460],{"class":374},[352,1097,1098],{"class":354,"line":463},[352,1099,391],{"emptyLinePlaceholder":390},[352,1101,1102],{"class":354,"line":468},[352,1103,1104],{"class":397},"# Instantiate the outer recipe — inner is instantiated first (recursive=True by default)\n",[352,1106,1107,1109,1111,1113,1115,1117,1119,1122],{"class":354,"line":494},[352,1108,874],{"class":362},[352,1110,408],{"class":407},[352,1112,371],{"class":362},[352,1114,375],{"class":374},[352,1116,883],{"class":416},[352,1118,420],{"class":374},[352,1120,1121],{"class":416},"outer_cfg",[352,1123,460],{"class":374},[352,1125,1126,1128,1130,1132],{"class":354,"line":521},[352,1127,472],{"class":471},[352,1129,420],{"class":374},[352,1131,635],{"class":416},[352,1133,460],{"class":374},[352,1135,1137,1139,1141,1144,1146,1148,1151,1153,1156,1158,1161],{"class":354,"line":1136},10,[352,1138,472],{"class":471},[352,1140,420],{"class":374},[352,1142,1143],{"class":423},"type",[352,1145,420],{"class":374},[352,1147,635],{"class":416},[352,1149,1150],{"class":374},"[",[352,1152,478],{"class":477},[352,1154,1155],{"class":481},"coords",[352,1157,478],{"class":477},[352,1159,1160],{"class":374},"]))",[352,1162,1163],{"class":397},"   # dict, not DictConfig\n",[549,1165],{"data":1166,"kind":552},"eydsYWJlbCc6ICdwb2ludCcsICdjb29yZHMnOiB7J3gnOiAxMCwgJ3knOiAyMH19CjxjbGFzcyAnZGljdCc+Cg==",[549,1168],{"data":1169,"kind":552},"PGNlbGwtMTU+OjQ6IExhenlDYWxsSW50cm9zcGVjdGlvbldhcm5pbmc6IEwuY2FsbChkaWN0LCBzdHJpY3Q9VHJ1ZSk6IGNhbm5vdCBpbnRyb3NwZWN0IHRhcmdldCBzaWduYXR1cmU7IHN0cmljdC1tb2RlIGt3YXJnIHZhbGlkYXRpb24gaXMgZGlzYWJsZWQgZm9yIHRoaXMgY2FsbC4gUGFzcyBgc3RyaWN0PUZhbHNlYCBleHBsaWNpdGx5IHRvIHNpbGVuY2UgdGhpcyB3YXJuaW5nLgogIGlubmVyX2NmZyA9IEwuY2FsbChkaWN0KSh4PTEwLCB5PTIwKQo=",[325,1171],{},[328,1173,1175],{"id":1174},"section-3-inspecting-the-wire-format","Section 3: Inspecting the Wire Format",[216,1177,1178],{},"Every Laco recipe stores a small set of reserved keys alongside your kwargs.",[343,1180,1182],{"className":345,"code":1181,"language":347,"meta":348,"style":348},"cfg = L.call(dict)(a=1, b=2, c=3)\n\n# Iterate all keys in the DictConfig\nfrom omegaconf import OmegaConf\n\nprint(\"All keys in the recipe:\")\nfor key, value in OmegaConf.to_container(cfg, resolve=False).items():\n    print(f\"  {key!r:20} -> {value!r}\")\n",[224,1183,1184,1226,1230,1235,1247,1251,1266,1314],{"__ignoreMap":348},[352,1185,1186,1188,1190,1192,1194,1196,1198,1200,1202,1204,1206,1208,1210,1212,1214,1216,1218,1220,1222,1224],{"class":354,"line":355},[352,1187,404],{"class":362},[352,1189,408],{"class":407},[352,1191,411],{"class":362},[352,1193,375],{"class":374},[352,1195,417],{"class":416},[352,1197,420],{"class":374},[352,1199,340],{"class":423},[352,1201,426],{"class":374},[352,1203,430],{"class":429},[352,1205,408],{"class":407},[352,1207,436],{"class":435},[352,1209,439],{"class":374},[352,1211,442],{"class":429},[352,1213,408],{"class":407},[352,1215,447],{"class":435},[352,1217,439],{"class":374},[352,1219,452],{"class":429},[352,1221,408],{"class":407},[352,1223,457],{"class":435},[352,1225,460],{"class":374},[352,1227,1228],{"class":354,"line":366},[352,1229,391],{"emptyLinePlaceholder":390},[352,1231,1232],{"class":354,"line":387},[352,1233,1234],{"class":397},"# Iterate all keys in the DictConfig\n",[352,1236,1237,1239,1242,1244],{"class":354,"line":394},[352,1238,996],{"class":358},[352,1240,1241],{"class":362}," omegaconf ",[352,1243,359],{"class":358},[352,1245,1246],{"class":362}," OmegaConf\n",[352,1248,1249],{"class":354,"line":401},[352,1250,391],{"emptyLinePlaceholder":390},[352,1252,1253,1255,1257,1259,1262,1264],{"class":354,"line":463},[352,1254,472],{"class":471},[352,1256,420],{"class":374},[352,1258,478],{"class":477},[352,1260,1261],{"class":481},"All keys in the recipe:",[352,1263,478],{"class":477},[352,1265,460],{"class":374},[352,1267,1268,1271,1274,1276,1279,1282,1285,1287,1290,1292,1294,1296,1299,1301,1305,1308,1311],{"class":354,"line":468},[352,1269,1270],{"class":358},"for",[352,1272,1273],{"class":362}," key",[352,1275,439],{"class":374},[352,1277,1278],{"class":362}," value ",[352,1280,1281],{"class":358},"in",[352,1283,1284],{"class":362}," OmegaConf",[352,1286,375],{"class":374},[352,1288,1289],{"class":416},"to_container",[352,1291,420],{"class":374},[352,1293,515],{"class":416},[352,1295,439],{"class":374},[352,1297,1298],{"class":429}," resolve",[352,1300,408],{"class":407},[352,1302,1304],{"class":1303},"s39Yj","False",[352,1306,1307],{"class":374},").",[352,1309,1310],{"class":416},"items",[352,1312,1313],{"class":374},"():\n",[352,1315,1316,1319,1321,1325,1328,1331,1334,1337,1340,1343,1345,1348,1351,1353,1355],{"class":354,"line":494},[352,1317,1318],{"class":471},"    print",[352,1320,420],{"class":374},[352,1322,1324],{"class":1323},"sbsja","f",[352,1326,1327],{"class":481},"\"  ",[352,1329,1330],{"class":435},"{",[352,1332,1333],{"class":416},"key",[352,1335,1336],{"class":1323},"!r:20",[352,1338,1339],{"class":435},"}",[352,1341,1342],{"class":481}," -> ",[352,1344,1330],{"class":435},[352,1346,1347],{"class":416},"value",[352,1349,1350],{"class":1323},"!r",[352,1352,1339],{"class":435},[352,1354,478],{"class":481},[352,1356,460],{"class":374},[549,1358],{"data":1359,"kind":552},"QWxsIGtleXMgaW4gdGhlIHJlY2lwZToKICAnX3RhcmdldF8nICAgICAgICAgICAtPiAnYnVpbHRpbnMuZGljdCcKICAnX2NvbnZlcnRfJyAgICAgICAgICAtPiAnYWxsJwogICdhJyAgICAgICAgICAgICAgICAgIC0+IDEKICAnYicgICAgICAgICAgICAgICAgICAtPiAyCiAgJ2MnICAgICAgICAgICAgICAgICAgLT4gMwo=",[216,1361,1362],{},[219,1363,1364],{},"Reserved keys and their meanings:",[246,1366,1367,1377],{},[249,1368,1369],{},[252,1370,1371,1374],{},[255,1372,1373],{},"Key",[255,1375,1376],{},"Meaning",[262,1378,1379,1388,1400,1413],{},[252,1380,1381,1385],{},[267,1382,1383],{},[224,1384,541],{},[267,1386,1387],{},"Fully-qualified import path of the class\u002Ffunction to call",[252,1389,1390,1394],{},[267,1391,1392],{},[224,1393,616],{},[267,1395,1396,1397,1399],{},"How OmegaConf containers are converted. ",[224,1398,619],{}," means ListConfig\u002FDictConfig are converted to plain Python list\u002Fdict before being passed to the target",[252,1401,1402,1407],{},[267,1403,1404],{},[224,1405,1406],{},"_recursive_",[267,1408,1409,1410,544],{},"Whether nested recipes are instantiated recursively (default ",[224,1411,1412],{},"True",[252,1414,1415,1420],{},[267,1416,1417],{},[224,1418,1419],{},"_partial_",[267,1421,1422,1423,1425,1426,1429,1430,1432,1433,1436],{},"Set to ",[224,1424,1412],{}," by ",[224,1427,1428],{},"L.partial",". ",[224,1431,883],{}," returns ",[224,1434,1435],{},"functools.partial"," instead of the live object",[216,1438,1439,1440,1443,1444,1447,1448,1450,1451,1453],{},"The ",[224,1441,1442],{},"_convert_=\"all\""," default is what makes ",[224,1445,1446],{},"result[\"coords\"]"," a plain ",[224,1449,340],{}," rather\nthan a ",[224,1452,577],{}," in the nested example above.",[216,1455,1456],{},"Now let's see how the recipe looks when serialized to YAML:",[343,1458,1460],{"className":345,"code":1459,"language":347,"meta":348,"style":348},"yaml_str = laco.dump(cfg)\nprint(yaml_str)\n",[224,1461,1462,1482],{"__ignoreMap":348},[352,1463,1464,1467,1469,1471,1473,1476,1478,1480],{"class":354,"line":355},[352,1465,1466],{"class":362},"yaml_str ",[352,1468,408],{"class":407},[352,1470,371],{"class":362},[352,1472,375],{"class":374},[352,1474,1475],{"class":416},"dump",[352,1477,420],{"class":374},[352,1479,515],{"class":416},[352,1481,460],{"class":374},[352,1483,1484,1486,1488,1491],{"class":354,"line":366},[352,1485,472],{"class":471},[352,1487,420],{"class":374},[352,1489,1490],{"class":416},"yaml_str",[352,1492,460],{"class":374},[549,1494],{"data":1495,"kind":552},"e19jb252ZXJ0XzogYWxsLCBfbGFjb186IDEsIF90YXJnZXRfOiBidWlsdGlucy5kaWN0LCBhOiAxLCBiOiAyLCBjOiAzfQoK",[216,1497,1498,1499,1502,1503,1506,1507,375],{},"Notice the ",[224,1500,1501],{},"_laco_: 1"," line at the top: this is a ",[219,1504,1505],{},"schema-version marker"," that\nLaco uses to detect version mismatches when loading files. You will always see it in\nfiles produced by ",[224,1508,1509],{},"laco.dump",[216,1511,1512,1513,1516],{},"The YAML output is a valid Hydra-compatible config: you could load it with plain Hydra\n(",[224,1514,1515],{},"hydra.utils.instantiate",") and get the same result.",[216,1518,1519],{},"Let's round-trip it:",[343,1521,1523],{"className":345,"code":1522,"language":347,"meta":348,"style":348},"import tempfile, pathlib\n\n# Write to a temp YAML file, then load it back\nwith tempfile.NamedTemporaryFile(mode=\"w\", suffix=\".yaml\", delete=False) as f:\n    f.write(yaml_str)\n    tmp_path = f.name\n\nreloaded = laco.load(tmp_path)\nprint(\"Reloaded type :\", type(reloaded))\nprint(\"_target_      :\", reloaded._target_)  # noqa: LACO001\nprint(\"a, b, c       :\", reloaded.a, reloaded.b, reloaded.c)\n\n# Clean up\npathlib.Path(tmp_path).unlink()\n",[224,1524,1525,1537,1541,1546,1604,1620,1634,1638,1659,1683,1709,1749,1754,1760],{"__ignoreMap":348},[352,1526,1527,1529,1532,1534],{"class":354,"line":355},[352,1528,359],{"class":358},[352,1530,1531],{"class":362}," tempfile",[352,1533,439],{"class":374},[352,1535,1536],{"class":362}," pathlib\n",[352,1538,1539],{"class":354,"line":366},[352,1540,391],{"emptyLinePlaceholder":390},[352,1542,1543],{"class":354,"line":387},[352,1544,1545],{"class":397},"# Write to a temp YAML file, then load it back\n",[352,1547,1548,1551,1553,1555,1558,1560,1563,1565,1567,1570,1572,1574,1577,1579,1581,1583,1585,1587,1590,1592,1594,1596,1598,1601],{"class":354,"line":394},[352,1549,1550],{"class":358},"with",[352,1552,1531],{"class":362},[352,1554,375],{"class":374},[352,1556,1557],{"class":416},"NamedTemporaryFile",[352,1559,420],{"class":374},[352,1561,1562],{"class":429},"mode",[352,1564,408],{"class":407},[352,1566,478],{"class":477},[352,1568,1569],{"class":481},"w",[352,1571,478],{"class":477},[352,1573,439],{"class":374},[352,1575,1576],{"class":429}," suffix",[352,1578,408],{"class":407},[352,1580,478],{"class":477},[352,1582,322],{"class":481},[352,1584,478],{"class":477},[352,1586,439],{"class":374},[352,1588,1589],{"class":429}," delete",[352,1591,408],{"class":407},[352,1593,1304],{"class":1303},[352,1595,544],{"class":374},[352,1597,381],{"class":358},[352,1599,1600],{"class":362}," f",[352,1602,1603],{"class":374},":\n",[352,1605,1606,1609,1611,1614,1616,1618],{"class":354,"line":401},[352,1607,1608],{"class":362},"    f",[352,1610,375],{"class":374},[352,1612,1613],{"class":416},"write",[352,1615,420],{"class":374},[352,1617,1490],{"class":416},[352,1619,460],{"class":374},[352,1621,1622,1625,1627,1629,1631],{"class":354,"line":463},[352,1623,1624],{"class":362},"    tmp_path ",[352,1626,408],{"class":407},[352,1628,1600],{"class":362},[352,1630,375],{"class":374},[352,1632,1633],{"class":378},"name\n",[352,1635,1636],{"class":354,"line":468},[352,1637,391],{"emptyLinePlaceholder":390},[352,1639,1640,1643,1645,1647,1649,1652,1654,1657],{"class":354,"line":494},[352,1641,1642],{"class":362},"reloaded ",[352,1644,408],{"class":407},[352,1646,371],{"class":362},[352,1648,375],{"class":374},[352,1650,1651],{"class":416},"load",[352,1653,420],{"class":374},[352,1655,1656],{"class":416},"tmp_path",[352,1658,460],{"class":374},[352,1660,1661,1663,1665,1667,1670,1672,1674,1676,1678,1681],{"class":354,"line":521},[352,1662,472],{"class":471},[352,1664,420],{"class":374},[352,1666,478],{"class":477},[352,1668,1669],{"class":481},"Reloaded type :",[352,1671,478],{"class":477},[352,1673,439],{"class":374},[352,1675,510],{"class":423},[352,1677,420],{"class":374},[352,1679,1680],{"class":416},"reloaded",[352,1682,518],{"class":374},[352,1684,1685,1687,1689,1691,1694,1696,1698,1701,1703,1705,1707],{"class":354,"line":1136},[352,1686,472],{"class":471},[352,1688,420],{"class":374},[352,1690,478],{"class":477},[352,1692,1693],{"class":481},"_target_      :",[352,1695,478],{"class":477},[352,1697,439],{"class":374},[352,1699,1700],{"class":416}," reloaded",[352,1702,375],{"class":374},[352,1704,541],{"class":378},[352,1706,544],{"class":374},[352,1708,547],{"class":397},[352,1710,1712,1714,1716,1718,1721,1723,1725,1727,1729,1731,1733,1735,1737,1739,1741,1743,1745,1747],{"class":354,"line":1711},11,[352,1713,472],{"class":471},[352,1715,420],{"class":374},[352,1717,478],{"class":477},[352,1719,1720],{"class":481},"a, b, c       :",[352,1722,478],{"class":477},[352,1724,439],{"class":374},[352,1726,1700],{"class":416},[352,1728,375],{"class":374},[352,1730,430],{"class":378},[352,1732,439],{"class":374},[352,1734,1700],{"class":416},[352,1736,375],{"class":374},[352,1738,601],{"class":378},[352,1740,439],{"class":374},[352,1742,1700],{"class":416},[352,1744,375],{"class":374},[352,1746,604],{"class":378},[352,1748,460],{"class":374},[352,1750,1752],{"class":354,"line":1751},12,[352,1753,391],{"emptyLinePlaceholder":390},[352,1755,1757],{"class":354,"line":1756},13,[352,1758,1759],{"class":397},"# Clean up\n",[352,1761,1763,1766,1768,1771,1773,1775,1777,1780],{"class":354,"line":1762},14,[352,1764,1765],{"class":362},"pathlib",[352,1767,375],{"class":374},[352,1769,1770],{"class":416},"Path",[352,1772,420],{"class":374},[352,1774,1656],{"class":416},[352,1776,1307],{"class":374},[352,1778,1779],{"class":416},"unlink",[352,1781,1782],{"class":374},"()\n",[549,1784],{"data":1785,"kind":552},"UmVsb2FkZWQgdHlwZSA6IDxjbGFzcyAnb21lZ2Fjb25mLmRpY3Rjb25maWcuRGljdENvbmZpZyc+Cl90YXJnZXRfICAgICAgOiBidWlsdGlucy5kaWN0CmEsIGIsIGMgICAgICAgOiAxIDIgMwo=",[216,1787,1788,1789,590,1791,590,1793,590,1796,1798],{},"The round-trip ",[224,1790,271],{},[224,1792,1509],{},[224,1794,1795],{},"laco.load",[224,1797,812],{},"\nis the heart of Laco's reproducibility story: configs are portable YAML files, but\nyou never have to write them by hand.",[325,1800],{},[328,1802,1804],{"id":1803},"section-4-loading-from-a-file","Section 4: Loading from a File",[637,1806,1807],{},[216,1808,1809,1812],{},[219,1810,1811],{},"Requires PyTorch"," from this section onwards. If you don't have torch installed,\nyou can read along: the concepts transfer directly to any other class.",[216,1814,1815,1816,1819,1820,1823],{},"Laco ships with example configs under the ",[224,1817,1818],{},"configs:\u002F\u002F"," URI scheme, which resolves to\nthe ",[224,1821,1822],{},"sources\u002Flaco\u002Fexamples\u002F"," directory inside the package.",[216,1825,1439,1826,1829],{},[224,1827,1828],{},"linear_regression.py"," example defines a model, an optimizer factory, and a\nhyperparameter namespace:",[343,1831,1833],{"className":345,"code":1832,"language":347,"meta":348,"style":348},"# torch required\nimport laco\n\n# Load the entire config module — returns a DictConfig with all exported names\ncfg = laco.load(\"configs:\u002F\u002Fexamples\u002Flinear_regression.py\")\n\nprint(\"type(cfg)  :\", type(cfg))\nprint(\"Top-level keys:\")\nfor key in cfg:\n    print(f\"  {key}\")\n",[224,1834,1835,1840,1846,1850,1855,1878,1882,1905,1920,1933],{"__ignoreMap":348},[352,1836,1837],{"class":354,"line":355},[352,1838,1839],{"class":397},"# torch required\n",[352,1841,1842,1844],{"class":354,"line":366},[352,1843,359],{"class":358},[352,1845,363],{"class":362},[352,1847,1848],{"class":354,"line":387},[352,1849,391],{"emptyLinePlaceholder":390},[352,1851,1852],{"class":354,"line":394},[352,1853,1854],{"class":397},"# Load the entire config module — returns a DictConfig with all exported names\n",[352,1856,1857,1859,1861,1863,1865,1867,1869,1871,1874,1876],{"class":354,"line":401},[352,1858,404],{"class":362},[352,1860,408],{"class":407},[352,1862,371],{"class":362},[352,1864,375],{"class":374},[352,1866,1651],{"class":416},[352,1868,420],{"class":374},[352,1870,478],{"class":477},[352,1872,1873],{"class":481},"configs:\u002F\u002Fexamples\u002Flinear_regression.py",[352,1875,478],{"class":477},[352,1877,460],{"class":374},[352,1879,1880],{"class":354,"line":463},[352,1881,391],{"emptyLinePlaceholder":390},[352,1883,1884,1886,1888,1890,1893,1895,1897,1899,1901,1903],{"class":354,"line":468},[352,1885,472],{"class":471},[352,1887,420],{"class":374},[352,1889,478],{"class":477},[352,1891,1892],{"class":481},"type(cfg)  :",[352,1894,478],{"class":477},[352,1896,439],{"class":374},[352,1898,510],{"class":423},[352,1900,420],{"class":374},[352,1902,515],{"class":416},[352,1904,518],{"class":374},[352,1906,1907,1909,1911,1913,1916,1918],{"class":354,"line":494},[352,1908,472],{"class":471},[352,1910,420],{"class":374},[352,1912,478],{"class":477},[352,1914,1915],{"class":481},"Top-level keys:",[352,1917,478],{"class":477},[352,1919,460],{"class":374},[352,1921,1922,1924,1927,1929,1931],{"class":354,"line":521},[352,1923,1270],{"class":358},[352,1925,1926],{"class":362}," key ",[352,1928,1281],{"class":358},[352,1930,489],{"class":362},[352,1932,1603],{"class":374},[352,1934,1935,1937,1939,1941,1943,1945,1947,1949,1951],{"class":354,"line":1136},[352,1936,1318],{"class":471},[352,1938,420],{"class":374},[352,1940,1324],{"class":1323},[352,1942,1327],{"class":481},[352,1944,1330],{"class":435},[352,1946,1333],{"class":416},[352,1948,1339],{"class":435},[352,1950,478],{"class":481},[352,1952,460],{"class":374},[549,1954],{"data":1955,"kind":552},"dHlwZShjZmcpICA6IDxjbGFzcyAnb21lZ2Fjb25mLmRpY3Rjb25maWcuRGljdENvbmZpZyc+ClRvcC1sZXZlbCBrZXlzOgogIGhwcwogIG1vZGVsCiAgb3B0aW1pemVyCg==",[216,1957,1958,1959,1962],{},"The config file exports three names (from its ",[224,1960,1961],{},"__all__","):",[580,1964,1965,1977,1992],{},[583,1966,1967,1972,1973,1976],{},[219,1968,1969],{},[224,1970,1971],{},"model",": an ",[224,1974,1975],{},"L.call(nn.Linear)"," recipe (eager construction)",[583,1978,1979,1972,1984,1987,1988,1991],{},[219,1980,1981],{},[224,1982,1983],{},"optimizer",[224,1985,1986],{},"L.partial(optim.SGD)"," recipe (deferred construction, needed\nbecause ",[224,1989,1990],{},"model.parameters()"," only exists after the model is built)",[583,1993,1994,1972,1999,2002],{},[219,1995,1996],{},[224,1997,1998],{},"hps",[224,2000,2001],{},"@L.params"," dataclass with all hyperparameters",[216,2004,2005],{},"Let's look at the model recipe:",[343,2007,2009],{"className":345,"code":2008,"language":347,"meta":348,"style":348},"# torch required\nprint(\"model recipe:\")\nprint(laco.dump(cfg.model))\n",[224,2010,2011,2015,2030],{"__ignoreMap":348},[352,2012,2013],{"class":354,"line":355},[352,2014,1839],{"class":397},[352,2016,2017,2019,2021,2023,2026,2028],{"class":354,"line":366},[352,2018,472],{"class":471},[352,2020,420],{"class":374},[352,2022,478],{"class":477},[352,2024,2025],{"class":481},"model recipe:",[352,2027,478],{"class":477},[352,2029,460],{"class":374},[352,2031,2032,2034,2036,2038,2040,2042,2044,2046,2048,2050],{"class":354,"line":387},[352,2033,472],{"class":471},[352,2035,420],{"class":374},[352,2037,236],{"class":416},[352,2039,375],{"class":374},[352,2041,1475],{"class":416},[352,2043,420],{"class":374},[352,2045,515],{"class":416},[352,2047,375],{"class":374},[352,2049,1971],{"class":378},[352,2051,518],{"class":374},[549,2053],{"data":2054,"kind":552},"bW9kZWwgcmVjaXBlOgp7X2NvbnZlcnRfOiBhbGwsIF9sYWNvXzogMSwgX3RhcmdldF86IHRvcmNoLm5uLkxpbmVhciwgYmlhczogJyR7aHBzLmJpYXN9JywgaW5fZmVhdHVyZXM6ICcke2hwcy5pbl9mZWF0dXJlc30nLAogIG91dF9mZWF0dXJlczogJyR7aHBzLm91dF9mZWF0dXJlc30nfQoK",[343,2056,2058],{"className":345,"code":2057,"language":347,"meta":348,"style":348},"# torch required\nprint(\"optimizer recipe:\")\nprint(laco.dump(cfg.optimizer))\n",[224,2059,2060,2064,2079],{"__ignoreMap":348},[352,2061,2062],{"class":354,"line":355},[352,2063,1839],{"class":397},[352,2065,2066,2068,2070,2072,2075,2077],{"class":354,"line":366},[352,2067,472],{"class":471},[352,2069,420],{"class":374},[352,2071,478],{"class":477},[352,2073,2074],{"class":481},"optimizer recipe:",[352,2076,478],{"class":477},[352,2078,460],{"class":374},[352,2080,2081,2083,2085,2087,2089,2091,2093,2095,2097,2099],{"class":354,"line":387},[352,2082,472],{"class":471},[352,2084,420],{"class":374},[352,2086,236],{"class":416},[352,2088,375],{"class":374},[352,2090,1475],{"class":416},[352,2092,420],{"class":374},[352,2094,515],{"class":416},[352,2096,375],{"class":374},[352,2098,1983],{"class":378},[352,2100,518],{"class":374},[549,2102],{"data":2103,"kind":552},"b3B0aW1pemVyIHJlY2lwZToKe19jb252ZXJ0XzogYWxsLCBfbGFjb186IDEsIF9wYXJ0aWFsXzogdHJ1ZSwgX3RhcmdldF86IHRvcmNoLm9wdGltLlNHRCwgbHI6ICcke2hwcy5sZWFybmluZ19yYXRlfScsCiAgbW9tZW50dW06ICcke2hwcy5tb21lbnR1bX0nfQoK",[216,2105,2106,2107,2110,2111,2113,2114,2116,2117,2119,2120,2123],{},"Notice that the optimizer dump shows ",[224,2108,2109],{},"_partial_: true",": this tells ",[224,2112,812],{},"\nto return a ",[224,2115,1435],{}," instead of a live optimizer. You then call the partial\nwith ",[224,2118,1990],{}," to get the real ",[224,2121,2122],{},"SGD"," instance.",[216,2125,2126],{},"Now let's instantiate the model:",[343,2128,2130],{"className":345,"code":2129,"language":347,"meta":348,"style":348},"# torch required\nmodel = laco.instantiate(cfg.model)\nprint(\"model type    :\", type(model))\nprint(\"model         :\", model)\n\n# The optimizer is a partial — call it with model.parameters()\nopt_factory = laco.instantiate(cfg.optimizer)\noptimizer   = opt_factory(model.parameters())\nprint(\"optimizer type:\", type(optimizer))\nprint(\"optimizer     :\", optimizer)\n",[224,2131,2132,2136,2159,2182,2202,2206,2211,2234,2256,2279],{"__ignoreMap":348},[352,2133,2134],{"class":354,"line":355},[352,2135,1839],{"class":397},[352,2137,2138,2141,2143,2145,2147,2149,2151,2153,2155,2157],{"class":354,"line":366},[352,2139,2140],{"class":362},"model ",[352,2142,408],{"class":407},[352,2144,371],{"class":362},[352,2146,375],{"class":374},[352,2148,883],{"class":416},[352,2150,420],{"class":374},[352,2152,515],{"class":416},[352,2154,375],{"class":374},[352,2156,1971],{"class":378},[352,2158,460],{"class":374},[352,2160,2161,2163,2165,2167,2170,2172,2174,2176,2178,2180],{"class":354,"line":387},[352,2162,472],{"class":471},[352,2164,420],{"class":374},[352,2166,478],{"class":477},[352,2168,2169],{"class":481},"model type    :",[352,2171,478],{"class":477},[352,2173,439],{"class":374},[352,2175,510],{"class":423},[352,2177,420],{"class":374},[352,2179,1971],{"class":416},[352,2181,518],{"class":374},[352,2183,2184,2186,2188,2190,2193,2195,2197,2200],{"class":354,"line":394},[352,2185,472],{"class":471},[352,2187,420],{"class":374},[352,2189,478],{"class":477},[352,2191,2192],{"class":481},"model         :",[352,2194,478],{"class":477},[352,2196,439],{"class":374},[352,2198,2199],{"class":416}," model",[352,2201,460],{"class":374},[352,2203,2204],{"class":354,"line":401},[352,2205,391],{"emptyLinePlaceholder":390},[352,2207,2208],{"class":354,"line":463},[352,2209,2210],{"class":397},"# The optimizer is a partial — call it with model.parameters()\n",[352,2212,2213,2216,2218,2220,2222,2224,2226,2228,2230,2232],{"class":354,"line":468},[352,2214,2215],{"class":362},"opt_factory ",[352,2217,408],{"class":407},[352,2219,371],{"class":362},[352,2221,375],{"class":374},[352,2223,883],{"class":416},[352,2225,420],{"class":374},[352,2227,515],{"class":416},[352,2229,375],{"class":374},[352,2231,1983],{"class":378},[352,2233,460],{"class":374},[352,2235,2236,2239,2241,2244,2246,2248,2250,2253],{"class":354,"line":494},[352,2237,2238],{"class":362},"optimizer   ",[352,2240,408],{"class":407},[352,2242,2243],{"class":416}," opt_factory",[352,2245,420],{"class":374},[352,2247,1971],{"class":416},[352,2249,375],{"class":374},[352,2251,2252],{"class":416},"parameters",[352,2254,2255],{"class":374},"())\n",[352,2257,2258,2260,2262,2264,2267,2269,2271,2273,2275,2277],{"class":354,"line":521},[352,2259,472],{"class":471},[352,2261,420],{"class":374},[352,2263,478],{"class":477},[352,2265,2266],{"class":481},"optimizer type:",[352,2268,478],{"class":477},[352,2270,439],{"class":374},[352,2272,510],{"class":423},[352,2274,420],{"class":374},[352,2276,1983],{"class":416},[352,2278,518],{"class":374},[352,2280,2281,2283,2285,2287,2290,2292,2294,2297],{"class":354,"line":1136},[352,2282,472],{"class":471},[352,2284,420],{"class":374},[352,2286,478],{"class":477},[352,2288,2289],{"class":481},"optimizer     :",[352,2291,478],{"class":477},[352,2293,439],{"class":374},[352,2295,2296],{"class":416}," optimizer",[352,2298,460],{"class":374},[549,2300],{"data":2301,"kind":552},"bW9kZWwgdHlwZSAgICA6IDxjbGFzcyAndG9yY2gubm4ubW9kdWxlcy5saW5lYXIuTGluZWFyJz4KbW9kZWwgICAgICAgICA6IExpbmVhcihpbl9mZWF0dXJlcz04LCBvdXRfZmVhdHVyZXM9MSwgYmlhcz1UcnVlKQpvcHRpbWl6ZXIgdHlwZTogPGNsYXNzICd0b3JjaC5vcHRpbS5zZ2QuU0dEJz4Kb3B0aW1pemVyICAgICA6IFNHRCAoClBhcmFtZXRlciBHcm91cCAwCiAgICBkYW1wZW5pbmc6IDAKICAgIGRpZmZlcmVudGlhYmxlOiBGYWxzZQogICAgZm9yZWFjaDogTm9uZQogICAgZnVzZWQ6IE5vbmUKICAgIGxyOiAwLjAxCiAgICBtYXhpbWl6ZTogRmFsc2UKICAgIG1vbWVudHVtOiAwLjkKICAgIG5lc3Rlcm92OiBGYWxzZQogICAgd2VpZ2h0X2RlY2F5OiAwCikK",[325,2303],{},[328,2305,2307,2308,544],{"id":2306},"section-5-the-fragment-selector-name","Section 5: The Fragment Selector (",[224,2309,2310],{},"#name",[216,2312,2313,2314,2317,2318,2321,2322,2325],{},"Loading the entire config module and then accessing ",[224,2315,2316],{},".model"," is fine, but Laco lets you\nbe more precise: the ",[219,2319,2320],{},"fragment selector"," (",[224,2323,2324],{},"#",") picks a single exported name directly.",[343,2327,2329],{"className":345,"code":2328,"language":347,"meta":348,"style":348},"# torch required\n# Load only the model recipe\nmodel_cfg = laco.load(\"configs:\u002F\u002Fexamples\u002Flinear_regression.py#model\")\nprint(\"type :\", type(model_cfg))\nprint(laco.dump(model_cfg))\n",[224,2330,2331,2335,2340,2364,2388],{"__ignoreMap":348},[352,2332,2333],{"class":354,"line":355},[352,2334,1839],{"class":397},[352,2336,2337],{"class":354,"line":366},[352,2338,2339],{"class":397},"# Load only the model recipe\n",[352,2341,2342,2345,2347,2349,2351,2353,2355,2357,2360,2362],{"class":354,"line":387},[352,2343,2344],{"class":362},"model_cfg ",[352,2346,408],{"class":407},[352,2348,371],{"class":362},[352,2350,375],{"class":374},[352,2352,1651],{"class":416},[352,2354,420],{"class":374},[352,2356,478],{"class":477},[352,2358,2359],{"class":481},"configs:\u002F\u002Fexamples\u002Flinear_regression.py#model",[352,2361,478],{"class":477},[352,2363,460],{"class":374},[352,2365,2366,2368,2370,2372,2375,2377,2379,2381,2383,2386],{"class":354,"line":394},[352,2367,472],{"class":471},[352,2369,420],{"class":374},[352,2371,478],{"class":477},[352,2373,2374],{"class":481},"type :",[352,2376,478],{"class":477},[352,2378,439],{"class":374},[352,2380,510],{"class":423},[352,2382,420],{"class":374},[352,2384,2385],{"class":416},"model_cfg",[352,2387,518],{"class":374},[352,2389,2390,2392,2394,2396,2398,2400,2402,2404],{"class":354,"line":401},[352,2391,472],{"class":471},[352,2393,420],{"class":374},[352,2395,236],{"class":416},[352,2397,375],{"class":374},[352,2399,1475],{"class":416},[352,2401,420],{"class":374},[352,2403,2385],{"class":416},[352,2405,518],{"class":374},[549,2407],{"data":2408,"kind":552},"dHlwZSA6IDxjbGFzcyAnb21lZ2Fjb25mLmRpY3Rjb25maWcuRGljdENvbmZpZyc+CntfY29udmVydF86IGFsbCwgX2xhY29fOiAxLCBfdGFyZ2V0XzogdG9yY2gubm4uTGluZWFyLCBiaWFzOiAnJHtocHMuYmlhc30nLCBpbl9mZWF0dXJlczogJyR7aHBzLmluX2ZlYXR1cmVzfScsCiAgb3V0X2ZlYXR1cmVzOiAnJHtocHMub3V0X2ZlYXR1cmVzfSd9Cgo=",[343,2410,2412],{"className":345,"code":2411,"language":347,"meta":348,"style":348},"# torch required\n# Load only the optimizer recipe\noptimizer_cfg = laco.load(\"configs:\u002F\u002Fexamples\u002Flinear_regression.py#optimizer\")\nprint(laco.dump(optimizer_cfg))\n",[224,2413,2414,2418,2423,2447],{"__ignoreMap":348},[352,2415,2416],{"class":354,"line":355},[352,2417,1839],{"class":397},[352,2419,2420],{"class":354,"line":366},[352,2421,2422],{"class":397},"# Load only the optimizer recipe\n",[352,2424,2425,2428,2430,2432,2434,2436,2438,2440,2443,2445],{"class":354,"line":387},[352,2426,2427],{"class":362},"optimizer_cfg ",[352,2429,408],{"class":407},[352,2431,371],{"class":362},[352,2433,375],{"class":374},[352,2435,1651],{"class":416},[352,2437,420],{"class":374},[352,2439,478],{"class":477},[352,2441,2442],{"class":481},"configs:\u002F\u002Fexamples\u002Flinear_regression.py#optimizer",[352,2444,478],{"class":477},[352,2446,460],{"class":374},[352,2448,2449,2451,2453,2455,2457,2459,2461,2464],{"class":354,"line":394},[352,2450,472],{"class":471},[352,2452,420],{"class":374},[352,2454,236],{"class":416},[352,2456,375],{"class":374},[352,2458,1475],{"class":416},[352,2460,420],{"class":374},[352,2462,2463],{"class":416},"optimizer_cfg",[352,2465,518],{"class":374},[549,2467],{"data":2468,"kind":552},"e19jb252ZXJ0XzogYWxsLCBfbGFjb186IDEsIF9wYXJ0aWFsXzogdHJ1ZSwgX3RhcmdldF86IHRvcmNoLm9wdGltLlNHRCwgbHI6ICcke2hwcy5sZWFybmluZ19yYXRlfScsCiAgbW9tZW50dW06ICcke2hwcy5tb21lbnR1bX0nfQoK",[343,2470,2472],{"className":345,"code":2471,"language":347,"meta":348,"style":348},"# torch required\n# Load only the hyperparameter namespace\nhps_cfg = laco.load(\"configs:\u002F\u002Fexamples\u002Flinear_regression.py#hps\")\nprint(\"hps_cfg type:\", type(hps_cfg))\nprint(\"Fields:\")\nfor key in hps_cfg:\n    print(f\"  {key} = {hps_cfg[key]}\")\n",[224,2473,2474,2478,2483,2507,2531,2546,2559],{"__ignoreMap":348},[352,2475,2476],{"class":354,"line":355},[352,2477,1839],{"class":397},[352,2479,2480],{"class":354,"line":366},[352,2481,2482],{"class":397},"# Load only the hyperparameter namespace\n",[352,2484,2485,2488,2490,2492,2494,2496,2498,2500,2503,2505],{"class":354,"line":387},[352,2486,2487],{"class":362},"hps_cfg ",[352,2489,408],{"class":407},[352,2491,371],{"class":362},[352,2493,375],{"class":374},[352,2495,1651],{"class":416},[352,2497,420],{"class":374},[352,2499,478],{"class":477},[352,2501,2502],{"class":481},"configs:\u002F\u002Fexamples\u002Flinear_regression.py#hps",[352,2504,478],{"class":477},[352,2506,460],{"class":374},[352,2508,2509,2511,2513,2515,2518,2520,2522,2524,2526,2529],{"class":354,"line":394},[352,2510,472],{"class":471},[352,2512,420],{"class":374},[352,2514,478],{"class":477},[352,2516,2517],{"class":481},"hps_cfg type:",[352,2519,478],{"class":477},[352,2521,439],{"class":374},[352,2523,510],{"class":423},[352,2525,420],{"class":374},[352,2527,2528],{"class":416},"hps_cfg",[352,2530,518],{"class":374},[352,2532,2533,2535,2537,2539,2542,2544],{"class":354,"line":401},[352,2534,472],{"class":471},[352,2536,420],{"class":374},[352,2538,478],{"class":477},[352,2540,2541],{"class":481},"Fields:",[352,2543,478],{"class":477},[352,2545,460],{"class":374},[352,2547,2548,2550,2552,2554,2557],{"class":354,"line":463},[352,2549,1270],{"class":358},[352,2551,1926],{"class":362},[352,2553,1281],{"class":358},[352,2555,2556],{"class":362}," hps_cfg",[352,2558,1603],{"class":374},[352,2560,2561,2563,2565,2567,2569,2571,2573,2575,2578,2580,2582,2584,2586,2589,2591,2593],{"class":354,"line":468},[352,2562,1318],{"class":471},[352,2564,420],{"class":374},[352,2566,1324],{"class":1323},[352,2568,1327],{"class":481},[352,2570,1330],{"class":435},[352,2572,1333],{"class":416},[352,2574,1339],{"class":435},[352,2576,2577],{"class":481}," = ",[352,2579,1330],{"class":435},[352,2581,2528],{"class":416},[352,2583,1150],{"class":374},[352,2585,1333],{"class":416},[352,2587,2588],{"class":374},"]",[352,2590,1339],{"class":435},[352,2592,478],{"class":481},[352,2594,460],{"class":374},[549,2596],{"data":2597,"kind":552},"aHBzX2NmZyB0eXBlOiA8Y2xhc3MgJ29tZWdhY29uZi5kaWN0Y29uZmlnLkRpY3RDb25maWcnPgpGaWVsZHM6CiAgaW5fZmVhdHVyZXMgPSA4CiAgb3V0X2ZlYXR1cmVzID0gMQogIGJpYXMgPSBUcnVlCiAgbGVhcm5pbmdfcmF0ZSA9IDAuMDEKICBtb21lbnR1bSA9IDAuOQo=",[216,2599,2600],{},[219,2601,2602],{},"When to use the fragment selector:",[246,2604,2605,2615],{},[249,2606,2607],{},[252,2608,2609,2612],{},[255,2610,2611],{},"Use case",[255,2613,2614],{},"URI",[262,2616,2617,2627,2637,2647],{},[252,2618,2619,2622],{},[267,2620,2621],{},"Load and instantiate just one object",[267,2623,2624],{},[224,2625,2626],{},"configs:\u002F\u002F...#model",[252,2628,2629,2632],{},[267,2630,2631],{},"Share a hyperparameter set across scripts",[267,2633,2634],{},[224,2635,2636],{},"configs:\u002F\u002F...#hps",[252,2638,2639,2642],{},[267,2640,2641],{},"Swap out the optimizer independently",[267,2643,2644],{},[224,2645,2646],{},"configs:\u002F\u002F...#optimizer",[252,2648,2649,2652],{},[267,2650,2651],{},"Load everything (whole config module)",[267,2653,2654,2657],{},[224,2655,2656],{},"configs:\u002F\u002F..."," (no fragment)",[216,2659,2660,2661,2663,2664,2666,2667,1307],{},"The fragment syntax works for ",[224,2662,318],{}," config files and for nested keys in ",[224,2665,322],{}," files\n(e.g. ",[224,2668,2669],{},"myconfig.yaml#training.scheduler",[325,2671],{},[328,2673,2675,2676,2679],{"id":2674},"section-6-the-load-instantiate-dump-pipeline","Section 6: The ",[224,2677,2678],{},"load → instantiate → dump"," Pipeline",[216,2681,2682],{},"The three operations form a triangle of transformations. Understanding how they relate\nis the mental model you need for everything else in Laco.",[246,2684,2685,2698],{},[249,2686,2687],{},[252,2688,2689,2692,2695],{},[255,2690,2691],{},"From",[255,2693,2694],{},"To",[255,2696,2697],{},"Via",[262,2699,2700,2717,2736,2750],{},[252,2701,2702,2707,2712],{},[267,2703,2704,2706],{},[224,2705,318],{}," config file (Python source)",[267,2708,2709,2711],{},[224,2710,577],{}," (in-memory recipe)",[267,2713,2714],{},[224,2715,2716],{},"laco.load()",[252,2718,2719,2728,2732],{},[267,2720,2721,2723,2724,2727],{},[224,2722,322],{}," \u002F ",[224,2725,2726],{},".json"," file (serialized recipe)",[267,2729,2730],{},[224,2731,577],{},[267,2733,2734],{},[224,2735,2716],{},[252,2737,2738,2742,2745],{},[267,2739,2740],{},[224,2741,577],{},[267,2743,2744],{},"Live Python object (real model \u002F optimizer)",[267,2746,2747],{},[224,2748,2749],{},"laco.instantiate()",[252,2751,2752,2756,2761],{},[267,2753,2754],{},[224,2755,577],{},[267,2757,2758,2760],{},[224,2759,322],{}," file",[267,2762,2763],{},[224,2764,2765],{},"laco.dump()",[216,2767,2768,2769,2771,2772,375],{},"You can also build the ",[224,2770,577],{}," directly in memory, skipping the file step entirely: ",[224,2773,2774],{},"cfg = L.call(T)(**kw)",[2776,2777,2779],"h3",{"id":2778},"reading-the-pipeline","Reading the pipeline",[580,2781,2782,2799,2809,2816],{},[583,2783,2784,2788,2789,2791,2792,2794,2795,590,2797,375],{},[219,2785,2786],{},[224,2787,577],{}," is the central hub: the in-memory representation of\na recipe, produced by ",[224,2790,334],{},", by ",[224,2793,1795],{},", or by round-tripping through\n",[224,2796,1509],{},[224,2798,1795],{},[583,2800,2801,2805,2806,2808],{},[219,2802,2803,323],{},[224,2804,318],{}," is where you author configs in Python. ",[224,2807,1795],{},"\nexecutes the file in a restricted sandbox and returns its exported names.",[583,2810,2811,2815],{},[219,2812,2813,2760],{},[224,2814,322],{}," is the serialized form. It is what you commit to git for\nreproducibility, or what a training framework writes to its output directory.",[583,2817,2818,2821,2822,2824],{},[219,2819,2820],{},"Live Python object"," is the real model, optimizer, etc. It only exists\nafter ",[224,2823,812],{}," is called; everything before that is metadata.",[216,2826,2827,2828,590,2830,590,2832,2834,2835,2837,2838,2840],{},"The round trip (",[224,2829,577],{},[224,2831,322],{},[224,2833,577],{},") shows that ",[224,2836,1509],{}," and\n",[224,2839,1795],{}," are inverses: the recipe is fully preserved through serialization.",[325,2842],{},[328,2844,2846],{"id":2845},"putting-it-all-together-a-mini-pipeline","Putting it all together: a mini pipeline",[216,2848,2849],{},"Let's run the full pipeline using only stdlib types (no torch needed).",[343,2851,2853],{"className":345,"code":2852,"language":347,"meta":348,"style":348},"import laco\nimport laco.language as L\nimport tempfile, pathlib\n\n# ── Step 1: Author a recipe in Python ──────────────────────────────────────\nrecipe = L.call(dict)(name=\"experiment\", lr=1e-3, batch_size=32)\nprint(\"Step 1 — recipe (DictConfig):\")\nprint(\"  type  :\", type(recipe))\nprint(\"  target:\", recipe._target_)  # noqa: LACO001\n\n# ── Step 2: Serialise to YAML ───────────────────────────────────────────────\nyaml_str = laco.dump(recipe)\nprint(\"\\nStep 2 — YAML:\\n\", yaml_str)\n\n# ── Step 3: (Pretend to) save and reload ────────────────────────────────────\nwith tempfile.NamedTemporaryFile(mode=\"w\", suffix=\".yaml\", delete=False) as f:\n    f.write(yaml_str)\n    tmp = pathlib.Path(f.name)\n\nreloaded = laco.load(str(tmp))\ntmp.unlink()\nprint(\"Step 3 — reloaded type:\", type(reloaded))\n\n# ── Step 4: Instantiate ─────────────────────────────────────────────────────\nlive_obj = laco.instantiate(reloaded)\nprint(\"\\nStep 4 — live object:\")\nprint(\"  type  :\", type(live_obj))\nprint(\"  value :\", live_obj)\n",[224,2854,2855,2861,2875,2885,2889,2894,2946,2961,2984,3010,3014,3019,3037,3063,3067,3073,3124,3139,3164,3169,3194,3205,3229,3234,3240,3260,3278,3302],{"__ignoreMap":348},[352,2856,2857,2859],{"class":354,"line":355},[352,2858,359],{"class":358},[352,2860,363],{"class":362},[352,2862,2863,2865,2867,2869,2871,2873],{"class":354,"line":366},[352,2864,359],{"class":358},[352,2866,371],{"class":362},[352,2868,375],{"class":374},[352,2870,198],{"class":378},[352,2872,381],{"class":358},[352,2874,384],{"class":362},[352,2876,2877,2879,2881,2883],{"class":354,"line":387},[352,2878,359],{"class":358},[352,2880,1531],{"class":362},[352,2882,439],{"class":374},[352,2884,1536],{"class":362},[352,2886,2887],{"class":354,"line":394},[352,2888,391],{"emptyLinePlaceholder":390},[352,2890,2891],{"class":354,"line":401},[352,2892,2893],{"class":397},"# ── Step 1: Author a recipe in Python ──────────────────────────────────────\n",[352,2895,2896,2899,2901,2903,2905,2907,2909,2911,2913,2915,2917,2919,2922,2924,2926,2929,2931,2934,2936,2939,2941,2944],{"class":354,"line":463},[352,2897,2898],{"class":362},"recipe ",[352,2900,408],{"class":407},[352,2902,411],{"class":362},[352,2904,375],{"class":374},[352,2906,417],{"class":416},[352,2908,420],{"class":374},[352,2910,340],{"class":423},[352,2912,426],{"class":374},[352,2914,685],{"class":429},[352,2916,408],{"class":407},[352,2918,478],{"class":477},[352,2920,2921],{"class":481},"experiment",[352,2923,478],{"class":477},[352,2925,439],{"class":374},[352,2927,2928],{"class":429}," lr",[352,2930,408],{"class":407},[352,2932,2933],{"class":435},"1e-3",[352,2935,439],{"class":374},[352,2937,2938],{"class":429}," batch_size",[352,2940,408],{"class":407},[352,2942,2943],{"class":435},"32",[352,2945,460],{"class":374},[352,2947,2948,2950,2952,2954,2957,2959],{"class":354,"line":468},[352,2949,472],{"class":471},[352,2951,420],{"class":374},[352,2953,478],{"class":477},[352,2955,2956],{"class":481},"Step 1 — recipe (DictConfig):",[352,2958,478],{"class":477},[352,2960,460],{"class":374},[352,2962,2963,2965,2967,2969,2972,2974,2976,2978,2980,2982],{"class":354,"line":494},[352,2964,472],{"class":471},[352,2966,420],{"class":374},[352,2968,478],{"class":477},[352,2970,2971],{"class":481},"  type  :",[352,2973,478],{"class":477},[352,2975,439],{"class":374},[352,2977,510],{"class":423},[352,2979,420],{"class":374},[352,2981,278],{"class":416},[352,2983,518],{"class":374},[352,2985,2986,2988,2990,2992,2995,2997,2999,3002,3004,3006,3008],{"class":354,"line":521},[352,2987,472],{"class":471},[352,2989,420],{"class":374},[352,2991,478],{"class":477},[352,2993,2994],{"class":481},"  target:",[352,2996,478],{"class":477},[352,2998,439],{"class":374},[352,3000,3001],{"class":416}," recipe",[352,3003,375],{"class":374},[352,3005,541],{"class":378},[352,3007,544],{"class":374},[352,3009,547],{"class":397},[352,3011,3012],{"class":354,"line":1136},[352,3013,391],{"emptyLinePlaceholder":390},[352,3015,3016],{"class":354,"line":1711},[352,3017,3018],{"class":397},"# ── Step 2: Serialise to YAML ───────────────────────────────────────────────\n",[352,3020,3021,3023,3025,3027,3029,3031,3033,3035],{"class":354,"line":1751},[352,3022,1466],{"class":362},[352,3024,408],{"class":407},[352,3026,371],{"class":362},[352,3028,375],{"class":374},[352,3030,1475],{"class":416},[352,3032,420],{"class":374},[352,3034,278],{"class":416},[352,3036,460],{"class":374},[352,3038,3039,3041,3043,3045,3049,3052,3054,3056,3058,3061],{"class":354,"line":1756},[352,3040,472],{"class":471},[352,3042,420],{"class":374},[352,3044,478],{"class":477},[352,3046,3048],{"class":3047},"s_hVV","\\n",[352,3050,3051],{"class":481},"Step 2 — YAML:",[352,3053,3048],{"class":3047},[352,3055,478],{"class":477},[352,3057,439],{"class":374},[352,3059,3060],{"class":416}," yaml_str",[352,3062,460],{"class":374},[352,3064,3065],{"class":354,"line":1762},[352,3066,391],{"emptyLinePlaceholder":390},[352,3068,3070],{"class":354,"line":3069},15,[352,3071,3072],{"class":397},"# ── Step 3: (Pretend to) save and reload ────────────────────────────────────\n",[352,3074,3076,3078,3080,3082,3084,3086,3088,3090,3092,3094,3096,3098,3100,3102,3104,3106,3108,3110,3112,3114,3116,3118,3120,3122],{"class":354,"line":3075},16,[352,3077,1550],{"class":358},[352,3079,1531],{"class":362},[352,3081,375],{"class":374},[352,3083,1557],{"class":416},[352,3085,420],{"class":374},[352,3087,1562],{"class":429},[352,3089,408],{"class":407},[352,3091,478],{"class":477},[352,3093,1569],{"class":481},[352,3095,478],{"class":477},[352,3097,439],{"class":374},[352,3099,1576],{"class":429},[352,3101,408],{"class":407},[352,3103,478],{"class":477},[352,3105,322],{"class":481},[352,3107,478],{"class":477},[352,3109,439],{"class":374},[352,3111,1589],{"class":429},[352,3113,408],{"class":407},[352,3115,1304],{"class":1303},[352,3117,544],{"class":374},[352,3119,381],{"class":358},[352,3121,1600],{"class":362},[352,3123,1603],{"class":374},[352,3125,3127,3129,3131,3133,3135,3137],{"class":354,"line":3126},17,[352,3128,1608],{"class":362},[352,3130,375],{"class":374},[352,3132,1613],{"class":416},[352,3134,420],{"class":374},[352,3136,1490],{"class":416},[352,3138,460],{"class":374},[352,3140,3142,3145,3147,3150,3152,3154,3156,3158,3160,3162],{"class":354,"line":3141},18,[352,3143,3144],{"class":362},"    tmp ",[352,3146,408],{"class":407},[352,3148,3149],{"class":362}," pathlib",[352,3151,375],{"class":374},[352,3153,1770],{"class":416},[352,3155,420],{"class":374},[352,3157,1324],{"class":416},[352,3159,375],{"class":374},[352,3161,685],{"class":378},[352,3163,460],{"class":374},[352,3165,3167],{"class":354,"line":3166},19,[352,3168,391],{"emptyLinePlaceholder":390},[352,3170,3172,3174,3176,3178,3180,3182,3184,3187,3189,3192],{"class":354,"line":3171},20,[352,3173,1642],{"class":362},[352,3175,408],{"class":407},[352,3177,371],{"class":362},[352,3179,375],{"class":374},[352,3181,1651],{"class":416},[352,3183,420],{"class":374},[352,3185,3186],{"class":423},"str",[352,3188,420],{"class":374},[352,3190,3191],{"class":416},"tmp",[352,3193,518],{"class":374},[352,3195,3197,3199,3201,3203],{"class":354,"line":3196},21,[352,3198,3191],{"class":362},[352,3200,375],{"class":374},[352,3202,1779],{"class":416},[352,3204,1782],{"class":374},[352,3206,3208,3210,3212,3214,3217,3219,3221,3223,3225,3227],{"class":354,"line":3207},22,[352,3209,472],{"class":471},[352,3211,420],{"class":374},[352,3213,478],{"class":477},[352,3215,3216],{"class":481},"Step 3 — reloaded type:",[352,3218,478],{"class":477},[352,3220,439],{"class":374},[352,3222,510],{"class":423},[352,3224,420],{"class":374},[352,3226,1680],{"class":416},[352,3228,518],{"class":374},[352,3230,3232],{"class":354,"line":3231},23,[352,3233,391],{"emptyLinePlaceholder":390},[352,3235,3237],{"class":354,"line":3236},24,[352,3238,3239],{"class":397},"# ── Step 4: Instantiate ─────────────────────────────────────────────────────\n",[352,3241,3243,3246,3248,3250,3252,3254,3256,3258],{"class":354,"line":3242},25,[352,3244,3245],{"class":362},"live_obj ",[352,3247,408],{"class":407},[352,3249,371],{"class":362},[352,3251,375],{"class":374},[352,3253,883],{"class":416},[352,3255,420],{"class":374},[352,3257,1680],{"class":416},[352,3259,460],{"class":374},[352,3261,3263,3265,3267,3269,3271,3274,3276],{"class":354,"line":3262},26,[352,3264,472],{"class":471},[352,3266,420],{"class":374},[352,3268,478],{"class":477},[352,3270,3048],{"class":3047},[352,3272,3273],{"class":481},"Step 4 — live object:",[352,3275,478],{"class":477},[352,3277,460],{"class":374},[352,3279,3281,3283,3285,3287,3289,3291,3293,3295,3297,3300],{"class":354,"line":3280},27,[352,3282,472],{"class":471},[352,3284,420],{"class":374},[352,3286,478],{"class":477},[352,3288,2971],{"class":481},[352,3290,478],{"class":477},[352,3292,439],{"class":374},[352,3294,510],{"class":423},[352,3296,420],{"class":374},[352,3298,3299],{"class":416},"live_obj",[352,3301,518],{"class":374},[352,3303,3305,3307,3309,3311,3314,3316,3318,3321],{"class":354,"line":3304},28,[352,3306,472],{"class":471},[352,3308,420],{"class":374},[352,3310,478],{"class":477},[352,3312,3313],{"class":481},"  value :",[352,3315,478],{"class":477},[352,3317,439],{"class":374},[352,3319,3320],{"class":416}," live_obj",[352,3322,460],{"class":374},[549,3324],{"data":3325,"kind":552},"U3RlcCAxIOKAlCByZWNpcGUgKERpY3RDb25maWcpOgogIHR5cGUgIDogPGNsYXNzICdvbWVnYWNvbmYuZGljdGNvbmZpZy5EaWN0Q29uZmlnJz4KICB0YXJnZXQ6IGJ1aWx0aW5zLmRpY3QKClN0ZXAgMiDigJQgWUFNTDoKIHtfY29udmVydF86IGFsbCwgX2xhY29fOiAxLCBfdGFyZ2V0XzogYnVpbHRpbnMuZGljdCwgYmF0Y2hfc2l6ZTogMzIsIGxyOiAwLjAwMX0KClN0ZXAgMyDigJQgcmVsb2FkZWQgdHlwZTogPGNsYXNzICdvbWVnYWNvbmYuZGljdGNvbmZpZy5EaWN0Q29uZmlnJz4KClN0ZXAgNCDigJQgbGl2ZSBvYmplY3Q6CiAgdHlwZSAgOiA8Y2xhc3MgJ2RpY3QnPgogIHZhbHVlIDogeydiYXRjaF9zaXplJzogMzIsICdscic6IDAuMDAxfQo=",[549,3327],{"data":3328,"kind":552},"PGNlbGwtMjc+OjY6IExhenlDYWxsSW50cm9zcGVjdGlvbldhcm5pbmc6IEwuY2FsbChkaWN0LCBzdHJpY3Q9VHJ1ZSk6IGNhbm5vdCBpbnRyb3NwZWN0IHRhcmdldCBzaWduYXR1cmU7IHN0cmljdC1tb2RlIGt3YXJnIHZhbGlkYXRpb24gaXMgZGlzYWJsZWQgZm9yIHRoaXMgY2FsbC4gUGFzcyBgc3RyaWN0PUZhbHNlYCBleHBsaWNpdGx5IHRvIHNpbGVuY2UgdGhpcyB3YXJuaW5nLgogIHJlY2lwZSA9IEwuY2FsbChkaWN0KShuYW1lPSJleHBlcmltZW50IiwgbHI9MWUtMywgYmF0Y2hfc2l6ZT0zMikK",[325,3330],{},[328,3332,3334],{"id":3333},"summary","Summary",[216,3336,3337],{},"In this notebook you learned the four core building blocks of Laco:",[2776,3339,3341,590,3344],{"id":3340},"lcalltkwargs-dictconfig",[224,3342,3343],{},"L.call(T)(**kwargs)",[224,3345,577],{},[216,3347,3348,3349,3351,3352,3355,3356,3358],{},"Builds a ",[276,3350,278],{}," for ",[224,3353,3354],{},"T(**kwargs)",". The recipe stores the target class path and all\nkeyword arguments. No object is constructed until ",[224,3357,812],{}," is called.",[2776,3360,3362,3364],{"id":3361},"lacoinstantiatecfg-live-object",[224,3363,289],{}," → live object",[216,3366,3367,3368,3370],{},"Executes a recipe: reads ",[224,3369,956],{},", imports the class, and calls it with the\nstored kwargs. Recurses into nested recipes by default.",[2776,3372,3374,3376],{"id":3373},"lacodumpcfg-yaml-string",[224,3375,302],{}," → YAML string",[216,3378,3379,3380,3382],{},"Serializes a recipe to YAML. The output includes a ",[224,3381,1501],{}," schema-version marker\nand is fully round-trip safe.",[2776,3384,3386,590,3388],{"id":3385},"lacoloaduri-dictconfig",[224,3387,312],{},[224,3389,577],{},[216,3391,3392,3393,3395,3396,3398,3399,3401,3402,3404,3405,3408],{},"Loads a recipe from a ",[224,3394,318],{}," config file (via the ",[224,3397,1818],{}," URI scheme), a plain\n",[224,3400,322],{}," file, or a ",[224,3403,2726],{}," file. Use the ",[224,3406,3407],{},"#fragment"," suffix to select a single\nexported name.",[325,3410],{},[216,3412,3413,222,3416,3419,3420,3422,3423,3425],{},[219,3414,3415],{},"Next:",[224,3417,3418],{},"03.lazy-call-and-partial.ipynb"," covers exactly when ",[224,3421,334],{}," and ",[224,3424,1428],{},"\nconstruct objects, and why that timing matters when one config depends on another\n(the classic case: an optimizer that needs a model's parameters).",[3427,3428,3429],"style",{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s99_P, html code.shiki .s99_P{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":348,"searchDepth":387,"depth":387,"links":3431},[3432,3434,3436,3437,3438,3440,3444,3445],{"id":330,"depth":366,"text":3433},"Section 1: Your First L.call",{"id":808,"depth":366,"text":3435},"Section 2: Materialising with laco.instantiate",{"id":1174,"depth":366,"text":1175},{"id":1803,"depth":366,"text":1804},{"id":2306,"depth":366,"text":3439},"Section 5: The Fragment Selector (#name)",{"id":2674,"depth":366,"text":3441,"children":3442},"Section 6: The load → instantiate → dump Pipeline",[3443],{"id":2778,"depth":387,"text":2779},{"id":2845,"depth":366,"text":2846},{"id":3333,"depth":366,"text":3334,"children":3446},[3447,3449,3451,3453],{"id":3340,"depth":387,"text":3448},"L.call(T)(**kwargs) → DictConfig",{"id":3361,"depth":387,"text":3450},"laco.instantiate(cfg) → live object",{"id":3373,"depth":387,"text":3452},"laco.dump(cfg) → YAML string",{"id":3385,"depth":387,"text":3454},"laco.load(uri) → DictConfig","Prerequisites: 01.why-laco.ipynb (the lie-typing contract).","md",{"notebook":390},{"icon":25},{"title":27,"description":3455},"QYy4LvrSKqQP2n-bfyBGRTIZUPlLX2qMJVpD41We4Jc",{},1785687301643]