Errata

Programming PyTorch for Deep Learning

Errata for Programming PyTorch for Deep Learning

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
ePub

You can't assign to a variable named transforms. This overwrite the transforms object!

transforms = transforms.Compose([

Charlie Harper  Dec 31, 2019 
ePub

for epoch in range(epochs):
for batch in train_loader:
optimizer.zero_grad()
input, target = batch
output = model(input)
loss = loss_fn(output, target)
loss.backward()
optimizer.step()

train_loader is defined as train_data_loader in the preceding code.

Charlie Harper  Dec 31, 2019 
ePub

Chapter 2 is missing import statements that are needed to run the code.

Anonymous  Dec 31, 2019 
ePub

for epoch in range(epochs):
for batch in train_loader:
optimizer.zero_grad()
input, target = batch
output = model(input)
loss = loss_fn(output, target)
loss.backward()
optimizer.step()


input is an existing function in python! Replace this variable name with something more appropriate.

Anonymous  Dec 31, 2019 
ePub

for epoch in range(epochs):
for batch in train_loader:
optimizer.zero_grad()
input, target = batch
output = model(input)
loss = loss_fn(output, target)
loss.backward()
optimizer.step()

"model" is defined as "simplenet" in the preceding code. This entire block of code is terrible.

Charlie Harper  Dec 31, 2019 
Printed Page page 22
Code example 3rd line

Call to super class constructor contains Net as parameter but the sub class name is SimpleNet

Edward Roe  Mar 02, 2023 
Printed Page 11
1st and 3rd blocks of code, top of page

The printed code in the first block includes the following statement:

tensor.ones(1,2) + tensor.ones(1,2)

The correct statement should be:

torch.ones(1,2) + torch.ones(1,2)

Likewise, the printed code in the third block includes:

cpu_tensor = tensor.rand(2)

The code should read:

cpu_tensor = torch.rand(2)

Blair Watkinson  Jan 09, 2021 
Printed Page 13
2nd paragraph in Tensor Broadcasting section

The second paragraph begins, "In our use of broadcasting, it works because..."

There is no "use of broadcasting" example provided. Immediately preceding this paragraph is simply a paragraph that explains under which conditions broadcasting is allowed. The reader (and the text, it would appear) would expect an example after the broadcast rules are stated to serve as the example referenced by "In our use of broadcasting..."

Blair Watkinson  Jan 09, 2021 
Printed Page 18
Top

Many images cannot be downloaded. The GitHub issues mention a zip file with all the images, but the zip file also seems to be missing many ranges as well. I posted another issue on GitHub a few days ago with no response. Could this be somehow clarified?

Anonymous  Sep 22, 2020 
Printed Page 22
Line 9 of Code example

Argument variable "x" is missing in the definition of the "forward" method.

Also, it's said that the class inherits from "torch.nn.network" but the class (on line 1 of code example) shows inheritance of "nn.Module".

Anonymous  Jun 15, 2020 
ePub Page 31
First code example under the title of "Creating a Network"

In the code example, author defines a class called SimpleNet that inherits from nn.Module. Then, in the constructor author calls the constructor of the parent class using "super(Net, self).__init__()" which would have worked if the name of the class would be "Net" rather than "SimpleNet". As it is, the code fails to work. This can be considered a minor or major technical mistake, depending on the experience level of the reader.

Uğur Ali Kaplan  Dec 07, 2019 
ePub Page 39
Snippet which provides example of standard mathematical operations with tensord

tensor.ones(1,2) + tensor.ones(1,2)

should be replaced with

torch.ones(1,2) + torch.ones(1,2)

Yury  Jul 23, 2020 
ePub Page 40
code snippet

cpu_tensor = tensor.rand(2)

should be replaced with

cpu_tensor = torch.rand(2)

Yury  Jul 23, 2020