본문 바로가기

CS28

[LeetCode] 26. Remove Duplicates from Sorted Array 06.28.20240. Before We BeginI write my code even though my code is ridiculous as is the question just in case someone wonders what the heck is going on and why the judging seems odd.1. Problem2. My Code/** * @param {number[]} nums * @return {number} */var removeDuplicates = function(nums) { const s = new Set(nums); const result = [...s]; const k = nums.length; nums.length = 0; res.. 2024. 6. 28.
[LeetCode] 169. Majority Element 06.27.2024 1. Problem2. My Code/** * @param {number[]} nums * @return {number} */var majorityElement = function(nums) { var obj = Object(); nums.forEach((e) => { if (obj[e]) obj[e]++; else obj[e] = 1; }); let max = 0; Object.entries(obj).forEach((pair) => { const standard = parseInt(nums.length / 2); if (pair[1] > standard) max = pair[0]; }); .. 2024. 6. 27.
[LeetCode] 78. Subsets 01.29.2024 1. Problem 2. My code var subsets = function(nums) { let result = []; for(let i=0; i 2024. 1. 29.
[LeetCode] 446. Arithmetic Slices II - Subsequence 01.07.2024 1. Problem 2. The Things I tried I tried backtracking or a recursive function. But I could not make it and also the quiality of code was bad too. 3. Solution 3-1. Code var numberOfArithmeticSlices = function(nums) { const n = nums.length; let total_count = 0; const dp = new Array(n).fill().map(() => new Map()); for (let i = 1; i < n; ++i) { for (let j = 0; j < i; ++j) { const diff = n.. 2024. 1. 8.
[LeetCode] 46. Permutations 01.03.2024 1. Problem 2. Before 2-1. My Code /** * @param {number[]} nums * @return {number[][]} */ var permute = function(nums) { const len = nums.length; let result = []; result.push(nums); result.push(nums.reverse()); for(var i = 0; i < len; i++ ) { for(var j = 0; j < len-1; j++){ nums[j+1], nums[j] = nums[j], nums[j+1]; if (!(nums in result)) result.push(nums); } }; console.log(result); retu.. 2024. 1. 3.
11주차 - 딥 뉴럴 네트워크 학습시키기 12.11.2023 목차 1. 그라디언트가 소실되거나 폭발하는 문제 2. 프리트레이닝 된 레이어 재사용 3. 더 좋은 옵티마이저 4. 정규화를 통해 오버피팅을 피하기 5. 서머리 0. Introduction 복잡한 문제를 풀려고 할 때 마주치는 문제점들이 있음. 1. 아웃풋에서 인풋레이어로 갈수록 그라디언트가 vanish / explode 소실되거나 폭파될 때 2. 데이터가 충분하지 않거나 레이블이 잘 되어있지 않고, 레이블링에 많은 돈이 들어가야 할 때 3. 너무 느릴때 4. 충분한 데이터 / 노이즈가 없는 데이터가 적어서 오버피팅될 리스크가 존재할 때 1. 그라디언트 소실 / 폭파 gradient가 0에 가까울 정도로 작아진 경우 vanish problem 생성 gradient가 너무 커지면 expl.. 2023. 12. 12.