This document discusses using computational graphs to calculate gradients for neural networks and other deep learning models. It explains that directly calculating gradients on paper for complex models is difficult and inefficient. Instead, computational graphs can be used as a data structure to represent the calculation process within a model. Nodes in the graph correspond to mathematical operations like matrix multiplications and activation functions. This allows gradients to be efficiently calculated by backpropagating through the graph. Examples of linear models, convolutional networks, and neural Turing machines are given to show how computational graphs can handle both simple and complex models.
Tijmen Blankenvoort, co-founder Scyfer BV, presentation at Artificial Intelligence Meetup 15-1-2014. Introduction into Neural Networks and Deep Learning.
This presentation Neural Network will help you understand what is a neural network, how a neural network works, what can the neural network do, types of neural network and a use case implementation on how to classify between photos of dogs and cats. Deep Learning uses advanced computing power and special types of neural networks and applies them to large amounts of data to learn, understand, and identify complicated patterns. Automatic language translation and medical diagnoses are examples of deep learning. Most deep learning methods involve artificial neural networks, modeling how our brains work. Neural networks are built on Machine Learning algorithms to create an advanced computation model that works much like the human brain. This neural network tutorial is designed for beginners to provide them the basics of deep learning. Now, let us deep dive into these slides to understand how a neural network actually work.
Below topics are explained in this neural network presentation:
1. What is Neural Network?
2. What can Neural Network do?
3. How does Neural Network work?
4. Types of Neural Network
5. Use case - To classify between the photos of dogs and cats
Simplilearn’s Deep Learning course will transform you into an expert in deep learning techniques using TensorFlow, the open-source software library designed to conduct machine learning & deep neural network research. With our deep learning course, you'll master deep learning and TensorFlow concepts, learn to implement algorithms, build artificial neural networks and traverse layers of data abstraction to understand the power of data and prepare you for your new role as deep learning scientist.
Why Deep Learning?
It is one of the most popular software platforms used for deep learning and contains powerful tools to help you build and implement artificial neural networks.
Advancements in deep learning are being seen in smartphone applications, creating efficiencies in the power grid, driving advancements in healthcare, improving agricultural yields, and helping us find solutions to climate change. With this Tensorflow course, you’ll build expertise in deep learning models, learn to operate TensorFlow to manage neural networks and interpret the results.
You can gain in-depth knowledge of Deep Learning by taking our Deep Learning certification training course. With Simplilearn’s Deep Learning course, you will prepare for a career as a Deep Learning engineer as you master concepts and techniques including supervised and unsupervised learning, mathematical and heuristic aspects, and hands-on modeling to develop algorithms.
Learn more at: https://www.simplilearn.com
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...Simplilearn
This Deep Learning Presentation will help you in understanding what is Deep learning, why do we need Deep learning, applications of Deep Learning along with a detailed explanation on Neural Networks and how these Neural Networks work. Deep learning is inspired by the integral function of the human brain specific to artificial neural networks. These networks, which represent the decision-making process of the brain, use complex algorithms that process data in a non-linear way, learning in an unsupervised manner to make choices based on the input. This Deep Learning tutorial is ideal for professionals with beginners to intermediate levels of experience. Now, let us dive deep into this topic and understand what Deep learning actually is.
Below topics are explained in this Deep Learning Presentation:
1. What is Deep Learning?
2. Why do we need Deep Learning?
3. Applications of Deep Learning
4. What is Neural Network?
5. Activation Functions
6. Working of Neural Network
Simplilearn’s Deep Learning course will transform you into an expert in deep learning techniques using TensorFlow, the open-source software library designed to conduct machine learning & deep neural network research. With our deep learning course, you’ll master deep learning and TensorFlow concepts, learn to implement algorithms, build artificial neural networks and traverse layers of data abstraction to understand the power of data and prepare you for your new role as deep learning scientist.
Why Deep Learning?
It is one of the most popular software platforms used for deep learning and contains powerful tools to help you build and implement artificial neural networks.
Advancements in deep learning are being seen in smartphone applications, creating efficiencies in the power grid, driving advancements in healthcare, improving agricultural yields, and helping us find solutions to climate change. With this Tensorflow course, you’ll build expertise in deep learning models, learn to operate TensorFlow to manage neural networks and interpret the results.
You can gain in-depth knowledge of Deep Learning by taking our Deep Learning certification training course. With Simplilearn’s Deep Learning course, you will prepare for a career as a Deep Learning engineer as you master concepts and techniques including supervised and unsupervised learning, mathematical and heuristic aspects, and hands-on modeling to develop algorithms.
There is booming demand for skilled deep learning engineers across a wide range of industries, making this deep learning course with TensorFlow training well-suited for professionals at the intermediate to advanced level of experience. We recommend this deep learning online course particularly for the following professionals:
1. Software engineers
2. Data scientists
3. Data analysts
4. Statisticians with an interest in deep learning
Tijmen Blankenvoort, co-founder Scyfer BV, presentation at Artificial Intelligence Meetup 15-1-2014. Introduction into Neural Networks and Deep Learning.
This presentation Neural Network will help you understand what is a neural network, how a neural network works, what can the neural network do, types of neural network and a use case implementation on how to classify between photos of dogs and cats. Deep Learning uses advanced computing power and special types of neural networks and applies them to large amounts of data to learn, understand, and identify complicated patterns. Automatic language translation and medical diagnoses are examples of deep learning. Most deep learning methods involve artificial neural networks, modeling how our brains work. Neural networks are built on Machine Learning algorithms to create an advanced computation model that works much like the human brain. This neural network tutorial is designed for beginners to provide them the basics of deep learning. Now, let us deep dive into these slides to understand how a neural network actually work.
Below topics are explained in this neural network presentation:
1. What is Neural Network?
2. What can Neural Network do?
3. How does Neural Network work?
4. Types of Neural Network
5. Use case - To classify between the photos of dogs and cats
Simplilearn’s Deep Learning course will transform you into an expert in deep learning techniques using TensorFlow, the open-source software library designed to conduct machine learning & deep neural network research. With our deep learning course, you'll master deep learning and TensorFlow concepts, learn to implement algorithms, build artificial neural networks and traverse layers of data abstraction to understand the power of data and prepare you for your new role as deep learning scientist.
Why Deep Learning?
It is one of the most popular software platforms used for deep learning and contains powerful tools to help you build and implement artificial neural networks.
Advancements in deep learning are being seen in smartphone applications, creating efficiencies in the power grid, driving advancements in healthcare, improving agricultural yields, and helping us find solutions to climate change. With this Tensorflow course, you’ll build expertise in deep learning models, learn to operate TensorFlow to manage neural networks and interpret the results.
You can gain in-depth knowledge of Deep Learning by taking our Deep Learning certification training course. With Simplilearn’s Deep Learning course, you will prepare for a career as a Deep Learning engineer as you master concepts and techniques including supervised and unsupervised learning, mathematical and heuristic aspects, and hands-on modeling to develop algorithms.
Learn more at: https://www.simplilearn.com
What Is Deep Learning? | Introduction to Deep Learning | Deep Learning Tutori...Simplilearn
This Deep Learning Presentation will help you in understanding what is Deep learning, why do we need Deep learning, applications of Deep Learning along with a detailed explanation on Neural Networks and how these Neural Networks work. Deep learning is inspired by the integral function of the human brain specific to artificial neural networks. These networks, which represent the decision-making process of the brain, use complex algorithms that process data in a non-linear way, learning in an unsupervised manner to make choices based on the input. This Deep Learning tutorial is ideal for professionals with beginners to intermediate levels of experience. Now, let us dive deep into this topic and understand what Deep learning actually is.
Below topics are explained in this Deep Learning Presentation:
1. What is Deep Learning?
2. Why do we need Deep Learning?
3. Applications of Deep Learning
4. What is Neural Network?
5. Activation Functions
6. Working of Neural Network
Simplilearn’s Deep Learning course will transform you into an expert in deep learning techniques using TensorFlow, the open-source software library designed to conduct machine learning & deep neural network research. With our deep learning course, you’ll master deep learning and TensorFlow concepts, learn to implement algorithms, build artificial neural networks and traverse layers of data abstraction to understand the power of data and prepare you for your new role as deep learning scientist.
Why Deep Learning?
It is one of the most popular software platforms used for deep learning and contains powerful tools to help you build and implement artificial neural networks.
Advancements in deep learning are being seen in smartphone applications, creating efficiencies in the power grid, driving advancements in healthcare, improving agricultural yields, and helping us find solutions to climate change. With this Tensorflow course, you’ll build expertise in deep learning models, learn to operate TensorFlow to manage neural networks and interpret the results.
You can gain in-depth knowledge of Deep Learning by taking our Deep Learning certification training course. With Simplilearn’s Deep Learning course, you will prepare for a career as a Deep Learning engineer as you master concepts and techniques including supervised and unsupervised learning, mathematical and heuristic aspects, and hands-on modeling to develop algorithms.
There is booming demand for skilled deep learning engineers across a wide range of industries, making this deep learning course with TensorFlow training well-suited for professionals at the intermediate to advanced level of experience. We recommend this deep learning online course particularly for the following professionals:
1. Software engineers
2. Data scientists
3. Data analysts
4. Statisticians with an interest in deep learning
Dataset Preparation
Abstract: This PDSG workshop introduces basic concepts on preparing a dataset for training a model. Concepts covered are data wrangling, replacing missing values, categorical variable conversion, and feature scaling.
Level: Fundamental
Requirements: No prior programming or statistics knowledge required.
Introduction to linear regression and the maths behind it like line of best fit, regression matrics. Other concepts include cost function, gradient descent, overfitting and underfitting, r squared.
구글에서 만든 BERT 언어 모델이 나오면서 NLP 분야는 상당한 발전을 이룰 수 있었습니다 그리고 금융권 또한 대량의 Financial 텍스트 데이터를 축적하고 있습니다.
하지만 그 사전 훈련된 금융관련 언어 모델은 없었다고 합니다
금융분야에서의 NLP 사용은 이제 온라인 뉴스기사나 소셜미디어 텍스트가 있을 때
그 시장 심리를 분석하여 실시간으로 모니터링을 하고 주가나 지수의 방향성을 예측해주는 방법으로 그 흐름에 대한 '시그널'로 활용을 할 수가 있습니다.
Sentiment analysis는 Domain에 따라 성능이 크게 좌우되는 작업입니다. 해당 논문은 파이낸스 데이터를 Bert모델을 이용하여 학습에 큰 진전을 이루었습니다.
오늘 논문 리뷰는 딥논읽 자연어 처리팀 황소현 님이 자세한 리뷰 도와주셨습니다.
오늘도 많은 관심 미리 감사드립니다!
https://youtu.be/FQN8sOi1PTI
Word embedding, Vector space model, language modelling, Neural language model, Word2Vec, GloVe, Fasttext, ELMo, BERT, distilBER, roBERTa, sBERT, Transformer, Attention
It’s long ago, approx. 30 years, since AI was not only a topic for Science-Fiction writers, but also a major research field surrounded with huge hopes and investments. But the over-inflated expectations ended in a subsequent crash and followed by a period of absent funding and interest – the so-called AI winter. However, the last 3 years changed everything – again. Deep learning, a machine learning technique inspired by the human brain, successfully crushed one benchmark after another and tech companies, like Google, Facebook and Microsoft, started to invest billions in AI research. “The pace of progress in artificial general intelligence is incredible fast” (Elon Musk – CEO Tesla & SpaceX) leading to an AI that “would be either the best or the worst thing ever to happen to humanity” (Stephen Hawking – Physicist).
What sparked this new Hype? How is Deep Learning different from previous approaches? Are the advancing AI technologies really a threat for humanity? Let’s look behind the curtain and unravel the reality. This talk will explore why Sundar Pichai (CEO Google) recently announced that “machine learning is a core transformative way by which Google is rethinking everything they are doing” and explain why "Deep Learning is probably one of the most exciting things that is happening in the computer industry” (Jen-Hsun Huang – CEO NVIDIA).
Either a new AI “winter is coming” (Ned Stark – House Stark) or this new wave of innovation might turn out as the “last invention humans ever need to make” (Nick Bostrom – AI Philosoph). Or maybe it’s just another great technology helping humans to achieve more.
House Price Prediction An AI Approach.Nahian Ahmed
Suppose you have a house. And you want to sell it. Through House Price Prediction project you can predict the price from previous sell history.
And we make this prediction using Machine Learning.
Dataset Preparation
Abstract: This PDSG workshop introduces basic concepts on preparing a dataset for training a model. Concepts covered are data wrangling, replacing missing values, categorical variable conversion, and feature scaling.
Level: Fundamental
Requirements: No prior programming or statistics knowledge required.
Introduction to linear regression and the maths behind it like line of best fit, regression matrics. Other concepts include cost function, gradient descent, overfitting and underfitting, r squared.
구글에서 만든 BERT 언어 모델이 나오면서 NLP 분야는 상당한 발전을 이룰 수 있었습니다 그리고 금융권 또한 대량의 Financial 텍스트 데이터를 축적하고 있습니다.
하지만 그 사전 훈련된 금융관련 언어 모델은 없었다고 합니다
금융분야에서의 NLP 사용은 이제 온라인 뉴스기사나 소셜미디어 텍스트가 있을 때
그 시장 심리를 분석하여 실시간으로 모니터링을 하고 주가나 지수의 방향성을 예측해주는 방법으로 그 흐름에 대한 '시그널'로 활용을 할 수가 있습니다.
Sentiment analysis는 Domain에 따라 성능이 크게 좌우되는 작업입니다. 해당 논문은 파이낸스 데이터를 Bert모델을 이용하여 학습에 큰 진전을 이루었습니다.
오늘 논문 리뷰는 딥논읽 자연어 처리팀 황소현 님이 자세한 리뷰 도와주셨습니다.
오늘도 많은 관심 미리 감사드립니다!
https://youtu.be/FQN8sOi1PTI
Word embedding, Vector space model, language modelling, Neural language model, Word2Vec, GloVe, Fasttext, ELMo, BERT, distilBER, roBERTa, sBERT, Transformer, Attention
It’s long ago, approx. 30 years, since AI was not only a topic for Science-Fiction writers, but also a major research field surrounded with huge hopes and investments. But the over-inflated expectations ended in a subsequent crash and followed by a period of absent funding and interest – the so-called AI winter. However, the last 3 years changed everything – again. Deep learning, a machine learning technique inspired by the human brain, successfully crushed one benchmark after another and tech companies, like Google, Facebook and Microsoft, started to invest billions in AI research. “The pace of progress in artificial general intelligence is incredible fast” (Elon Musk – CEO Tesla & SpaceX) leading to an AI that “would be either the best or the worst thing ever to happen to humanity” (Stephen Hawking – Physicist).
What sparked this new Hype? How is Deep Learning different from previous approaches? Are the advancing AI technologies really a threat for humanity? Let’s look behind the curtain and unravel the reality. This talk will explore why Sundar Pichai (CEO Google) recently announced that “machine learning is a core transformative way by which Google is rethinking everything they are doing” and explain why "Deep Learning is probably one of the most exciting things that is happening in the computer industry” (Jen-Hsun Huang – CEO NVIDIA).
Either a new AI “winter is coming” (Ned Stark – House Stark) or this new wave of innovation might turn out as the “last invention humans ever need to make” (Nick Bostrom – AI Philosoph). Or maybe it’s just another great technology helping humans to achieve more.
House Price Prediction An AI Approach.Nahian Ahmed
Suppose you have a house. And you want to sell it. Through House Price Prediction project you can predict the price from previous sell history.
And we make this prediction using Machine Learning.
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part 2Philip Schwarz
(download for perfect quality) See aggregation functions defined inductively and implemented using recursion.
Learn how in many cases, tail-recursion and the accumulator trick can be used to avoid stack-overflow errors.
Watch as general aggregation is implemented and see duality theorems capturing the relationship between left folds and right folds.
Through the work of Sergei Winitzki and Richard Bird.
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala Part 2 ...Philip Schwarz
(download for perfect quality) See aggregation functions defined inductively and implemented using recursion.
Learn how in many cases, tail-recursion and the accumulator trick can be used to avoid stack-overflow errors.
Watch as general aggregation is implemented and see duality theorems capturing the relationship between left folds and right folds.
Through the work of Sergei Winitzki and Richard Bird.
This version corrects the following issues:
slide 32: = reverse --> reverse =
Slide 33: 100_000 -> 1_000_000
It also adds slides 36, 37 and 38
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...Naoki Shibata
Naoki Shibata : Efficient Evaluation Methods of Elementary Functions Suitable for SIMD Computation, Journal of Computer Science on Research and Development, Proceedings of the International Supercomputing Conference ISC10., Volume 25, Numbers 1-2, pp. 25-32, 2010, DOI: 10.1007/s00450-010-0108-2 (May. 2010).
http://www.springerlink.com/content/340228x165742104/
http://freshmeat.net/projects/sleef
Data-parallel architectures like SIMD (Single Instruction Multiple Data) or SIMT (Single Instruction Multiple Thread) have been adopted in many recent CPU and GPU architectures. Although some SIMD and SIMT instruction sets include double-precision arithmetic and bitwise operations, there are no instructions dedicated to evaluating elementary functions like trigonometric functions in double precision. Thus, these functions have to be evaluated one by one using an FPU or using a software library. However, traditional algorithms for evaluating these elementary functions involve heavy use of conditional branches and/or table look-ups, which are not suitable for SIMD computation. In this paper, efficient methods are proposed for evaluating the sine, cosine, arc tangent, exponential and logarithmic functions in double precision without table look-ups, scattering from, or gathering into SIMD registers, or conditional branches. We implemented these methods using the Intel SSE2 instruction set to evaluate their accuracy and speed. The results showed that the average error was less than 0.67 ulp, and the maximum error was 6 ulps. The computation speed was faster than the FPUs on Intel Core 2 and Core i7 processors.
* Recognize characteristics of graphs of polynomial functions.
* Use factoring to find zeros of polynomial functions.
* Identify zeros and their multiplicities.
* Determine end behavior.
* Understand the relationship between degree and turning points.
* Graph polynomial functions.
* Use the Intermediate Value Theorem.
Here is the first set of notes for the first class in Analysis of Algorithm. I added a dedicatory for my dear Fabi... she has showed me what real idealism is....
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
We have compiled the most important slides from each speaker's presentation. This year’s compilation, available for free, captures the key insights and contributions shared during the DfMAy 2024 conference.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
1. 컴퓨터 비전을 위한 역전파 Backpropagation
도정찬
Michigan Online, Justin Johnson, Computer Vision, 2021. 02. 01
2. ▪ 오늘 이번 6강에는 전파 propagation에 대해서 설명하겠습니다. 우선 지난 시간에 배운 신경망에 대해서 우선 볼건데, 이 신경
망 모델이 선형모델보다 아주 효과적인 분류기의 종류인걸 알 수 있었습니다. 되돌아 보면 신경망은 행렬 곱 형태에다가 비선형
함수인 활성화 함수로 이루어져 있었죠. 이를 이용해서 깊은 신경망을 만들 수 있었고, 공간 변환이라는 개념을 보면서 선형 분류
기보다 신경망 왜 좋은지 보았어요.
지난 시간 : 신경망에 관하여
비 컨벡스
보편적 근사화
공간 변환
선형 분류기를
완전 연결 신경망으로!
3. 지난 시간 : 신경망에 관하여
비 컨벡스
보편적 근사화
공간 변환
선형 분류기를
완전 연결 신경망으로!
▪ 공간 변환과 활성화 함수를 통해 신경망이 입력 공간에서 비선형적인 결정 경계를 가질 수 있었는 걸 봣었습니다. 그 다음에는 ..
인공 신경망이 범프 함수를 이용해서 다양한 비선형 모델들을 근사시킬수 있는걸 보면서 좋다고 했엇죠. 그리고 또 컨벡스의 개
념을 배우고 나서, 신경망이 비 컨벡스 최적화 문제로 처리해야 하는 다양한 함수마저도 근사 시켜 표현? 나타낼수 있는 효과적
인 방법이란걸 알수 있었습니다. 하지만 이론적으로 수렴성을 보장하지는 못한다고 했었죠.
4. ▪ 지난 강의에서 마지막으로 본 것 중에서 약간 문제가 남아있긴한데, 이제 우리들은 이런 복잡한 형태의 비용함수들 정리할 수
있게 되었으며, 이 비용함수들이 확률적 경사하강법 같은 걸로 최소화시키며 선형 분류기나 신경망 같은 혹은 그외 딥러닝 모델
을 학습시키는데 사용하는 걸 알고 있습니다.
문제 : 어떻게 그라디언트, 기울기를 계산 할 수 있을까요??
비선형 스코어 함수 : Nonlinear score function
예측치의 SVM 비용 : SVM Loss on Predictions
규제 Regularization
총 손실 = 데이터 손실 + 규제 항
Total lostt = data loss + regularization
총 손실의 W1, W2에 대한 편미분을 계산하면, W1과 W2를 학습시킬수 있습니다!
5. ▪ 하지만 여기서 문제는 어떻게 모델의 그라디언트를 계산하느냐 입니다. 이제 우리는 비용함수를 적을 수 있고, 모델의 가중치
행렬의 모든 비용들에 대한 그라디언트를 계산할 수 있다면, 그동안 얘기한 최적화 알고리즘들로 실제 비용을 최소화 시킬수 있
을 것이고, 우리의 훈련 데이터셋에 적합된 모델을 얻을수가 있을 겁니다.
▪ 그래서 오늘 강의의 주제는 어떻게 복잡한 형태의 신경망 이나 다른 형태의 모델 함수의 편미분 derivates인 그라디언트를 계산
하는지를 다루겠습니다.
문제 : 어떻게 그라디언트, 기울기를 계산 할 수 있을까요??
비선형 스코어 함수 : Nonlinear score function
예측치의 SVM 비용 : SVM Loss on Predictions
규제 Regularization
총 손실 = 데이터 손실 + 규제 항
Total lostt = data loss + regularization
총 손실의 W1, W2에 대한 편미분을 계산하면, W1과 W2를 학습시킬수 있습니다!
6. ▪ 우리가 해볼수 있는 익숙한 방법이라 하면, 그냥 종이에다가 그라디언트를 직접 계산해서 구할수도 있겠습니다. 비용 함수를 정
의해서 정리해나갈수 있겠는데, 만약 선형 분류기와 SVM 손실을 사용한다고 하면 이에 대한 모든 수식들을 종이에다가 적고 (엄
청 긴 수식이 되겠죠), 여기다가 우리가 사용할 데이터와 가중치를 넣어 계산하면 될겁니다.
▪ 하지만 행렬 미분 법칙과 친숙한 사람이라면 이게 좋은 방법이 아닌걸 아실겁니다. 그래서 혹시 두 번쨰 과재물을 이런식으로
계산하려는 분이 있다면 사과 할게요. 혹시 여러분이 이 방법으로 종이에다가 가중치를 계산한다면, 이 방법이 가지고 있는 문제
점을 알아차릴수도 있는데, 종이에다가 쓰기에는 너무 많고 엄청 지루한 일일 겁니다.
나쁜 방법 : 직접 종이에다가 ∇𝒘𝑳 를 구하기는 힘들어요.
문제점 1 : 많은 행렬들을 미분하고, 계산해야하는데 종이가 많이
필요하겠죠.
문제점 2 : 비용 결과를 바꾸려면 어떻게 해야할까요? SVM 대신
소프트맥스를 쓰면 될가요? 한번 처음부터 봅시다.
문제점 3 : 모델이 너무 복잡하면 돌릴수도 없습니다.
7. ▪ 그러면 아까 선형 분류기의 비용함수로 svm을 사용한 경우를 생각해봤지만, 이번에는 선형 분류기에 소프트 맥스 비용으로 아
니면 2층 신경망과 소프트맥스 비용, 혹은 5층 신경망과 SVM 비용이나 아무튼 다른 모델로 그라디언트를 구한다고 해봅시다. 이
런 다양한 비용함수를 종이에다가 처음부터 적어서 구한다면, 매번 많은 시간을 들여서 봐야 할 겁니다.
▪ 그래서 모듈화를 해서 보는게 실용적일 수도 있습니다. 서로 다른 타음의 모델이나, 구조, 비용함수를 모듈로서 바꾸는 식으루
요. 이런 방법으로 보면 더 잘 동작하는 방법을 빠르게 찾을수 있을 겁니다.
나쁜 방법 : 직접 종이에다가 ∇𝒘𝑳 를 구하기는 힘들어요.
문제점 1 : 많은 행렬들을 미분하고, 계산해야하는데 종이가 많이
필요하겠죠.
문제점 2 : 비용 결과를 바꾸려면 어떻게 해야할까요? SVM 대신
소프트맥스를 쓰면 될가요? 한번 처음부터 봅시다.
문제점 3 : 모델이 너무 복잡하면 돌릴수도 없습니다.
8. ▪ 이 방법으로 딥러닝을 다룰것이고 종이에다가 그라디언트를 계산해나갈 필요는 없겠습니다. 우리는 지루한 문제를 풀어주는
자료 구조, 알고리즘을 찾아내는 컴퓨터 과학자이며, 계산 그래프 computational graph라고 부르는 계산 과정을 위한 자료구조를
그라디언트 계산 문제에 사용할 거거든요.
나쁜 방법 : 직접 종이에다가 ∇𝒘𝑳 를 구하기는 힘들어요.
문제점 1 : 많은 행렬들을 미분하고, 계산해야하는데 종이가 많이
필요하겠죠.
문제점 2 : 비용 결과를 바꾸려면 어떻게 해야할까요? SVM 대신
소프트맥스를 쓰면 될가요? 한번 처음부터 봅시다.
문제점 3 : 모델이 너무 복잡하면 돌릴수도 없습니다.
9. ▪ 계산 그래프는 지향 그래프 directed graph(방향이 있는 그래프)로 우리 모델 내부에서 계산 과정을 보여줍니다. 여기서 왼쪽
을 보시면 데이터 X와 라벨 Y가 들어가는데 이 그래프에는 없내요. 어쩃든 우리는 데이터 X를 가지고 있고 학습된 가중치가 그
래프의 왼쪽에 노드로 있습니다.
▪ 이제 그래프의 왼쪽에서 오른쪽으로 전진하는데 계산 과정을 나타내는 노드들을 볼수 있어요. 이 계산 노드들은 함수를 계산하
는 과정을 의미합니다. 여기 파란색 노드의 경우 입력 X와 가중치 W의 행렬 곱을 나타내고, 요기 빨간 노드의 경우 힌지 로스를
의미하고 있내요. 우리가 svm 분류기를 사용한다면, 녹색 노드 같이 우리 모델에 규제항을 둘 수도 있겠습니다.
더 나은 방법 : 계산 그래프 Computational Graph를 사용하자
10. ▪ 이 과정을 다 거치고 나면 계산 그래프의 출력을 얻을 수 있어요. 이 값은 스칼라 값인 비용 L로 우리가 만든 모델을 훈련 하는
과정에 구해야하는 값이죠. 이 계산 그래프 형식은 선형 모델 같은데 적용 될때는 너무 시시해 보일수도 있습니다. 여러분도 알다
시피 선형 모델에서는 비용을 계산하는데 수행할 연산이 그렇게 많지 않아요.
▪ 계산 그래프로 수식을 쓰는건 과해 보일수는 있으나 이 방법은 좀 더 크고 복잡한 모델을 쓸때 정말 중요합니다. 예를 들면 알
렉스 넷같이 7층의 심층 컨볼루션 신경망과 비선형 활성화 함수와 규제항이 모든 층에 있고, 그 끝에 비용을 계산하는 경우에는
요.
더 나은 방법 : 계산 그래프 Computational Graph를 사용하자
11. ▪ 그러면 이미지가 꼭대기에서 입력으로 들어왔다고 생각해 볼게요. 그러면 많은 레이어에서 처리되고 마지막으로 스칼라 형태
의 비용 값이 바닥에서 나오게 되겠죠. 우린 종이에다가 직접 적어가면서 그라디언트를 구하기 보다는 이런 계산 그래프 형식을
사용하여 모델의 계산 과정을 나타내는 자료구조를 만들어 나가는게 좋겠죠.
심층 신경망(알렉스넷)
입력 이미지
가중치
손실
12. ▪ 음 여기에 특이한 예시로 뉴럴 튜링 머신이라고 부르는 모델이 있는데, 아마 계산 이론 수업의 인트로를 들어서 기억안다면 아
마 제가 이 모델을 다룬걸 기억하실거에요. 이 모델은 정형화된 계산 모델이었는데, 몇년 전에 튜링 머신을 미분 가능하도록 근사
시킨 뉴럴 네트워크로 만들어 졌습니다. 계산 이론 수업의 인트로에서 튜링 머신에 대해서 배울수 있는데, 여기 보여드리는게 미
분 가능 뉴럴 튜링 머신에서 구한 계산 그래프입니다.
뉴럴 튜링 머신
입력 이미지
손실
13. ▪ 보시면 아주 크고 복잡해서 이 모델의 그라디언트를 손으로 풀기는 싫겟죠. 그 보다는 계산 그래프로 그라디언트를 사용하고
싶을 겁니다. 하지만 안 좋은 결과를 얻을수도 있어요. 왜냐면 뉴런 튜링 머신에서 모델의 한 스탭만을 보여주는거고, 실제로 이
모델은 여러 스탭들을 진행하면서 위와 같이 펴지게 되요. 여러분은 이런 엄청 복잡한 모델을 만나게 되고, 학습 하기에는 너무
큰 계산 그래프가 만들어질 겁니다.
▪ 그렇다보니 그라디언트를 자동적으로 계산해주는 지향 그래프 순회 알고리즘 directed graph traversal algorithm을 사용하고
싶을거에요. 다행인건, 이건 복잡한 신경망에서 그라디언트 계산에 계산 그래프 사용이 왜 위험한가 보여주기 위한 것 이구요.
뉴럴 튜링 머신
14. ▪ 이제 어떻계 계산 그래프를 사용하여 그라디언트를 구할수 있는지 간단한 신경망 모델로 한번 봅시다. 이 슬라이드에서 보여
주고 있는 계시는 실제로 학습을 하기 위한 것이구요. 엄청 쉬워보이는 계산들을 할거지만 실제 모델에서는 훨신 복잡하게 계산
이 이뤄질 겁니다.
▪ 일단 여기 보시면 스칼라 변수인 XY와 Z를 입력받는 아주 간단한 함수가 있어요. 그리고 이 함수는 x와 y를 더하고 z를 곱한 것
을 비용이라고 정의해서 출력합니다. 이건 좀 지금까지 봣던거랑 다른 이상하게 생긴 비용함수죠. 하지만 이건 그냥 예시일 뿐이
니 중요하게 생각하지 마세요. 하지만 이 쉬운 예제가 계산 그래프로 그라디언트를 계산하는데 까지 이해할수 있도록 도울거에요.
역전파 BackPropagation:
간단한 예시로 보자
15. ▪ 계산 그래프로 그라디언트를 계산할때는, 입력 데이터를 받을때 역전파라고 부르는 방법을 사용합니다. 역전파 back
propagation은 계산 그래프 상에서 그라디언트를 계산하기 위해서 사용하는 알고리즘이에요. 이제 우리가 입력 공간에서 한 점
이 입력으로 그러니까 X = -2, Y = 5 그리고 Z = -4라는 값이 들어온다고 해봅시다.
▪ 계산 그래프를 사용하는 첫 번째 방법은 순전파 forward pass라고 하는데, 계산 과정이 왼쪽에서 오른쪽으로 나아가는것을 말
해요. 그럼 우리는 이연산을 그래프에 명시된 연산들을 입력 값으로부터 출력까지 계산해 나가면 됩니다.
역전파 BackPropagation:
간단한 예시로 보자
16. ▪ 계산 그래프를 사용하는 첫 번째 방법은 순전파 forward pass라고 부르는 방법이 있는데, 계산 과정이 왼쪽에서 오른쪽으로 나
아가는것을 말해요. 그럼 우리는 이 연산을 그래프에 명시된 연산들을 입력 값으로부터 출력까지 계산해 나가면 됩니다.
▪ 예를 들자면 이 경우 x와 y를 q라고 부르는 노드에 전달이 되서 덧셈 연산을하여 출력이 나옵니다. 최종 출력 f는 q 노드의 출력
과 입력 값 z를 곱하여 구하는데, 이 그래프가 순바향으로 동작하는 과정에서 최종 출력으로 - 12를 얻었습니다.
역전파 BackPropagation:
간단한 예시로 보자
17. ▪ 우리 목표는 역방향으로 흘러가면서 모든 그라디언트들을 계산해야 합니다. 출력이 주어질때 각 입력들에 대한 편미분 값들을
요. 즉, df/dx, df/dy, df/dz들을 구해야 하는데, 우선 왼쪽에서 우측으로 계산과정을 진행하여야 합니다. 그리고 우리는 역전파를
하다보니 순방향과 역방향을 비교해야 해요.
역전파 BackPropagation:
간단한 예시로 보자
18. ▪ 베이스 케이스에서 시작을 해야하는데, 우측에서 시작한다고 할때, f가 주어질때 f에 대한 미분을 계산한다고 합시다.
역전파 BackPropagation:
간단한 예시로 보자
19. ▪ 이 경우 f가 주어질때 f에 대한 변화량은 f가 변한다고 하더라도, 미분값 혹은 기울기 derivatives는 1이 될겁니다. 그러면 역방향
기울기를 계산할때, 그래프 상에서 역전파를 할때 위 그림처럼 나타낼수가 있는데, (위 그림의 경우)여기엔 각 노드(f)에서 계산되
는 값(-12)이 흐름선(방향 그래프의 에지) 위에 있고, 그라디언트/기울기 값(1)이 흐름선 아래에 있죠.
역전파 BackPropagation:
간단한 예시로 보자
20. ▪ 다음 단계에서 할일은 f가 주어질때 z 방향, z에 대한, 혹은 z로 미분을 계산해야하는데, 한번 중간에 있는 연산 과정을 보세요(f
= qz) 그래서 우리가 f를 z로 미분한 경우 값은 q만 남겠죠. 그러면 다시 한번 계산 그래프에서 q가 어떻게 되어있었는지 한번 봅
시다. 이 경우 q의 값이 3(x + y = -2 + 5)이 네요. 이제 우리는 세 기울기/미분값들 중 하나를 구하였습니다.
역전파 BackPropagation:
간단한 예시로 보자
21. ▪ 다음 단계는 f에대한 q 미분값을 계산하여야 합니다. 여기서도 그래프의 순방향이 아닌 역방향으로 가고있는것을 볼수 있으며,
f가 주어질때 q에 대한 미분값을 계산하기 위한 것이에요.
역전파 BackPropagation:
간단한 예시로 보자
22. ▪ 우리는 이미 f = q z인걸 알고 있다보니 f의 q방향 기울기 df/dq는 z가 되겁니다. z의 값은 그래프에서 볼수 있는데 -4가 됩니다.
역전파 BackPropagation:
간단한 예시로 보자
23. ▪ 이제 왼쪽 방향으로 더 나아가 봅시다. 그러면 이제 f에 대한 y를 계산해야 합니다. 여기서 좀 특이한 점은 미적분학 calculus에
서 볼수 있는 채인 룰을 사용해야한다는 점인데요.
역전파 BackPropagation:
간단한 예시로 보자
24. ▪ 여기있는 y는 출력 f에 직접적으로 연결되어있느게 아니다보니 f에 대한 y의 기울기를 구하기 위해서는 중간 변수 q에 미치는 y
의 영향을 고려하여야 합니다. 그래서 미분적분학에서 단일 변수 채인룰을 보면 df/dy = dq/dy * df/dq로 정리할수 있어요. 이건
매우 중요한 개념인데, y가 약간만이라도 변하면, dq/dy만큼 q도 어느정도 변할 것이고, f도 변하게 되겠죠.
역전파 BackPropagation:
간단한 예시로 보자
25. ▪ 아무튼 이 dq/ dy와 df/ dq이 두 항을 곱하여야 하며 이 방정식에서 이 세 항들을 서로 다른 이름을 가지고 있습니다. 맨 좌측
의 항인 df/dy를 다운스트림 그라디언트downstream gradient라고 부르는데, 역전파 과정에서 계산하는 값이기 때문입니다.
▪ dq/dy는 지역 그라디언트 local gradient라 부르는데, y가 다음 출력인 q에 얼마나 영향을 미치는지의 영향을 나타내기 때문에
요. 그리고 df/dq는 업스트림 그라디언트 upstream gradient라고 부르르는 값으로 이 그래프의 한 출력 일부로, 전체 그래프 끝
에서 최종 출력에 얼마나 영향을 주는 정도를 나타내기 때문입니다.
▪ 그래서 체인룰을 보면 다운스트림 그라디언트를 계산하기 위해선 지역과 업스트림 그라디언트를 곱해줘야하는걸 보여줍니다.
역전파 BackPropagation:
간단한 예시로 보자
26. ▪ 이 경우에 우리가 로컬 그라디언트를 알고 있다고 할수 있는데, q = x + y 이다보니 로컬 그라디언트/기울기는 1이 됩니다
(dq/dy = 1이므로). 그리고 f의 y에 대한 기울기는 로컬 그라디언트에 업스트림 그라디언트를 곱해야 하므로, 업스트림 그라디언
트인 df/dq = z = -4로이다보니 f의 y에 대한 기울기 = 다운스트림 그라디언트는 1 * -4 = -4가 됩니다.
역전파 BackPropagation:
간단한 예시로 보자
27. ▪ 이런식으로 나머지 다운스트림 그라디언트를 구할때 로컬과 업스트림을 곱해서 구할수 있는데, 로컬 그라디언트는 1로 봐도 괜
찬아요. 왜냐면 이 로컬 그라디언트의 노드가 덧셈 연산을 하다보니 기울기가 발생하지 않거든요.
역전파 BackPropagation:
간단한 예시로 보자
28. ▪ 그래서 우리가 필요한 모든 역전파 그라디언트들을 쉽게 계산할 수 있었습니다. 이 쉬운 예제로 어떻게 계산 그래프가 복잡한
함수들의 기울기를 계산하는지를 볼수 있엇어요. 순방향으로 왼쪽에서 오른쪽으로 모든 값들을 계산한 후에 역 방향으로 그래프
상의 모든 노드들의 그라디언트, 기울기들을 계산해 가면서요.
역전파 BackPropagation:
간단한 예시로 보자
29. ▪ 이렇게 그라디언트를 계산하는 방법은 매우 유용한데, 모듈화됬기도 하고, 계산 그래프 안에있는 한 노드를 확대해서 볼수도 있
어요. 그라디언트 계산을 위해 역전파를 사용하는 이방법이 정말로 좋은점은 그래프의 각 부분들은 그래프의 다른 부분들이 어떻
게 되었는지 알 필요 없이, 각 노드안에 있는 로컬한/지역적인 계산만 수행하면 되거든요. 그래서 모든 로컬 과정들을 집계함으로
서 전체 그래프의 전역적인 기울기를 구할수가 있습니다.
30. ▪ 이전 슬라이드에서 본것 같은 과정들로 진행한다면, 한 단일 노드에서는 이런 형태로 지역적인 함수 f를 계산할거에요. f는 x와
y를 입력으로하여 순방향으로 출력 z를 구할겁니다. 순방향 연산을 수행한 후에 출력 z는 다른 그래프의 일부분이 되어 다른 노
드의 입력으로 사용하게 됩니다.
▪ 하지만 우리는 이 노드 하나의 관점에서 어떻게 되는지 몰 필요 없이 그냥 출력을 계산해서 다른 노드들의 입력으로 들어가는
구나 알면 됩니다. 그리고 이 과정 끝에 그래프의 끝에서 어떤 값, 최종 비용이 계산되겠지요. 그러고나서 역전파 과정이 시작됩
니다.
31. ▪ 그라디언트들은 이 그림의 바깥에서부터 역방향으로 들어오다가 우리가 관심을 갖고 있는 이 노드와 만나게 될 것이고, 업스트
림 그라디언트(총 비용의 z에 대한 기울기 = dL / dz)를 받을 겁니다. 이 업스트림 그라디언트에서는 총 비용이 이 노드랑 얼마
나 많이 떨어져있는지를 알려주는데, 이 노드가 총 비용의 변화에 멀리 떨어진 정도를 나타낸다고 해요.
32. ▪ 이 노드의 로컬한 출력이 약간 변한다면 업스트림 그라디언트로 우리가 이 노드 내부에서 이에 대한 로컬한 그라디언트를 구할
수 있는데, 로컬 그라디언트란 노드의 출력이 해당 노드의 입력에 얼마나 영향을 받앗는지를 의미해요.
33. ▪ 이 로컬 그라디언트와 업스트림 그라디언트를 곱함으로서 다운 스트림 그라디언트를 쉽게 계산할 수 있겠습니다. 다운 스트림
그라디언트들은 그래프 역전파 과정에서 다른 노드들을 통과하게 되요. 이 노드에서는 다운스트림 노드가 다른데서 어떻게 되는
지 보여주지는 않지만
34. ▪ 이 다운 스트림 그라디언트들은 다른 노드에서도 사용될 것이고, 이 역전파 과정이 종료되었을때는 총 비용에대한 모든 그래프
입력들의 기울기/그라디언트를 구해지게 됩니다. y = WX에서 모든 W원소들의 변화량 DW이 계산된다고 생각하면 될것같아요.
이 방법으로 전체적인 함수 구조를 이해할 필요없이 로컬, 전역적 그라디언트들을 계순할수 있었어요. 우리는 단지 그래프의 각
노드 안에 있는 지역적인 그라디언트만 계산하고, 서로 연결된 모든 노드에서 이를 추적함으로서 기존에 종이에다가 복잡하게 그
라디언트를 계산한 것에서 크게 개선되었죠.
35. ▪ 계산 그래프가 동작하는 다른 예제를 한번 봅시다. 여기에 로지스틱 분류기 같이 보이는 식이 있는데, 이 복잡해 보이는 함수의
정확한 역활이 무엇인지는 아직 이 강의에서 보는 그라디언트 계산과 관련없어요. 좌측에 보시면 5개의 입력으로 w0, x0, w1, x1,
w2가 들어오고 순방향으로 계산되고 있어요. 첫 두 원소 x, w들이 곱해지고 마지막에 편향항인 w2가 더해졋죠. 그리고 이 값을 -
1 곱한 뒤 지수함수의 밑으로 사용해줍니다. 그리고 순방향으로 더 나아가 우측의 최종 스칼라 값을 출력으로 구하였습니다.
다른 예시
36. ▪ 이제 역방향으로 나아갈 차례입니다. 업스트림 그라디언트와 로컬 그라디언트를 각 노드에서 곱함으로서 다운스트림 그라디언
트가 계산되는 과정을 반복해서 봅시다. 우리는 항상 베이스 케이스에서 시작해요. 이 베이스 케이스는 출력의 자기 자신에 대한
기울기다 보니 항상 1이 됩니다.
다른 예시
37. ▪ 다음으로 볼 것은 1/x를 보겠습니다. 우리는 1/x의 로컬 그라디언트가 -1/x^2인걸 알고 있으므로, x = 1.35이니 로컬 그라디언
트에 이를 대입하면 -0.53이 됩니다. 이 로컬 그라디언트 -0.53와 업스트림 그라디언트 1를 곱하여 다운 스트림 그라디언트-.053
를 구하였고, 다음 단계로 넘어가봅시다.
다른 예시
38. ▪ 그리고 우리는 상수의 덧셈 노드에서 지역 그라디언트가 1인것을 봤었었죠. 그래서 이 경우 그대로 역방향으로 통과하겠습니다.
다른 예시
39. ▪ 이제 지수 함수의 로컬 그라디언트/기울기를 계산해봅시다. 지수 함수의 미분은 자기 자신이 되며 입력 x는 -1이므로 로컬 그라
디언트 exp(-1) = 0.36879이며, 이를 업스트림 그라디언트 -0.53과 곱하면 다운스트림 그라디언트는 -0.20이 됩니다.
다른 예시
40. ▪ 이런 식으로 각 노드에서 역방향 처리 과정은 지역 그라디언트를 계산하고, 업스트림과 지역 그라디언트를 곱해나가는 과정을
거치면 되요.
다른 예시
43. ▪ 이 계산 그래프에서 신기한 점은 이 계산구조를 아주 기초적인 덧샘과 곱샘, 지수함수, 나눗샘, 상수 덧샘 같은 기초적인 대수
연산만으로 나타낼수 있다는 점이에요. 이 그래프를 기초적인 대수적 연산으로 나눠서 본다면 지루하겠죠. 하지만 기초적인 연산
들을 조합하여 필요한 함수를 만들던 것으로부터는 자유로워 졌습니다.
다른 예시
44. ▪ 이 예제에서도 기초적인 산술 연산으로 나누어져 있는데요, 하지만 노드들을 하나의 독립적인 함수로 정의 하여 더 복잡한 함
수도 계산할수 있습니다. 이 예제가 왜 그래프의 일부(파란색 상자)가 유용한지 보여주고 있어요. 이 상자에서는 시그모이드 함수
1/(1+e^-x)가 계산하는것을 볼 수 있는데, 놀라운 것은 시그모이드 함수의 매개변수를 머신러닝 알고리즘에서 언재, 어디서든지
볼수 있는 점입니다.
▪ 우리가 이진 로지스틱 회귀를 할 때 이 시그모이드 함수를 이진 교차 엔트로피를 구하고자 사용하는데 다른 상황에서도 쓸수
있겠습니다. 설계자로서 이 그래프를 설계하는 과정에서 기초 연산한 요소를 골라 빼내거나 하면서 자유롭게 바꿀수도 있습니다.
다른 예시
45. ▪ 각 노드에 지정된 기초 연산 혹은 여러 노드들이 하나의 연산을 하는 함수로 만들수 있어, 이 함수의 연산으로 로컬 그라디언트
를 쉽게 계산할수도 있습니다. 위에 보시는 그림은 여러 노드들이 하나의 시그모이드 함수 역활을 하는것을 볼수 있어요. 시그모
이드의 그라디언트를 직접 적어가면서 한다면 복잡해져서 정리하기 힘들었겟죠.
다른 예시
46. ▪ 한번 입력이 주어질때 주어진 입력에 대한 시그모이드의 그라디언트를 계산한다고 해볼게요. 그러면 시그모이드의 그라디언트
는 상당히 간단한 함수적 형태를 가지는데, 이 결과 값이 시그모이드 함수 * ( 1 - 시그모이드 함수)로 나오내요. 이것의 의미 하는
건 파란색 상자 전 과정을 사용할 필요없이, 로컬 그라디언트를 쉽게 계산할수 있다는걸 보여주고 있습니다.
다른 예시
47. ▪ 이건 그래프를 설계하는 과정으로 역전파 과정에서 더 효율적으로 기울기를 계산하는지를 보여주는 예시라고 할 수 있을것 같
습니다. 그래서 그래프를 만들때 이 예시 처럼 파란색 상자같은 일부를 하나의 노드로 바꾸어 간단하게 할 수 있는지 고려하여야
해요. 이러면 파란 상자 내부의 연산들을 다 할 필요없이, 이 표현식으로 로컬 그라디언트를 구할수가 있고, 바로 다운스트림 그
라디언트도 구할수 있겠습니다.
▪ 그래서 복잡한 기초 연산들로 한 함수를 정의하는 건, 계산 그래프를 효율적으로 혹은 의미를 가진 것들 끼리 구성되도록 만들
어나가는데 꽤 유용해요.
다른 예시
48. ▪ 여기서 한번 봐야할건 이 계산 그래프를 볼때 여기에 패턴들이 있어요. 어떻게 정보들이 전뱡향으로 흘러가고 역방향으로 흘러
가는지 볼때 명확해지는 것들인데, 이것들이 입력에서 출력까지 정보가 순방향으로 흘러 갈때 작은 회로로 볼수도 있을 겁니다.
그래서 우리는 입력에서 출력까지 순방향 정보와, 총 비용으로부터 역방향 정보들을 가지게 될겁니다.
▪ 우리가 이런 계산 그래프를 그라디언트가 어떻게 흘러가는지, 정보들이 어떻게 압뒤로 흘러가는지에 대한 몇가지 회로 패턴들
로 분석 할수 있겠습니다.
다른 예시
49. ▪ 간단한 회로 중 하나로 에드 게이트, 덧샘 함수가 있습니다. 이 게이트는 그라디언트를 역방향으로 똑같이 보내줍니다. 여기서
는 2개의 입력을 받지만 7개를 받을수도 3개를 받을 수도 있겠죠. 하지만 우리가 맨 처음 계산 그래프를 봤었을때 예제를 생각해
보면 x + y를 x에 대해서 편미분 한 경우 1이 되었죠. 1은 로컬 그라디언트 이니 다운 스트림 그라디언트는 업스트림 그라디언트
와 동일한 값이 됩니다. 이는 더하는 항의 갯수가 다르게 하더라도 합 연산에서는 일반화시킬수 있으며, 즉, 덧셈 노드를 역전파
시킬때 업스트림 그라디언트들이 각 다운스트림 그라디언트로 그대로 배분된다고 볼수 있어요.
다른 예시
50. ▪ 그 다음으로 모델 내부에서 볼수 있는 노드중 한 종류로 카피 노드 copy node가 있습니다. 이 카피 노드는 받은 입력을 그대로
두 출력으로 보내는 간단한 노드입니다. 그래서 이게 뭐하는 건가 싶을수도 있을탠데 왜 계산 그래프에 이런 연산이 있을까요?
여러분들은 우리 모델의 한 항을 여러 다운 스트림에서 쓰고 싶다면 이 연산이 필요합니다.
▪ 예를 들자면 규제 항이 있다고하고, 우리가 가중치 행렬을 2가지 용도로 쓰고 싶다고 해요. 하나는 스코어 계산용과 하나는 다
운스트림 부분에서 가중치 행렬을 L2, L1같은 규제항을 구하기 위해 사용하는 용도루요.
다른 예시
51. ▪ 이 카피 노드를 그래프의 어딘가에 넣어 똑같은 두 가중치 행렬로 만들었습니다. 이 가중치 행렬들은 그러면 그래프의 다른 파
트에서 사용할수 있어요. 그래서 우리가 이 복사한 두 가중치 행렬은 다른 방식으로 사용될 것이고, 결국 다른 그라디언트를 가지
게 될 것 입니다.
▪ 이제 역전파 흐름으로 봅시다. 카피 노드가 받은 업스트림 그라디언트는 순방향으로 동일한 값을 출력하더라도 역방향으로는
다르게 들어 올 수 있어요. 그리고 이들을 에드 게이트 처럼 더하기만 하면 됩니다. 전방향에서 에드 연산했던것과 카피 게이트에
서 역방향 연산이 동일하다고 보면 되겠습니다.
다른 예시
52. ▪ 다른 재미있는 노드로 mul 게이트, 곱셈 게이트가 있습니다. 이건 다음 이유로 스웝 곱셈 연산자라고 할수 있을거같아요. f = x
y가 주어질때 f의 x에 대한 편미분은 y이고 f의 y에 대한 편미분은 x란 것을 알고 있으며 이건 두 입력의 로컬 그라디언트죠. 그래
서 두 번쨰 입력의 로컬 그라디언트 2 는 첫번째 입력 2이다보니 다운 스트림 그라디언트 2 * 5는 업스트림 그라디언트 5와 다른
입력값인 2의 곱인 10이 됩니다.
▪ 이 연산의 영향은 그니까. 우리 모델 내부에서 곱샘 연산에 대해서 생각해본다면 모든 그라디언트들이 섞이게 되요. 곱셈 게이
트를 역방향으로 가다보면 계속 곱할거고 아주 큰 곱샘이 나올 것이고, 어떤 모델에서는 이게 문제가 될수도 있겠습니다.
다른 예시
53. ▪ 이번에 볼 게이트는 멕스 게이트에요. 이 게이트는 스칼라 입력들을 받고, 두 입력 중 최대값을 반환해주는 게이트입니다. ReLu
함수 처럼 생기기도 했죠. 그래서 입력이 최대값이엇던 곳의 (f = x, df/df = 1)로컬 그라디언트는 1이지만, 최대가 아닌 입력의 (f
= 0, df/df = 0)로컬 그라디언트는 0이 됩니다.
▪ 그래서 멕스 게이트의 역전파를 이해해보자면 그라디언트 라우터, 그러니까 방향 기울기의 길안내자? 지시자? 길을 연결해주는
역활을 한다고 생각하면 될거같아요. 그래서 이 그라디언트 라우터로 동작하다보니 업스트림 그라디언트가 두 값들 중 최대값을
입력으로 받는 길로 안내 되다보니 다른 모든 입력들의 다운 스트림 그라디언트들은 0이 됩니다.
다른 예시
54. ▪ 한번 생각해봅시다. 우리가 모델을 가지고 있는데 이 멕스 게이트가 아주 많이 많이 많이 있다고 해요. 그리고 역방향으로 흘러
갑니다. 그러면 대부분의 그라디언트는 0이 될겁니다. 이렇게 되면 전체 모델을 통해 흘러가는 과정에서 좋은 그라디언트를 구해
야 하는데, 문제가 될수 있겠죠. 그래서 이런 이유로 max 게이트 사용을 선호하지는 않습니다.
▪ 아무튼 수학적으로 표현할수 있는 이런 게이트들이 있지만, 우리가 생각해봐야할건 어떻게 이런 스칼라 함수들의 미분 값들이
의미 있는 값을 커다란 신경망 모델을 흘러가면서 구해지는 이 방법으로 가지게 되는지 를 알아야 합니다. 그래서 역전파가 무엇
인지, 어떻게 이 알고리즘이 그라디언트 계산을 자동화하는지를 이해 할 수 있었습니다.
다른 예시