22.02.2024 Views

Daniel Voigt Godoy - Deep Learning with PyTorch Step-by-Step A Beginner’s Guide-leanpub

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

If the losses haven’t changed, it means the training loss was at a minimum already.

So, we expect the weights to remain unchanged. Let’s check it out:

print(sbs.model.state_dict())

Output

OrderedDict([('0.weight', tensor([[1.9414]], device='cuda:0')),

('0.bias', tensor([1.0233], device='cuda:0'))])

No changes, indeed.

Putting It All Together

In this chapter, we have heavily modified the training pipeline. Even though the

data preparation part was left unchanged, the model configuration part was

reduced to its bare minimum, and the model training part was fully integrated into

the StepByStep class. In other words, our pipeline went classy!

202 | Chapter 2.1: Going Classy

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!