250x250
반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- airflow subdag
- API
- UDF
- XAI
- Retry
- API Gateway
- GenericGBQException
- TensorFlow
- hadoop
- 상관관계
- subdag
- integrated gradient
- gather_nd
- youtube data
- Airflow
- GCP
- 유튜브 API
- requests
- spark udf
- tensorflow text
- login crawling
- BigQuery
- Counterfactual Explanations
- flask
- correlation
- 공분산
- chatGPT
- top_k
- session 유지
- grad-cam
Archives
- Today
- Total
데이터과학 삼학년
Element wise product(Hadamard product) VS Matrix multiplication 본문
반응형
Element wise product or Hadamard product (아다마르 곱)
각 행렬의 원소끼리만 곱한 것을 의미한다.
일반 행렬곱은 m x n과 n x p의 꼴의 두 행렬을 곱하지만, 아다마르 곱은 m x n과 m x n의 꼴의 두 행렬을 곱한다.
import numpy as np
a = np.array([[1,2],[3,4]])
b = np.array([[5,6],[7,8]])
np.dot(a,b) ## np.dot 행렬곱 연산
===================
array([[19, 22],
[43, 50]])
np.matmul(a,b) ## np.dot 행렬곱 연산(matrix multiplication)
===================
array([[19, 22],
[43, 50]])
import tensorflow as tf
tf.math.multiply(
x, y, name=None
)
Matrix multiplication (행렬 곱셉)
일반적인 행렬곱셈을 의미한다.
import numpy as np
a = np.array([[1,2],[3,4]])
b = np.array([[5,6],[7,8]])
a*b ## element wise product , Hadamard product (아다마르 곱)
====================
array([[ 5, 12],
[21, 32]])
import tensorflow as tf
tf.tensordot(
a, b, axes, name=None
)
728x90
반응형
LIST
'Mathematics' 카테고리의 다른 글
SVD (Singular Value Decomposition) 특이값 분해 (0) | 2020.05.21 |
---|---|
Eigenvalue(고유값), Eigenvector(고유벡터) (0) | 2020.05.06 |
Comments