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
166
밑바닥부터 시작하는 딥러닝 5
6.2.3
선형 회귀 구현
파이토치를 이용하여 선형 회귀를 구현하겠습니다. 코드가 조금 길어서 먼저 전반부만 살펴보
겠습니다.
import
torch
#
토이
데이터셋
torch
.
manual
_
seed(
0
)
x
=
torch
.
rand(
100
,
1
)
y
=
5
+
2
*
x
+
torch
.
rand(
100
,
1
)
W
=
torch
.
zeros((
1
,
1
), requires
_
grad
=
True
)
b
=
torch
.
zeros(
1
, requires
_
grad
=
True
)
def
predict
(x):
y
=
x
@
W
+
b
return
y
W
와
b
를
tensor
인스턴스로 생성합니다. 형상은
W
(
1
,
1
)
과
b
(
1
,)
임을 출력하여 확인할 수
있습니다.
predict
(
)
함수에서는 행렬 곱 연산자인 @을 사용하여 계산을 수행합니다. 행렬
곱은 여러 데이터에 대해 계산을 일괄로 수행해줍니다
(
지금 예에서는
100
개)
. 이때의 형상은
[그림
6
-
5
]처럼 변합니다.
그림
6-5
행렬 곱에 따른 형상 변화
(
‘+
b
’는 생략
)
형상:
x
@
(100,1)
(100,1)
(1,1)
W
=
y
그림과 같이 대응하는 차원의 원소 수가 일치함을 알 수 있습니다. 그리고 결과인
y
의 형상
은
(
100
,
1
)
이 됩니다. 이렇게 하면
x
에 담긴 데이터
100
개 각각에
W
가 곱해집니다. ...
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