Hi Iram!



 ArshadIram:

Can you explain me about param_groups[0][‘params’][0] ?


Looking at an object’s __dict__ property is often a good way to
probe all of its properties.  So start with:
>>> import torch
>>> torch.__version__
'1.9.0'
>>> opt = torch.optim.Adam ([torch.randn (3, requires_grad = True)])
>>> opt.__dict__
{'defaults': {'lr': 0.001, 'betas': (0.9, 0.999), 'eps': 1e-08, 'weight_decay': 0, 'amsgrad': False}, '_zero_grad_profile_name': 'Optimizer.zero_grad#Adam.zero_grad', 'state': defaultdict(<class 'dict'>, {}), 'param_groups': [{'params': [tensor([0.2824, 0.7790, 0.3820], requires_grad=True)], 'lr': 0.001, 'betas': (0.9, 0.999), 'eps': 1e-08, 'weight_decay': 0, 'amsgrad': False}]}

and drill down deeper from there.
Best.
K. Frank