-
Book Overview & Buying
-
Table Of Contents
Mastering PyTorch - Second Edition
By :
To fully benefit from this book, it is necessary that you meet the following prerequisites and recommendations:
The code bundle for the book is hosted on GitHub at https://github.com/arj7192/MasteringPyTorchV2. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781801074308.
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: “Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system.”
A block of code is set as follows:
def forward(self, source):
source = self.enc(source) * torch.sqrt(self.num_inputs)
source = self.position_enc(source)
op = self.enc_transformer(source, self.mask_source)
op = self.dec(op)
return op
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
def forward(self, source):
source = self.enc(source) * torch.sqrt(self.num_inputs)
source = self.position_enc(source)
op = self.enc_transformer(source, self.mask_source)
op = self.dec(op)
return op
Any command-line input or output is written as follows:
loss improvement on epoch: 1
[001/200] train: 1.1996 - val: 1.0651
loss improvement on epoch: 2
[002/200] train: 1.0806 - val: 1.0494
...
Bold: Indicates a new term, an important word, or words that you see on the screen. For instance, words in menus or dialog boxes appear in the text like this. For example: “Select System info from the Administration panel.”
Warnings or important notes appear like this.
Tips and tricks appear like this.