Sure! specific model and all its parameters, including the optimizer, will al be together in the same file. So, you just need to load the corresponding file. So, if we determine variable epoch=10, then the filename as determined above will be
epoch = 10
PATH = 'train_valid_exp4-epoch{}.pth'.format(epoch)
checkpoint = torch.load(PATH)
model.load_state_dict(checkpoint['model_state_dict'])
optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
epoch = checkpoint['epoch']
loss = checkpoint['loss']