제로 구현한 클래스입니다. 옵티마이저를 이용하면 앞 절과 똑같은 코드를 다음과 같이 구현할
수 있습니다.
#
토이
데이터셋
x
=
torch
.
rand(100, 1)
y
=
5
+
2
*
x
+
torch
.
rand(100, 1)
lr
=
0
.
1
iters
=
100
model
=
Model()
optimizer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.