728x90

https://velog.io/@cha-suyeon/%ED%98%BC%EA%B3%B5%EB%A8%B8-%EB%B0%B0%EC%B9%98%EC%99%80-%EB%AF%B8%EB%8B%88-%EB%B0%B0%EC%B9%98-%ED%99%95%EB%A5%A0%EC%A0%81-%EA%B2%BD%EC%82%AC%ED%95%98%EA%B0%95%EB%B2%95
 

[혼공머] 배치와 미니 배치, 확률적 경사하강법

👩‍🔬 이번에는 혼공머 책의 챕터 4-2 파트입니다.📚 혼자공부하는머신러닝+딥러닝, 한빛미디어📄 Gradient Descent - 경사하강법, 편미분, Local Minimum📑 경사하강법(Gradient Descent)🔗 배치와 미니

velog.io

 
- batch: 일괄적으로 처리되는 집단, 한 번에 여러 개의 데이터를 묶어서 입력하는 방식, 1 epoch당 사용되는 training dataset의 묶음
- epoch: 훈련 세트를 한 번 모두 사용하는 과정
 
일반적으로 우리가 말하는 SGD = mini-BGD를 일컬음
 
- SGD와 BGD의 절충안: Batch 보다 빠르고 SGD 보다 낮은 오차율을 가짐
- batch size: 하나의 mini batch에 들어가는 데이터 수 (prefer: 전체 데이터가 나눠떨어지는 값, 2^n)
- 1 epoch : 여러 개의 mini batch가 for문으로 돌고 돌아 전체 훈련 세트를 한 번 모두 사용하는 과정
 
 
https://welcome-to-dewy-world.tistory.com/86

16. 배치(Batch), 미니배치 학습, 에폭(Epoch), SGD

앞서 신경망을 구성하기 위해서 활성화 함수, 가중치 등이 필요하다는 것을 설명했다. 위의 그림은 인공 신경망이다. 왼쪽의 그림은 은닉층이 1개이고 오른쪽 그림은 은닉층이 3개이다. 위의 선

welcome-to-dewy-world.tistory.com

그리고 필자는 처음에 미니배치를 공부할 때 수만건의 데이터 중에서 n개만큼의 데이터를 임의로 추출하기 때문에 당연히 복원 추출이라고 생각했는데 (왜냐하면 데이터 개수가 매우 많으면서 데이터 전체를 표현해야하기 때문에), Epoch의 개념에서는 전체 데이터셋을 사용해야 1Epoch가 된다는 것을 읽으며 골머리를 앓았다.
배치, 혹은 미니배치학습을 할 때 배치는 복원 추출인가? 비복원 추출인가?
 
이에 대한 해답을 정확히 알 수는 없었으나, 어쨌든 복원 추출이나 비복원 추출이나 사실상 크게 다르지 않다는게 결론이다. 이에 대한 이유는 데이터가 매우 많기 때문이다. 수많은 데이터 중에서 임의의 개수로 임의의 데이터를 추출하는 것을 n번 반복하면 사실상 비복원 추출이나 복원 추출이나 전체 데이터셋을 사용한다고 볼 수 있기 때문이다.
 
https://light-tree.tistory.com/133

딥러닝 용어정리, MGD(Mini-batch gradient descent), SGD(stochastic gradient descent)의 차이

제가 공부한 내용을 정리한 글입니다. 제가 나중에 다시 볼려고 작성한 글이다보니 편의상 반말로 작성했습니다. 잘못된 내용이 있다면 지적 부탁드립니다. 감사합니다. MGD(Mini-batch gradient descent

light-tree.tistory.com

'batch' 라는 단어는 엄밀히 'mini-batch'를 의미하지면 편의상 batch 와 혼용해서 사용하는 것.
처음엔 '한 개의 데이터마다 한 개의 기울기를 구할 수 있는데, 어떻게 전체 데이터 셋에 대해서 기울기를 한번만 구한다는 것인가?' 라는 의문을 가지며 BGD를 잘못 이해하고 있었다.
 
Gradient descent 라는 알고리즘 자체는 loss function 을 입력 데이터 x 에 대해 편미분해서 기울기를 계산하는 것이 아닌, 가중치 w 에 대해서 편미분을 하는 것이기 때문에, 기울기를 계산하는 것 자체는 입력 데이터 x 의 갯수와 상관이 없다.
 
에러값을 전체 데이터에 대한 loss function 의 합으로 정의하던 평균으로 정의하던 단순히 w 에 대한 편미분을 수행하면 되는 것.
 

 

wow 이 그림 미쳤다 ~~~~ >,<

출처: https://light-tree.tistory.com/133 [All about:티스토리]
 
 


https://ratsgo.github.io/deep%20learning/2017/10/02/softmax/

Softmax-with-Loss 계층 · ratsgo's blog

이번 글에서는 소프트맥스 함수와 크로스엔트로피 손실함수가 합쳐진 ‘Softmax-with-Loss’ 계층에 대해 살펴보도록 하겠습니다. 이 글은 위키피디아와 ‘밑바닥부터 시작하는 딥러닝’, 그리고

ratsgo.github.io

Backprop의 모든 것...🤩
 

728x90

'AI > Data Science' 카테고리의 다른 글

[모델성능지표] Precision, Recall, MAP  (0) 2023.12.10
[DL] BACKPROP  (0) 2023.12.02
[Statistics] 다변량 정규분포  (0) 2023.11.13
[statistics] Variational Inference (변분추론)  (0) 2023.11.09
[Statistics] Gaussian Prior  (1) 2023.11.08

728x90

- Priors are a key component of Bayesian modelling. 

prior posterior
Prior is a belief you have on some quantity, typically on a set of parameters, without having any 
look at the data
If data is involved, the belief you have is updated 
and is called as posterior.


The Gaussian prior on the coefficients

→  coefficients are assumed to be distributed according to Gaussian/Normal distribution.

 

!= Gaussian prior over the error terms

→  Those are two different assumptions with very different effects

 

https://stats.stackexchange.com/questions/476706/what-does-it-mean-to-have-a-gaussian-prior

 

What does it mean to have a "gaussian prior?"

When reading up on ridge regression, I saw it stated that it has a "gaussian prior." I realized that I don't know what the word prior means in this context and what it is applied to? I sh...

stats.stackexchange.com

 

728x90

728x90

https://math.stackexchange.com/questions/4748117/what-does-nonlinear-mapping-phix-mean-is-it-a-vector-or-matrix

 

What does nonlinear mapping $\Phi(x)$ mean? Is it a vector or matrix?

I'm reading a paper about image classification. According to the paper, it says For a given nonlinear mapping $\Phi (x)$, the input data space $\mathbb{R}^{n}$ can be mapped into the feature space ...

math.stackexchange.com

For a given nonlinear mapping Φ(𝑥), the input data space 𝑛 can be mapped into the Feature space

Φ : ℝ𝑛 ↦ Feature space
𝑥 ↦ Φ(𝑥)

 

The feature map is an arbitrary map into the feature space 𝐻.

For example, if 𝐻 is finite dimensional (say, of dimension 𝑚), you can pick an orthonormal basis for it,

and think of each component of Φ in that basis as a feature. This is what scalar features are. 


Inner product space

 


orthonormal basis 

In mathematics, particularly linear algebra, an orthonormal basis for an inner product space V with finite dimension is a basis for V whose vectors are orthonormal, that is, they are all unit vectors and orthogonal to each other.

 

For example, the standard basis(표준기저) for a Euclidean space R" is an orthonormal basis, where the relevant inner product is the dot product of vectors. The image(공역) of the standard basis under a rotation or reflection (or any orthogonal transformation) is also orthonormal(=standard basis를 가지고 rotation과 같은 orthogonal transformation을 하면 그 transformed vector들도 orthonormal이다), and every orthonormal basis for R" arises in this fashion.

 

*standard basis: 유클리드 공간에서 직교 좌표계의 축을 향하는 단위 벡터의 집합

Every vector a in three dimensions is a linear combination of the standard basis vectors i, j and k.

standard basis i, j, k or R3

 

* basis: 벡터 공간을 선형생성하는 선형독립인 벡터들이다. 달리 말해, 벡터 공간의 임의의 벡터에게 선형결합으로서 유일한 표현을 부여하는 벡터들


For a general inner product space V, an orthonormal basis can be used to define normalized orthogonal coordinates on V. Under these coordinates, the inner product becomes a dot product of vectors. (The inner product는 dot product의 일반화된 버전 to abstract vector spaces over a field of scalars, being either the field of real numbers or the field of complex numbers)

 

orthogonal (직교) orthonormal
Two vectors are said to be orthogonal if their dot product is zero
Orthogonal vectors are perpendicular to each other
1) not only orthogonal
2) also, unit length 

 

 

Reference

https://en.wikipedia.org/wiki/Standard_basis

https://ko.wikipedia.org/wiki/%EA%B8%B0%EC%A0%80_(%EC%84%A0%ED%98%95%EB%8C%80%EC%88%98%ED%95%99)

https://www.collimator.ai/reference-guides/what-is-orthogonal-vs-orthonormal

https://en.wikipedia.org/wiki/Inner_product_space

 

728x90

+ Recent posts