일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- kernel density estimation
- Til
- forward
- Chrome Remote Desktop
- ubuntu
- nn.Sequential
- 크롬 원격 데스크톱
- band_part
- 네이버 부스트캠프
- error
- kde
- GRU
- LSTM
- ai tech
- pytorch
- Linux
- tensorflow
- triu
- tril
- RNN
- Today
- Total
목록COMPUTER/Deep Learning (2)
무슨 생각을 해 그냥 하는거지
기초적인 얘기지만 혹시나 나중에 까먹을까봐 + 나처럼 답답해 하고 있는 분이 계실까봐 기록한다. 분명 forward 때 인풋을 두 개 줬는데 자꾸 에러가 발생했다. *** TypeError: forward() takes 2 positional arguments but 3 were given 다른 부분은 이상이 없어보였는데, 찾아보니 nn.Sequential이 문제였다. nn.Sequential로 선언한 레이어는 forward 때 인풋을 하나만 넣어줄 수 있다. (나는 Encoder Layer를 nn.Sequential 안에 여러 개 넣어놨는데 Encoder layer의 forward가 2개의 인자를 받아야 했다.) 예를 들어.. 어떤 모델 클래스 __init__ 함수에서 이렇게 선언했다면 self.enc..
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/0B2Do/btrs6aOH1d6/OgGAVFVDyFQ0HweEUnKn3k/img.png)
공식 문서: https://www.tensorflow.org/api_docs/python/tf/linalg/band_part tf.linalg.band_part | TensorFlow Core v2.8.0 Copy a tensor setting everything outside a central band in each innermost matrix to zero. www.tensorflow.org tensorflow.linalg.band_part(input, num_lower, num_upper, name=None) input: A Tensor. Rank k tensor num_lower: A Tensor. 보존할 subdiagonals의 수. 음수면 모든 lower triangle을 보존함 num_up..