본문 바로가기

분류 전체보기

(73)
[Top Interview 150 - Array / String] 26. Remove Duplicates from Sorted Array [Q] [Easy]Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Then return the number of unique elements in nums.Consider the number of unique elements of nums to be k, to get accepted, you need to do the following things:Change the array nums such th..
[Problem List - Array / String] 21. Merge Two Sorted Lists [Q] [Easy]You are given the heads of two sorted linked lists list1 and list2.Merge the two lists into one sorted list.The list should be made by splicing together the nodes of the first two lists.Return the head of the merged linked list.  list 2개 합쳐서 sort 하면 될 것으로 생각했는데, "linked" 가 복병이었음list1 과 list2 가 모두 none 인 경우, 하나만 none 인 경우는 따로 처리해줌list1 과 list2 크기 비교하여 처리 해주는건 재귀적으로 처리함 # Answer# Definit..
[Top Interview 150 - Array / String] 88. Merge Sorted Array [Q] [Easy]You are given two integer arrays nums1 and nums2,sorted in non-decreasing order,and two integers m and n, representing the number of elements in nums1 and nums2 respectively.Merge nums1 and nums2 into a single array sorted in non-decreasing order.The final sorted array should not be returned by the function,but instead be stored inside the array nums1.To accommodate this, nums1 has a l..
[Top Interview 150 - Array / String] 27. Remove Element [Q] [Easy]Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of elements in nums which are not equal to val.Consider the number of elements in nums which are not equal to val be k, to get accepted, you need to do the following things:Change the array nums such that the first k elements o..
SageMaker 에 Code whisperer 연결하는 방법 1. 정책 생성IAM 에서 오른쪽 메뉴에 “정책”을 클릭하여 들어간다.오른쪽 상단의 “정책 생성”을 클릭한다.권한 지정 페이지가 나오면 오른쪽 상단의 “JSON” 버튼을 클릭해서 편집기를 변경한다.왼쪽의 음영 진 부분[”Statement”]을 아래 코드 [변경해야 하는 부분] 로 변경해준다.원래 아래와 같이 지정하라고 해서 아래도 지정했었는데 이렇게 해주니까 실제 쥬피터에서 Code Whisperer가 실행되지 않았다.# 변경해야 하는 부분 (복사 + 붙여넣기!) { "Sid": "AmazonQDeveloperPermissions", "Effect": "Allow", "Action": ["codewhisperer:GenerateRecommendations"], ..
파라미터와 하이퍼파라미터 차이 1. 파라미터 [Parameter ; 매개변수] : 모델 이 데이터로부터 학습하는 값들을 말한다. 사용자에 의해 조정되지 않는다. 학습 데이터를 통해 업데이트 되고, 모델의 예측을 결정하는 핵심 요소이다. 예시1 ) 한 학교에서 학생들의 몸무게에 대한 분포를 그린다고 할때, 분포의 평균과 표준편차 값은 파라미터 이다.예시2 ) 머신러닝에서는 가중치와 편향 등이 파라미터에 해당한다.  2. 하이퍼파라미터 [Hyper Parameter] : 모델링 진행시 사용자가 직접 세팅해주는 값을 뜻한다. 정해진 최적의 값은 없으며, 휴리스틱한 방법이나 경험에 의해 결정되는 경우가 많다. 예시 ) 머신러닝에서 learning rate, epoch 등이 있다.  3. 참고https://bkshin.tistory.com/e..
Transformer Model [트랜스포머 모델] 정리 - [1] 이 글은 Transformer 에 대해 직관적으로 이해하고 이해한 바를 잊지 않기 위해 여러 글을 참고하여 작성 / 정리해둔 글입니다.  1. Transformer 배경기존 seq2seq 모델의 한계 [입력 시퀀스를 벡터로 압축하는 과정에서 정보 일부 손실 등] 를 보정하기 위해 attention 이 나왔다. 그렇다면 attention을 보정하기 위해서 추가로 사용하는 용도가 아니라 attention 만으로 인코더와 디코더를 만들어본다면?  2. Transformer 란?트랜스포머 모델은 문장 속 단어와 같은 순차 데이터 내의 관계를 추적해 맥락과 의미를 학습하는 신경망이다.  트랜스포머는 RNN을 사용하지 않지만 인코더-디코더 구조를 유지하고 있다. 이전 seq2seq 구조에서는 인코더와 디코더에서 각..
Attention Mechanism [어텐션 메커니즘] 정리 이 글은 Attention 에 대해 직관적으로 이해하고 이해한 바를 잊지 않기 위해 여러 글을 참고하여 작성 / 정리해둔 글입니다. 1. Attention 배경더보기Seq2Seq? RNN은 출력이 바로 이전 입력까지만 고려해서 정확도가 떨어진다. 전체 입력 문장을 고려하지 않고 다음 문장을 생성하기 때문이다. 그래서 등장하게된 것이 seq2seq. Seq2Seq Network [Encoder Decoder Network] 는 두 개의 RNN [1D CNN도 가능] 으로 구성된 모델이다.  1) Encoder 는 입력 시퀀스를 읽고 단일 벡터[Context Vector]를 출력한다.  2) Decoder 는 이 Context Vector를 읽어 출력 시퀀스를 생성한다. d출처 : https://jalamm..