마지막 세 번째 단계에서는 손실을 계산합니다. 어떤 손실 함수를 사용해도 되지만, 여기서는
예측의 정확성을 합리적으로 나타내는 평균제곱오차를 선택했습니다.
세 단계에 걸쳐 준비를 마쳤습니다. 이제 확률적 경사 하강법으로 파라미터(잠재 요소)를 최
적화할 수 있습니다. 확률적 경사 하강법을 수행하는 옵티마이저는 각 영화와 사용자 간의 매
칭을 점곱으로 계산하고, 계산한 수치를 각 사용자가 각 영화에 부여한 실제 점수와 비교해 손
실을 계산합니다. 그러면 해당 손실에 대한 미분을 계산할 수 있으며, 학습률을 곱해 가중치를
한 단계 조정해나갈 수 있습니다. 이 작업을 여러 번 수행하면 손실이 점점 더 좋아지고, 추천
(점수)도 점점 더 정확해지겠죠.
fastai
에서 모델 학습의 공통 메서드인
Learner
.
fit
를 사용하려면, 데이터를
DataLoaders
로 가져와야만 합니다. 다음 절은 그 방법을 알아보는 데 집중합니다.
8.3
DataLoaders
데이터를 출력할 때는 영화의
ID
보다 제목을 표시하는 편이 낫습니다. 사람의 관점에서 가독
성이 좋기 때문이죠.
u
.
item
테이블에는 각 영화
ID
에 대응하는 ...
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.