본문 바로가기

분류 전체보기

(83)
[dp]300. Longest Increasing Subsequence [python] Given an integer array nums, return the length of the longest strictly increasing subsequence. A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of the array [0,3,1,6,2,2,7]. Example 1: Input: nums = [10,9,2,5,3,7,101,18] Output: 4 Explanation: The longest inc..
[DP ]1220. Count Vowels Permutation 해설 : 이전 dp 문제들과 같이 현재 단계에서의 만들수 있는 경우의 수는 이전 단계의 a,e,i,o,u를 사용해서 만들 수 있는 경우의 합과 같다. 따라서 dp[0][0] (=a) , dp[0][1] (=e) 은 미리 구해놓고, dp[1][0] 에서는 조건들에 따라 수를 합해 나가면된다. class Solution { public: int countVowelPermutation(int n) { long long modulo = 1000000007; vector dp(n, vector (5, 0)); for(int i=0; i
[DP] 377. Combination Sum IV 377. Combination Sum 4 target 을 만들기 위한 숫자 조합 세기. target에서 1~3중에 숫자를 하나 골라서 뺏을때, 앞서 만들었던 DP를 통해서, 그 수를 만들수 있는 경우의 갯수를 더해주면 된다. DP를 저장 할 공간은 1D면 된다. 왜나면, 1을 만드는 경우의 개수, 2를 만드는 경우의 개수... 식으로 1차원만 있으면 된다. target =4 target - 고른값 target -1 = 3 -> dp[3] target -2 = 2 -> dp[2] target -3 = 1 -> dp[1] target 4를 만들 수 있는 경우의 수는 dp[3] + dp[2] + dp[1] class Solution { public: int combinationSum4(vector& nums,..
[leetcode][c++] 199. Binary Tree Right Side View 문제 Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. 한줄요약 맨 오른쪽 노드 출력하기 왼쪽 output : [1,3,4] 오른쪽 output : [ 1,3,3,7] 문제 Point tree를 어떻게 순회 할 것인가 ? (오른쪽 예시를 보면 갑자기 난이도 급상승) 생각하며보면, 왼쪽에서 오른쪽으로 각 노드들을 방문해 가면서, 각 단계에서 가장 오른쪽 노드(=마지막노드)를 저장하여 반환한다. 오른쪽 그림에서 맨 마지막 단계는 7 밖에 없으므로 7을 저장한다. 풀이 : 1) 왼쪽에서..
[2주차] Object Detection - rcnn, sppnet RCNN1. 후보영역 추출 2. 고정된 사이즈로 wraping  3. 모델에 넣고,  selective search  : 이미지에 색깔, 질감 (texture), shape등을 활용해서, 이미지를 무수히 많은 작은 영역으로 나눈다음, 이 영역을 점차 통합해 나가는 과정을 거친다.  통합된 최종결과를 후보영역으로 사용한다.  selective search는 이미지 한장에 대해서 2000개의 roi를 추출한다.  추출된 후보영역을 동일한 사이즈로 warping  ( cnn의 fc는 입력사이즈가 고정되어있다) 5-1)  cnn을 통해 나온 feature를 svm에 넣어 분류를 진행한다. input : 2000x4096 featuresoutput : class(C+1), confidence scores 5-2)..
딥러닝 유용 사이트 모음 https://www.blossominkyung.com/deeplearning/transfomer-positional-encoding 트랜스포머 트랜스포머(Transformer) 파헤치기—1. Positional Encoding 트랜스포머 Transformer Attention is All You Need Postional Encoding www.blossominkyung.com VIT설명 좋은듯 https://jimmy-ai.tistory.com/314 [논문 요약] Vision Transformer(ViT) 주요 특징 정리 비전 트랜스포머 특징 요약 NLP에서 주로 사용되던 트랜스포머 구조를 비전 도메인에 적용하여 vision AI 분야의 판도를 뒤바꾼 vision transformer(ViT)를 소..
FOCS 설치 에러모음 에러1) fcos_core/csrc/cuda/deform_conv_cuda.cu(72): error: identifier "AT_CHECK" is undefined vi fcos_core/csrc/cuda/deform_conv_cuda.cu 하고 맨위에서 #include하는 곳에 아래 내용 입력. #ifndef AT_CHECK #define AT_CHECK TORCH_CHECK #endif 에러2) nms_cpu.cpp:2:10: fatal error: cpu/vision.h: No such file or directory 경로 못잡는거 같으니까 그냥 절대 경로로 해도 빌드된다. 2개 바꿔주면 된다. 1) vi /home/yj/fcos/FCOS/fcos_core/csrc/cpu/ROIAlign_cpu.c..
[c++][LeetCode Curated Algo 170][314. Binary Tree Vertical Order Traversal] 문제 Given the root of a binary tree, return the vertical order traversal of its nodes' values. (i.e., from top to bottom, column by column). If two nodes are in the same row and column, the order should be from left to right. Input: root = [3,9,8,4,0,1,7,null,null,null,2,5] Output: [[4],[9,5],[3,0,1],[8,2],[7]] Input: root = [3,9,20,null,null,15,7] Output: [[9],[3,15],[20],[7]] 한줄해석 위와 같은 tree 구조..