개발
-
[논문] Attention Is All You Need, 2017개발/머신러닝-딥러닝 2022. 6. 13. 23:22
제가 이해한 내용을 정리한 글입니다. 오류가 있으면 고쳐주세요! 앞서 소개했던 BERT의 근본이 되는 방법인 Transformer를 소개하는 논문이다. 트랜스포머 계열은 자연어 처리 뿐만 아니라 여러 데이터에서 사용되는데, Vision 분야의 ViT, 시계열 분석의 TFT 등이 있다. 논문 배경 RNN계열의 모델은 시퀀스 모델링이나, 언어모델, 기계번역과 같은 분야에서 SOTA를 달성해왔다. 그러나 RNN 모델은 hidden states에서는 $h_t$를 계산하기 위해서 $h_{t-1}$이 반드시 필요한 재귀형(혹은 순차적) 모델이므로 병렬화할수 없었다. 이로 인해 메모리 제약이 걸리고, 학습과정에서 batch에 제한이 생겨 긴 시퀀스를 학습하는 것이 힘들었다. 어텐션 구조는 입출력 시퀀스의 거리에 상관..
-
[논문] BERT, 2018개발/머신러닝-딥러닝 2022. 6. 9. 17:49
제가 이해한 내용을 정리한 글입니다. 오류가 있으면 고쳐주세요! BERT, Bidrectional Encoder Representations from Transformers 최근 자연어 처리 분야에서 빠질 수 없는 이름이다. 트랜스포머 계열 중 인코더에 집중한 모델이며, 이를 베이스로 다양한 BERT모델이 만들어졌다. 논문은 여기 배경 사전학습 모델은 자연어 처리 분야에서 굉장히 효과적이다. 현재 사전학습 모델은 크게 2가지가 있는데, ELMo와 같이 특정 Task를 중심으로 사전 학습된 표현식을 추가적으로 사용하는 feature-based모델과 GPT와 같이 Task관련 파라미터를 최소화하고 사전학습된 파라미터를 fine-tuning하는 모델이 있다. 그러나 위 두 예시는 Unidirectional구조..
-
[논문] - A Hierarchical Latent Vector Model for Learning Long-Term Structure in Music, 2018개발/머신러닝-딥러닝 2022. 6. 8. 00:06
제가 이해한 내용을 정리한 글입니다. 오류가 있으면 고쳐주세요! 2018년에 Google Magenta에서 제안한 MusicVAE 모델이다. 논문 배경 음악 분야에서 VAE는 자주 사용되지 않는데, 음악과 같은 시퀀스 데이터에서는 autoregressive decoder를 사용하게되고, 이는 autoencoder에서 인코딩한 latent vector를 무시할 정도로 강력한 방법이기 때문에 인코딩된 특징들을 충분히 활용할 수 없다. 작은 시퀀스에서는 활용 가능 하지만 대부분의 음악 데이터는 길이가 긴 시퀀스를 가지므로 적용하기 힘들다. 이러한 이슈를 해결하기 위해서 계층적 recurrent decoder를 적용한 recurrent VAE 모델을 만들었다. 전체 시퀀스를 하나의 latent vector로 만..
-
[프로젝트] 약 추천 서비스개발/프로젝트 2022. 6. 3. 12:29
GitHub - LJBang/Drug_Recommendation: 자연어 처리를 통한 약물 추천 챗봇 자연어 처리를 통한 약물 추천 챗봇. Contribute to LJBang/Drug_Recommendation development by creating an account on GitHub. github.com 개요 UCI에서 제공하는 약과 그 리뷰에 대한 데이터셋을 기반으로 사용자가 증상을 입력하면 적절한 약을 추천해주는 프로젝트 적합한 약을 추천해주기 위해서 영어로 된 리뷰 데이터를 학습하여 condition을 분류하는 모델을 만들고, 해당하는 condition에서 rating의 평균이 가장 높은 약들을 추천한다. 서비스의 형태는 안드로이드를 이용한 챗봇이며, condition예측과 약 추천을 위한..
-
[DACON] 한국어 문장 관계 분류 w/KoBART개발/머신러닝-딥러닝 2022. 6. 2. 11:31
DACON 대회 한국어 문장 관계 분류 경진대회 - DACON 좋아요는 1분 내에 한 번만 클릭 할 수 있습니다. dacon.io KoBART를 이용한 한국어문장 학습을 공부하다가 실습하면서 해보면 좋을 것 같아서 선정했다. 코드공유란의 아래 코드를 참고해서 작성했다 Hugging Face를 활용한 Modeling(public: 0.841) 한국어 문장 관계 분류 경진대회 dacon.io 0. 목표 문장1과 문장2의 관계에 대해서 정확하게 분류하는 것. Label은 참, 거짓, 중립이 있다. 1. 데이터 확인 Train_set에는 문장 두 개와 label이 있으며, Test_set에는 문장 두개가 있다. Train_set에는 약 25000개의 데이터가 존재한다. 2. 데이터 처리 데이터에서 한글과 숫자만..
-
[운영체제] 스레드개발/OS 2022. 4. 12. 23:31
스레드 프로세스의 실행 단위라 할 수 있다. 스레드는 생성시 스택영역만 독립적으로 할당받고, 나머지는 프로세스의 것을 공유한다. 스택은 함수의 인자, 지역변수, 리턴 값 등을 저장하는 메모리 공간이므로 스택을 독립적으로 할당하여 스레드별로 독립적인 함수 호출 및 실행이 가능하다. 또한 각 스레드는 스케쥴러에 의해서 실행과 대기가 반복되는데, 다시 시작될 때 실행할 지점을 찾기 위해서 PC가 독립적으로 할당된다. 멀티 스레드 장점 하나의 프로세스 안에서 여러 작업을 동시에 처리할 수 있기 때문에, 시간과 자원적으로 이득 스레드끼리 메모리공간(코드, 데이터, 힙 등)을 공유하기 때문에, 데이터의 교환이 쉽다. context switch시 캐시 메모리를 초기화 해줄 필요가 없기 때문에, 프로세스의 것보다 빠르..
-
[운영체제] 프로세스개발/OS 2022. 4. 11. 00:30
프로세스 실행중인 상태의 프로그램을 프로세스라 한다. 프로세스는 각각 독립된 주소공간을 할당받으며 각 메모리는 정해진 영역을 가지고 있다. 코드 - 코드 자체를 구성하는 영역 데이터 - 전역 변수, 정적 변수, 배열 등을 저장하는 영역 스택: 지역변수, 매개변수, 리턴값을 저장하는 영역 힙: malloc이나 new와 같이 메모리를 동적 할당 시 사용되는 영역 스택과 힙은 같은 공간을 공유하며, 서로의 공간을 침범할 경우 오버플로우가 일어난다. 프로세스의 상태 프로세스는 실행되는 동안 상태가 바뀐다. 멀티 프로세스 하나의 컴퓨터에 여러 CPU를 장착해 여러 프로세스가 하나의 프로그램을 병렬적으로 처리할 수 있다. 이 경우 몇몇 프로세스가 오작동해도 프로그램을 정상 동작할 수 있으므로 안정성이 확보된다. 프..
-
[알고리즘] 플로이드-워셜 알고리즘개발/자료구조와 알고리즘 2022. 3. 24. 00:40
플로이드-워셜(Floyd-Warshall) 알고리즘 그래프의 모든 노드 간 최단 거리를 구하는 알고리즘이다. 시간 복잡도는 $O(n^3)$이므로 모든 최단 경로가 필요하지만 노드의 수가 적을 때 사용할 수 있다. 아이디어 한 노드(k)가 다른 두 노드(a, b)의 중간지점이라 생각한다면, a에서 b로 가는 경로는 $a-k-b$ 이다. (k가 a혹은 b라면 경로는 a-b가 된다.) $a-k-b$를 모두 조사한다면 a-b간 최단 경로를 알 수 있다. 아래와 같은 그래프를 가정하면 2를 중간 노드로 둘 경우, 2-2-3, 2-2-5, 3-2-5의 세 가지 경로의 값을 알 수 있다. 이 값들 중에서 3-2-5의 경우 3-5로 가는 경로보다 값이 작으므로 업데이트 해준다. 코드 for k in range(1, n..