Skip to Content
파이토치로 배우는 LLM & AI
book

파이토치로 배우는 LLM & AI

by 로런스 모로니, 박해선
March 2026
Intermediate
504 pages
11h 26m
Korean
Hanbit Media, Inc.
Content preview from 파이토치로 배우는 LLM & AI
279
10
장
시퀀스를 예측하는 머신러닝 모델 만들기
10.2
DNN
을 만들고 시퀀스 데이터로 훈련하기
데이터를 준비했으니 신경망 모델을 만드는 것은 매우 간단합니다. 먼저 다음과 같은 간단한
DNN
을 살펴봅시다.
# 모델을 정의합니다.
class TimeSeriesModel(nn.Module):
def __init__(self, window_size):
super(TimeSeriesModel, self).__init__()
# 특성이 window_size-1이므로 window_size-1로 설정합니다.
self.network = nn.Sequential(
nn.Linear(window_size-1, 10),
nn.ReLU(),
nn.Linear(10, 10),
nn.ReLU(),
nn.Linear(10, 1)
)
def forward(self, x):
return self.network(x)
이는 세 개의 밀집 층으로 구성된 아주 간단한 모델입니다. 첫 번째 층은
window
_
size
크기의
입력을 받고,
10
개의 뉴런을 가진 은닉 층입니다. 출력 층은 예측값을 만듭니다.
이전처럼 모델을 초기화하고, 손실 함수와 옵티마이저를 준비합니다.
# 모델, 손실 함수, 옵티마이저를 초기화합니다.
model = TimeSeriesModel ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’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
QuotationMarkI 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
QuotationMarkI’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
QuotationMarkI'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.
Mark W.
Embedded Software Engineer

You might also like

AI 에이전트 엔지니어링

AI 에이전트 엔지니어링

마이클 알바다
핸즈온 LLM

핸즈온 LLM

제이 알아마르, 마르턴 흐루턴도르스트
만들면서 배우는 생성 AI

만들면서 배우는 생성 AI

데이비드 포스터

Publisher Resources

ISBN: 9791175790223