본문 바로가기

분류 전체보기139

[LeetCode] 876. Middle of the Linked List, C Idea When we need to find median value, index -> we can use this algorithms move two step forward agent, move onstep forward agent per scenario. /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* middleNode(struct ListNode* head){ struct ListNode* first = head; struct ListNode* second = head; while(first && first->next) { sec.. 2022. 12. 28.
[LeetCode] 1342 Number of Steps to Reduce a Number to Zero, C Solution Simple sequential calculation Other Solution can use binary operation int numberOfSteps(int num) { int step = 0; while (num != 0) { if (num % 2 == 0) { num = num / 2; } else { num -= 1; } ++step; } return step; } 2022. 12. 28.
강화학습 9 <Offline Reinforcement Learning> 전통적인 강화학습은 특정 환경에서 Agent가 Action을 선택하고 Reward를 얻는 에피소드를 반복해가며 최적의 정책을 학습하는 것이다. 전통 강화학습 기법은 학습 초기 네트워크의 학습이 효과적으로 이루어지지 못하는 문제가 있다. 이로 인해 에피소드가 수천~수만번 수행되면서 학습 시간이 많이 소요된다. 특히, 데이터를 쌓아두고 네트워크를 학습하는 일반 딥러닝과 비교했을 때 소요되는 시간 차이가 굉장히 크다. 이를 개선하기 위해 Offline Reinforcement Learning 방식이 제안되고 있다. 이는 데이터를 구축한 후 네트워크를 초기 학습한다. 그리고 어느정도 학습 네트워크를 시뮬레이션 / 실제 환경에서 강화학습을 진행한다. 즉, 데이터로 네트워크를 어느정도 학습한 후, fine-tuni.. 2022. 12. 16.
[백준] 체스판 다시 칠하기, 1018, C/C++ 포인트 Brutal Force로 모든 케이스를 계산함 #include typedef signed long int int32_t; typedef char char_t; int32_t GetNeedColorChangeNumber(int32_t s32InitColumnIdx, int32_t s32InitRowIdx, char_t(*parchBadookPan)[50]); int main() { const int32_t s32ChessPanSize = 8; int32_t s32NumOfRow = 0, s32NumOfColumn = 0; char_t archBadookPan[50][50] = { 0 }; int32_t s32NumOfColumnCase = 0, s32NumOfRowCase = 0; int32_t s.. 2022. 11. 29.
[백준] 유기농 배추, 1012, C 포인트 탐색 및 스택을 사용할 수 있나? 연산 측면에서 더 효율적인 코드를 짤 여지가 있음 #include #include // 포인트 // 탐색 및 스택을 사용할 수 있나? typedef signed long int int32_t; void FindCanGoRegion(int32_t s32NumOfRow, int32_t s32NumOfColumn, int32_t s32RowIdx, int32_t s32ColumnIdx, int32_t(*pars32Ground)[50]); int main() { int32_t s32TestCase = 0; int32_t ars32NumOfRow[10] = { 0 }, ars32NumOfColumn[10] = { 0 }; int32_t ars32NumOfPlant[10] .. 2022. 11. 28.
[논문 리뷰] Safe Real-World Autonomous Driving by Learning to Predict and Plan with a Mixture of Experts Pini, Stefano, et al. "Safe Real-World Autonomous Driving by Learning to Predict and Plan with a Mixture of Experts." arXiv preprint arXiv:2211.02131 (2022). 요약 자율주행을 위한 Imitation Learning 기반의 Motion Planning 기법을 설명한다. Woven Planet (Toyota 자율주행 부분) 연구진들이 발표한 논문으로 SafetyNet[1] 논문의 후속 연구이다. Machine Learning 기반 궤적 Planner의 Collision Safety를 확보하기 위한 방법을 제안한다. SafetyNet의 단점을 보완한 방법 문제 정의 전통적인 rule ba.. 2022. 11. 26.