Gradient
HugoRodriguesQW opened this issue · comments
Gradients
Gradient, specifically gradient descent, is an optimization algorithm used to adjust neural network weights during training. The objective of the training is to minimize a loss function, which measures the difference between the outputs programmed by the network and the actual outputs of the training set. The gradient is derived from the loss function with respect to the network weights, and it points in the direction in which the loss function is serviced most quickly.
In the training process, the gradient is calculated in relation to the network weights and used to update these weights in order to minimize the loss function. The gradient determines the magnitude and direction of updating the weights in each training iteration. This allows the network to adjust to the training data and learn to perform a specific task for the quality being trained.
-by chatGPT
Gradient Descent (GD) and Stochastic Gradient Descent:
![opt_comparison](https://private-user-images.githubusercontent.com/71078903/255192526-77772c2a-b605-45ed-b8b5-50fa077c195c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMDAwNTUsIm5iZiI6MTcyMzk5OTc1NSwicGF0aCI6Ii83MTA3ODkwMy8yNTUxOTI1MjYtNzc3NzJjMmEtYjYwNS00NWVkLWI4YjUtNTBmYTA3N2MxOTVjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE2NDkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZlOTI5N2ZmMDI1NTA0OTlmMmQxZjVkNWY5NTIzMmM4ZDNjMmNlYzFhY2EyNmVhZDc2YzIxZmNkYzFlZGEzMTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.tqmeQJ0FIExt0coPiE-SdqPg3gkgm27kyV-iN4J03dc)
Mini-batch
![opt_part](https://private-user-images.githubusercontent.com/71078903/255194106-50d487f1-99db-4676-8d7e-d6a27c7276e4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMDAwNTUsIm5iZiI6MTcyMzk5OTc1NSwicGF0aCI6Ii83MTA3ODkwMy8yNTUxOTQxMDYtNTBkNDg3ZjEtOTlkYi00Njc2LThkN2UtZDZhMjdjNzI3NmU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE2NDkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRkMGZkNmI3YjdmYWZlMTA0OGExODI5NGE4NTRlZjk3ZWU4ZGNjNzJhZDkwOTI1ZTBkY2MyZjMxZDY3YWQ2ZmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.33hMRLsQqVVPrZqtodnARezlE2QbVSjrZMwnqjSLkm4)
Momentum
![opt_momentum](https://private-user-images.githubusercontent.com/71078903/255194242-807a261f-e179-4893-a0f7-f402aa4329eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMDAwNTUsIm5iZiI6MTcyMzk5OTc1NSwicGF0aCI6Ii83MTA3ODkwMy8yNTUxOTQyNDItODA3YTI2MWYtZTE3OS00ODkzLWEwZjctZjQwMmFhNDMyOWViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE2NDkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg3NGVmMmNkMDg0YjIyOTBjMWMzN2UwZGYzZDQwNzRkNWVhNjg0YmIyMTE5NzBiZTI4MjBhM2JkZDM2MjdlMmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.C2gPHaPz5I3lyF846SvAR1rLtrSSsyxjBsrl9ESni9Y)
Adam
![opt_momentum](https://private-user-images.githubusercontent.com/71078903/255195544-7e479d26-088f-4325-8b44-68b0e4da1bd7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMDAwNTUsIm5iZiI6MTcyMzk5OTc1NSwicGF0aCI6Ii83MTA3ODkwMy8yNTUxOTU1NDQtN2U0NzlkMjYtMDg4Zi00MzI1LThiNDQtNjhiMGU0ZGExYmQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE2NDkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM3NzAxNDhiNDJjYzg4ODVmODliMjBjYjAzNzI1OTZkMGY3YTg5MzMxOWUwMGNmYWZmZDUzN2ZiMWM0ZDU4YWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.z2tHnFOthyGYZpsOM-twz2ywdgQNgMsOvN6_xFr4_WM)
RMSprop
![opt_momentum](https://private-user-images.githubusercontent.com/71078903/255196295-428be065-7339-410e-b26b-e01f23b3ea13.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMDAwNTUsIm5iZiI6MTcyMzk5OTc1NSwicGF0aCI6Ii83MTA3ODkwMy8yNTUxOTYyOTUtNDI4YmUwNjUtNzMzOS00MTBlLWIyNmItZTAxZjIzYjNlYTEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE2NDkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5YWQwODA5MmQxNTVmMTU1MGQ1N2JiZTM0NGM2ODRlNDgwZjBmYzJjN2VmYzEzMGUyZmViZWM1MzI5ZDNiM2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hH_dtKAgn6Y-NBF5CHX7rhcp_EP8ZiZ2BJ2-TCDhGFU)