딥러닝을 좀 더 쉽게 할 수 있도록 돕는 기능 조각들을 미리 만들어두었을 뿐이죠! (물론 그 외
에도 여러 가지 추가 기능을 제공합니다. 관련 내용은 차차 알아볼 것입니다.)
다음은 이런 클래스를 활용해서 현재의 선형 모델을 신경망 모델로 바꿔볼 차례입니다.
4.7
지금까지 함수의 파라미터를 최적화하는 일반적인 과정과 (약간은 지루한) 단순 선형 분류 모
델을 구현한 함수를 시도해 봤습니다. 선형 분류 모델이 할 수 있는 일에는 한계가 있습니다.
좀 더 복잡한 일을 다루려면 분류 모델을 좀 더 복잡하게 바꿔줘야 합니다. 두 선형 분류 모델
(계층) 사이에
nonlinear
(
ax
+
b
와는 다름)을 추가하면 됩니다. 그리고 이 형태가 바로 신
경망이기도 하죠.
다음은 간단한 신경망을 정의한 코드입니다.
defsimple_net(xb):
res=xb@w1+b1
res=res.max(tensor(0.0))
res ...
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.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.