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
130
1
부
모델 구축
이 코드는
10
개의 클래스에 걸쳐 원하는 크기의 (단순한 잡음으로 구성된 ) 이미지
100
개를
만듭니다. 그다음 다른 데이터셋과 동일한 방식으로
DataLoader
에 사용할 수 있습니다.
FakeData
는 이미지 데이터만 지원하지만, 앞서 살펴본 것처럼 수치형이나 시퀀스 데이터와
같은 다른 포맷의 가짜 데이터를 만들기 위해 (앞서 본
CustomDataset
처럼 ) 비교적 손쉽게
자신만의 데이터를 정의할 수 있습니다.
4.4
사용자 정의 분할 사용하기
지금까지 모델 구축에 사용한 모든 데이터는 미리 훈련 세트와 테스트 세트로 분할되어 있었습
니다. 예를 들어 패션
MNIST
의 경우 각각
60
,
000
개와
10
,
000
개의 샘플이 있었습니다. 하지
만 이 분할을 사용하고 싶지 않다면 어떻게 할까요? 필요에 따라 직접 데이터를 분할하고 싶다
면 어떻게 해야 할까요?
다행히도
datasets
라이브러리를 사용하면 쉽고 직관적인
API
로 이 작업을 수행할 수 있습니다.
예를 들어 이전에
FashionMNIST
클래스를 로드할 때
train
매개변수를 지정해 훈련 데이터
(
60
,
000
개 레코드) 또는 테스트 데이터 (
10
,
000
개 레코드)를 받았습니다.
이를 단순히 무시한 채로 재정의하면 모든 데이터를 얻게 됩니다.
# 전체 패션 MNIST 데이터셋 로드 ...
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

PyTorch의 코더를 위한 AI 및 ML

PyTorch의 코더를 위한 AI 및 ML

Laurence Moroney
헤드 퍼스트 자바(3판)

헤드 퍼스트 자바(3판)

케이시 시에라, 버트 베이츠

Publisher Resources

ISBN: 9791175790223