The
torch.nn.Module.named_parameters() method returns an iterator that yields tuples containing both the name and the parameter tensor for each parameter in the module.- Iterator-based: Returns an iterator rather than a list, making it memory-efficient for large models
- Hierarchical naming: Parameter names reflect the module hierarchy using dot notation (e.g.,
layer1.weight)
- Recursive by default: Includes parameters from all submodules unless specified otherwise

Seonglae Cho