역전파는 신경망의 가장 일반적인 학습 알고리즘입니다. 이를 통해 다층 신경망에서 기울기 하강을 실행할 수 있습니다. Keras와 같은 많은 머신러닝 코드 라이브러리는 역전파를 자동으로 처리하므로 사용자가 기본 계산을 직접 수행할 필요가 없습니다. 다음 동영상을 시청하여 역전파의 작동 방식에 관한 개념적 개요를 알아보세요.
신경망 학습 권장사항
이 섹션에서는 역전파의 실패 사례와 신경망을 정규화하는 가장 일반적인 방법을 설명합니다.
경사 소실
하위 신경망 계층 (입력층에 더 가까운 계층)의 경사는 매우 작아질 수 있습니다. 심층 네트워크 (히든 레이어가 2개 이상인 네트워크)에서 이러한 기울기를 계산하려면 많은 작은 항의 곱을 취해야 할 수 있습니다.
하위 레이어의 경사 값이 0에 가까워지면 경사가 '사라진다'고 합니다. 사라지는 기울기가 있는 레이어는 매우 느리게 학습되거나 전혀 학습되지 않습니다.
ReLU 활성화 함수는 사라지는 기울기를 방지하는 데 도움이 될 수 있습니다.
폭발하는 그라데이션
네트워크의 가중치가 매우 큰 경우 하위 레이어의 기울기에는 많은 큰 항의 곱셈이 포함됩니다. 이 경우 수렴하기에는 너무 커지는 폭발적인 경사가 발생할 수 있습니다.
배치 정규화는 학습률을 낮추는 것처럼 경사 발산을 방지하는 데 도움이 될 수 있습니다.
비활성 ReLU 단위
ReLU 유닛의 가중치 합계가 0 아래로 떨어지면 ReLU 유닛이 중단될 수 있습니다. 0을 출력하여 네트워크의 출력에 아무것도 기여하지 않으며 역전파 중에 더 이상 그라디언트가 이를 통해 흐를 수 없습니다. 기울기 소스가 차단되면 ReLU의 입력이 가중치 합계를 0 위로 다시 가져올 만큼 충분히 변경되지 않을 수 있습니다.
학습률을 낮추면 ReLU 유닛이 죽지 않도록 할 수 있습니다.
드롭아웃 정규화
드롭아웃 정규화라는 또 다른 정규화 형태는 신경망에 유용합니다. 드롭아웃은 단일 경사 단계에 대해 네트워크에서 유닛 활성화를 무작위로 '드롭아웃'하는 방식으로 작동합니다. 드롭아웃이 많을수록 정규화가 강력해집니다.
[null,null,["최종 업데이트: 2024-11-08(UTC)"],[[["\u003cp\u003eBackpropagation is the primary training algorithm for neural networks, enabling gradient descent for multi-layer networks and often handled automatically by machine learning libraries.\u003c/p\u003e\n"],["\u003cp\u003eVanishing gradients occur when gradients in lower layers become very small, hindering their training, and can be mitigated by using ReLU activation function.\u003c/p\u003e\n"],["\u003cp\u003eExploding gradients happen when large weights cause excessively large gradients, disrupting convergence, and can be addressed with batch normalization or lowering the learning rate.\u003c/p\u003e\n"],["\u003cp\u003eDead ReLU units emerge when a ReLU unit's output gets stuck at 0, halting gradient flow, and can be avoided by lowering the learning rate or using ReLU variants like LeakyReLU.\u003c/p\u003e\n"],["\u003cp\u003eDropout regularization is a technique to prevent overfitting by randomly dropping unit activations during training, with higher dropout rates indicating stronger regularization.\u003c/p\u003e\n"]]],[],null,["[**Backpropagation**](/machine-learning/glossary#backpropagation) is the\nmost common training algorithm for neural networks.\nIt makes gradient descent feasible for multi-layer neural networks.\nMany machine learning code libraries (such as [Keras](https://keras.io/))\nhandle backpropagation automatically, so you don't need to perform any of\nthe underlying calculations yourself. Check out the following video for a\nconceptual overview of how backpropagation works: \n| To learn more about building image models, check out the [Image\n| Classification](/machine-learning/practica/image-classification) course.\n\nBest practices for neural network training\n\nThis section explains backpropagation's failure cases and the most\ncommon way to regularize a neural network.\n| **NOTE:** The backpropagation training algorithm makes use of the calculus concept of a [gradient](https://wikipedia.org/wiki/Gradient) to adjust model weights to minimize loss. Understanding and debugging the issues below usually requires some background in calculus.\n\nVanishing Gradients\n\nThe [**gradients**](/machine-learning/glossary#gradient) for the lower neural\nnetwork layers (those closer to the input layer) can become very small.\nIn [**deep networks**](/machine-learning/glossary#deep-model) (networks with\nmore than one hidden layer), computing these gradients can involve taking the\nproduct of many small terms.\n\nWhen the gradient values approach 0 for the lower layers, the gradients are\nsaid to \"vanish\". Layers with vanishing gradients train very slowly, or not\nat all.\n\nThe ReLU activation function can help prevent vanishing gradients.\n\nExploding Gradients\n\nIf the weights in a network are very large, then the gradients for the lower\nlayers involve products of many large terms. In this case you can have\nexploding gradients: gradients that get too large to converge.\n\nBatch normalization can help prevent exploding gradients, as can lowering the\nlearning rate.\n\nDead ReLU Units\n\nOnce the weighted sum for a ReLU unit falls below 0, the ReLU unit can get\nstuck. It outputs 0, contributing nothing to the network's output,\nand gradients can no longer flow through it during backpropagation. With a\nsource of gradients cut off, the input to the ReLU may not ever change enough\nto bring the weighted sum back above 0.\n\nLowering the learning rate can help keep ReLU units from dying.\n| There are also many variants of ReLU that were designed to address this specific problem, such as [LeakyReLU](https://keras.io/api/layers/activation_layers/leaky_relu/), which you may want to consider using as an activation function to prevent dead ReLU units.\n\nDropout Regularization\n\nYet another form of regularization, called\n[**dropout regularization**](/machine-learning/glossary#dropout_regularization),\nis useful for neural networks. It works by randomly \"dropping out\"\nunit activations in a network for a single gradient step.\nThe more you drop out, the stronger the regularization:\n\n- 0.0 = No dropout regularization.\n- 1.0 = Drop out all nodes. The model learns nothing.\n- Values between 0.0 and 1.0 = More useful.\n\n| **Key terms:**\n|\n| - [Backpropagation](/machine-learning/glossary#backpropagation)\n| - [Dropout regularization](/machine-learning/glossary#dropout_regularization)\n| - [Exploding gradient problem](/machine-learning/glossary#exploding-gradient-problem)\n- [Vanishing gradient problem](/machine-learning/glossary#vanishing-gradient-problem) \n[Help Center](https://support.google.com/machinelearningeducation)"]]