Fixing error learning rate for this sample
This commit is contained in:
@ -125,7 +125,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"optimizer = torch.optim.SGD(net.parameters(), lr=0.5)\n",
|
"optimizer = torch.optim.SGD(net.parameters(), lr=0.4)\n",
|
||||||
"loss_func = torch.nn.MSELoss() # this is for regression mean squared loss"
|
"loss_func = torch.nn.MSELoss() # this is for regression mean squared loss"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -261,7 +261,7 @@
|
|||||||
" plt.cla()\n",
|
" plt.cla()\n",
|
||||||
" plt.scatter(x.data.numpy(), y.data.numpy())\n",
|
" plt.scatter(x.data.numpy(), y.data.numpy())\n",
|
||||||
" plt.plot(x.data.numpy(), prediction.data.numpy(), 'r-', lw=5)\n",
|
" plt.plot(x.data.numpy(), prediction.data.numpy(), 'r-', lw=5)\n",
|
||||||
" plt.text(0.5, 0, 'Loss=%.4f' % loss.data[0], fontdict={'size': 20, 'color': 'red'})\n",
|
" plt.text(0.5, 0, 'Loss=%.4f' % loss.item(), fontdict={'size': 20, 'color': 'red'})\n",
|
||||||
" plt.show()\n",
|
" plt.show()\n",
|
||||||
" plt.pause(0.2)\n",
|
" plt.pause(0.2)\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user