ashleve / lightning-hydra-template

PyTorch Lightning + Hydra. A very user-friendly template for ML experimentation. ⚑πŸ”₯⚑
4.13k stars 643 forks source link

Resolve Hydra ListConfig objects #612

Open RafayAK opened 11 months ago

RafayAK commented 11 months ago

What does this PR do?

Resolves Hydra ListConfig objects so that dynamic inteploation works when printing config tree. Also updated the example.yaml experiment to showcase the use.

Fixes https://github.com/ashleve/lightning-hydra-template/issues/611

Before submitting

Did you have fun?

:rocket:

codecov-commenter commented 11 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (bddbc24) 83.24% compared to head (e0db27f) 83.24%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #612 +/- ## ======================================= Coverage 83.24% 83.24% ======================================= Files 11 11 Lines 376 376 ======================================= Hits 313 313 Misses 63 63 ``` | [Files](https://app.codecov.io/gh/ashleve/lightning-hydra-template/pull/612?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Ξ” | | |---|---|---| | [src/utils/rich\_utils.py](https://app.codecov.io/gh/ashleve/lightning-hydra-template/pull/612?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3V0aWxzL3JpY2hfdXRpbHMucHk=) | `82.60% <100.00%> (ΓΈ)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

RafayAK commented 11 months ago

After the change suggested in this PR the printed config tree is correct and has the dynamic interploation for list items as well:

CONFIG
β”œβ”€β”€ data
β”‚   └── _target_: src.data.mnist_datamodule.MNISTDataModule                                                                                                                                        
β”‚       ...                                                                                                                                                                   
β”‚                                                                                                                                                                                                  
β”œβ”€β”€ model
β”‚   └── _target_: src.models.mnist_module.MNISTLitModule                                                                                                                                           
β”‚       ...                                                                                                                                                                       
β”‚                                                                                                                                                                                                  
β”œβ”€β”€ callbacks
β”‚   └── ...                                                                                                                              
β”‚                                                                                                                                                                                                  
β”œβ”€β”€ logger
β”‚   └── wandb:                                                                                                                                                                                     
β”‚         tags:                                                                                                                                                                                    
β”‚         - mnist                                                                                                                                                                                  
β”‚         - simple_dense_net                                                                                                                                                                       
β”‚         - train                                                                                                                                                                                  
β”‚         - batch_size_64                                                                                                                                                                          
β”‚         group: mnist                                                                                                                                                                             
β”‚       aim:                                                                                                                                                                                       
β”‚         experiment: mnist                                                                                                                                                                        
β”‚                                                                                                                                                                                                  
...
...                                                                                                                                                                        
β”œβ”€β”€ tags
β”‚   └── - mnist                                                                                                                                                                                    
β”‚       - simple_dense_net                                                                                                                                                                         
β”‚       - train                 # RESOLVED                                                                                                                                                           
β”‚       - batch_size_64         # RESOLVED                                                                                                                                                                   
β”‚                                                                                                                                                                                                  
...