Skip to content

Commit 7e7c9bb

Browse files
committed
update to torch 0.4
1 parent 538ba18 commit 7e7c9bb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tutorial-contents/301_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ def forward(self, x):
3737
net = Net(n_feature=1, n_hidden=10, n_output=1) # define the network
3838
print(net) # net architecture
3939

40-
optimizer = torch.optim.SGD(net.parameters(), lr=0.5)
40+
optimizer = torch.optim.SGD(net.parameters(), lr=0.2)
4141
loss_func = torch.nn.MSELoss() # this is for regression mean squared loss
4242

4343
plt.ion() # something about plotting
4444

45-
for t in range(100):
45+
for t in range(200):
4646
prediction = net(x) # input x and predict based on x
4747

4848
loss = loss_func(prediction, y) # must be (1. nn output, 2. target)

0 commit comments

Comments
 (0)