일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- 병합
- Kernighan의 C언어 프로그래밍
- 코드로배우는스프링부트웹프로젝트
- 스프링 시큐리티
- 선형대수
- 처음 만나는 AI수학 with Python
- GIT
- 깃
- 친절한SQL튜닝
- 자료구조와 함께 배우는 알고리즘 입문
- 알파회계
- merge
- 자료구조와함께배우는알고리즘입문
- iterator
- 자바편
- 목록처리
- /etc/network/interfaces
- 처음 만나는 AI 수학 with Python
- 리눅스
- resttemplate
- network configuration
- 이터레이터
- 서버설정
- 스프링부트핵심가이드
- 코드로배우는스프링웹프로젝트
- 페이징
- 구멍가게코딩단
- 티스토리 쿠키 삭제
- 네트워크 설정
- 데비안
- Today
- Total
목록Math (35)
bright jazz music
행렬의 요소별 곱 (아다마르 곱) 행렬의 요소별 곱은 행렬의 각 요소끼리 곱하는 것이다. 아다마르 곱(Hadamard product)이라고도 불린다. ○ 또는 ⊙로 표기한다. 두 행렬 A와 B가 아래와 같을 때 LaTeX 수식 $ \begin{align} A &=\begin{pmatrix} a_{11}&a_{12}&\cdots & a_{1n}\\ a_{21}&a_{22}&\cdots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots \\ a_{m1}&a_{m2}&\cdots & a_{mn} \end{pmatrix} \end{align}$ $ \begin{align} B &=\begin{pmatrix} b_{11} & b_{12}&\cdots & b_{1n}\\ b_{21}&..
놈 (노름, norm) 놈은 벡터의 크기(magnitude)를 나타내는 양이다. 인공지능에서는 L² 놈과 L¹ 이 자주 쓰인다. 놈의 종류에 따라 벡터의 크기(magnitude)는 다른 값이 된다. 놈은 인공지능의 정칙화에 쓰인다. 정칙화란 파라미터로 조절해서 필요 이상으로 네트워크 학습이 진행되는 것을 예방하는 것이다. L² 놈 L² 놈은 아래와 같이 표기한다. L² 놈의 표기 L² 놈은 벡터의 각 요소(스칼라)를 제곱합 한 뒤, 제곱근을 구해 계산한다. LaTeX 수식 $\begin{align} ||\vec{x}||_{2} &= \sqrt{x_{1}^2 + x_{2}^2 + \cdots + x_{n}^2}\\ &= \sqrt{\sum_{k=1}^n x_{k}^2} \end{align}$ L¹ 놈 L¹..
내적(스칼라 곱, dot product, scarla product) 내적은 벡터 사이의 곱의 한 종류이다. 각 요소(scarla)끼리 곱한 값을 총합한다. 여기서 스칼라는 크기만 있고 방향은 가지지 않는 양이다. 즉, 방향이 있는 두 개의 벡터 값의 스칼라를 계산하는 것을 뜻한다. 주로 두 벡터 간의 각도를 구하기 위해 사용된다 내적은 두 개 벡터의 상관관계를 구할 때 빈번히 사용한다. $\vec{a}=(a_{1}, a_{2}, \cdots , a_{n})$ $\vec{b}=(b_{1}, b_{2}, \cdots , b_{n})$ 위 두 벡터를 내적한다. 내적 $\begin{align} \vec{a}\cdot\vec{b} &= (a_{1}, a_{2}, \cdots , a_{n})\cdot(b_{1},..
텐서(Tensor) 텐서는 스칼라를 여러 개의 차원으로 나월한 것이다. 텐서는 스칼라, 벡터, 행렬을 포함한다. 스칼라, 벡터, 행렬은 서로 다른 차원의 텐서이다. 각 요소에 붙은 첨자 수를 그 텐서의 차원수라고 말한다. 스칼라에는 첨자가 붙지 않는다. 따라서 스칼라는 0차원 텐서이다. 벡터에는 첨자가 1개 붙는다. 따라서 벡터는 1차원 텐서이다. 행렬은 첨자가 2개 붙는다. 따라서 행렬은 2차원 텐서이다. 3차원 텐서, 4차원 텐서 순으로 고차원으로 나아간다. 파이썬에서의 텐서 구현 import numpy as np a = np.array([[[0, 1, 2, 3], [2, 3, 4, 5], [4, 5, 6, 7]], [[1, 2, 3, 4], [3, 4, 5, 6], [5, 6, 7, 8]]]) #2..
행렬 행렬은 스칼라를 격자로 나열한 것이다. 행렬에서 수평 방향의 스칼라의 나열을 행이라고 한다. 수직 방향의 스칼라의 나열을 열이라고 한다. 행렬의 예 아래 행렬은 3행4열 행렬이다. 3x4 행렬이라고 표기하는 것이 일반적이다. 행은 위에서부터 아래로 1행, 2행, 3행 순으로 센다. 열은 왼쪽부터 오른쪽으로 1열, 2열, 3열 순으로 센다. 위 행에서 2행2열의 수치는 -0.25이다. *주의: 파이썬을 비롯한 대부분의 프로그래밍 언어에서 행렬은 0부터 센다. 즉 위의 행렬은 1,2,3행, 1,2,3,4열의 행렬이 아니라 0,1,2행, 0,1,2,3열의 3행4열 행렬이 되는 것이다. 위의 행렬을 예를 들면, 수학에서는 -0.25가 2행2열의 수치이지만, 파이썬에서는 1행1열의 수치가 된다. 벡터와 행렬..
스칼라의 개념 스칼라(scarla)는 1, 5, 2, -7 등의 보통의 수치를 의미한다. 수식에서의 알파벳 또는 그리스 소문자로 스칼라를 나타내기도 한다. 파이썬에서의 스칼라 구현 a = 1 b = 1.2 c = -0.25 d = 1.2e5 #1.2 * (10의 5제곱 = 120000) ----- 벡터의 개념 벡터는 스칼라를 직선 상에 나열한 것이다. 알파벳 소문자 위에 화살표를 올린 것으로 벡터를 표현하기도 한다. 가로벡터와 세로벡터 벡터에는 세로로 수치를 나열하는 세로 벡터와 가로로 수치를 나열하는 가로 벡터가 있다. 가로벡터(horizontal vector, row vector) 가로 벡터 LaTeX 표기 수식 변환 $\vec{a} = (1, 2, 3)$ 세로벡터(vertical vector, co..
선형대수 선형대수는 다차원 구조를 가진 수치의 나열을 다루는 수학의 분야 중 한 가지이다. 다차원 구조에는 아래와 같은 종류가 있다. 스칼라 벡터 행렬 텐서 인공지능에서는 방대한 수치를 다뤄야 하는데 선형대수를 이용하면 방대한 수치에 대한 처리를 간결한 수식으로 나타낼 수 있다.
주피터 노트북 사이트 접근 https://jupyter.org/ Project Jupyter The Jupyter Notebook is a web-based interactive computing platform. The notebook combines live code, equations, narrative text, visualizations, interactive dashboards and other media. jupyter.org 참고 Code로 되어 있으면 Cell 옆에 " [ ]: " 표시가 존재한다. Markdown으로 변경했을 경우 " [ ] : " 표시가 사라진다. 셀타입 변경 수식 입력 및 변환 이처럼 $를 하나만 사용하는 방식은 수식을 문장과 함께 사용할 때 유용하다. 수식 가운데 ..
절댓값 절댓값은 값과 0사이의 거리를 나타낸다. 절댓값은 값의 양, 음을 무시하고 얻을 수 있는 음이 아닌 값을 말한다. 음수의 절댓값은 그 값에서 음의 부호를 뺀 것이다. 양수의 절댓값은 그 값 그대로이다. 인공지능에서 0을 중심으로 한 값의 퍼짐 상태를 파악하기 위해 사용되는 경우가 존재한다. |x| = -x (x
난수 난수는 규칙성이 없는 미확정의 수치이다. 인공지능에서는 파라미터의 초기화 등에 난수가 활용된다. 정수 난수 생성 파이썬에서는NumPy의 random.randint()함수를 사용하여 정수인 난수를 생성한다. 함수에 정수 a를 인수로 입력하면 0부터 a-1 까지의 정수를 난수로 반환한다. #정수인 난수 출력 import numpy as np import matplotlib.pyplot as plt r_int = np.random.randint(6) + 1 #0부터 5까지의 난수에 1을 더한다. print("np.random.randint(6) + 1 = ", r_int) #1부터 6까지가 랜덤으로 표시됨 #3 #1~6사이에서 랜덤으로 출력됨 소수 난수 생성 소수인 난수는 Numpy의 random.ran..