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
135
4
장
파이토치 데이터셋
n
번째 배치를 준비하는 시간이 항상 같지는 않습니다. 훈련 시간이 더 빠르면
GPU
/
TPU
에 유
휴 시간이 생깁니다. 훈련 시간이 더 느리면
CPU
에 유휴 시간이 생깁니다. 적절한 배치 크기
를 정하면 이 간격을 최적화하는 데 도움이 됩니다.
GPU
/
TPU
비용이 더 비싸므로 가능하면
GPU
/
TPU
의 유휴 시간을 줄이는 것이 좋습니다.
이것이
MNIST
와 같은 간단한 예제에서도 배치를 사용하는 이유 중 하나입니다. 파이프라이닝
모델이 적용되어 있으므로 데이터셋의 크기와 관계없이
ETL
을 일관된 패턴으로 처리할 수 있
습니다.
4.7
DataLoader
클래스 사용하기
DataLoader
클래스는 이미 여러 번 보았지만, 머신러닝 워크플로에서 최대한 활용할 수 있도
록 조금 더 깊이 살펴보겠습니다. 이 클래스는 다음과 같은 기능을 제공합니다.
4.7.1
배치
직관적으로 정방향 계산이 한 번에 하나의 데이터를 처리한다고 생각할 수 있습니다. 그렇게
할 수도 있지만, 확률적 경사 하강법과 같은 일부 옵티마이저는 입력이 배치로 전달될 때 더 정
확하게 계산하므로 훨씬 더 잘 작동합니다. 배치는 고정된 메모리 크기를 가진
GPU
를 사용하
는 대규모 훈련에서 속도를 높일 수도 있습니다. 해당 메모리를 완전히 채우도록 데이터 배치
를 만드는 것이 가장 효율적입니다.
DataLoader
를 사용하는 경우 간단히 매개변수를 설정해
배치를 처리할 수 있습니다.
4.7.2
셔플링
데이터 셔플링
shuffling
은 특히 배치를 만들 매우 중요합니다. ...
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