Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
밑바닥부터 시작하는 딥러닝 5
by
사이토 고키
,
개앞맵시(이복연)
October 2024
Beginner to intermediate
340 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from
밑바닥부터 시작하는 딥러닝 5
263
9
장
확산 모델 구현
이 코드를 실행하면 [그림
9
-
11
]의 이미지를 출력합니다. 반복문을 써서 노이즈를
100
번이나
추가하는 일 없이, 단 한 번의 노이즈 추가만으로 확산 과정을 구현했습니다.
그림
9-11
t
=100에서 노이즈 이미지
9.3.4
Diffuser
클래스 구현
마지막으로 지금까지 구현한 확산 과정 코드를 클래스로 정리하겠습니다. 클래스 이름은
Diffuser
로 합시다. 또한 다음 두 가지 사항에 대응하기 위해 일부 코드를 추가하겠습니다.
●
GPU
지원
:
CPU
와
GPU
중 원하는 장치 선택
●
배치 데이터
: (
C
,
H
,
W
)
가 아닌
(
N
,
C
,
H
,
W
)
형태의 데이터 처리
코드는 다음과 같습니다.
class
Diffuser
:
def
__
init
__
(
self
, num
_
timesteps
=
1000
, beta
_
start
=
0
.
0001
, beta
_
end
=
0
.
02
,
device
=
'cpu'
):
self
.
num
_
timesteps
=
num
_
timesteps
self
.
device
=
device
self
.
betas
=
torch
.
linspace(beta
_
start, beta
_
end, num
_
timesteps,
device
=
device)
self
.
alphas
=
1
-
self
.
betas
step09/diffusion_model.py
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.
Start your free trial
You might also like
밑바닥부터 시작하는 딥러닝 4
사이토 고키
밑바닥부터 시작하는 딥러닝
사이토 고키
밑바닥부터 시작하는 딥러닝 2
사이토 고키
밑바닥부터 시작하는 비트코인
류정필, 송재준
Publisher Resources
ISBN: 9791169212960