2022.12.13 - [implement_ml_models/RNN] - implement_GRU(z)
implement_GRU(z)
GRU 는 LSTM 과 비슷한 원리로 작동, 간소화된 방식으로 계산이 간편하다는 장점, 이전 시점에서 받는 벡터가 h 로 하나이다. 또한 하나의 벡터 z 가 삭제, 입력 게이트를 모두 제어한다. 출력 게이
teach-meaning.tistory.com
def cal_g(self, t, input_x, output):
activation = Activation()
w_xg = np.random.rand(output.shape[0], input_x.shape[0])
w_hg = np.random.rand(output.shape[0], output.shape[1])
b_g = np.random.rand(output.shape[0],1)
self.w_xr.append(w_xg)
self.w_hr.append(w_hg)
self.b_r.append(b_g)
r = w_xg + w_hg @ (self.r * self.hidden_unit[t])
self.r.append(r)
return r
'implement_ml_models > RNN' 카테고리의 다른 글
implement_RNN (0) | 2023.02.21 |
---|---|
implement_GRU(h) (0) | 2022.12.13 |
implement_GRU(r) (0) | 2022.12.13 |
implement_GRU(z) (0) | 2022.12.13 |
implement_LSTM(hidden_unit_output) (0) | 2022.12.13 |