전체 글(334)
-
Conv2d layer and Convtranspose2d layer calculation
conv2d 와 convtranspose2d layer를 거치고 난 후, shape를 알 수 있는 공식을 적어본다. 1. Conv2d: output_size = (Input_size - kernel_size + 2padding_size) / stride + 1 2. Max_pooling: output_size = (Input_size - pooling_size) / stride + 1 3. Convtranspose2 d: output_size = stride_size(input_size - 1 ) + kernel_size - 2 padding_size
2024.04.06 -
[Leetcode] 74. Search a 2D Matrix
Problem: You are given an m x n integer matrix matrix with the following two properties: Each row is sorted in non-decreasing order. The first integer of each row is greater than the last integer of the previous row. Given an integer target, return true if target is in matrix or false otherwise. You must write a solution in O(log(m * n)) time complexity. Example 1: Input: matrix = [[1,3,5,7],[10..
2024.04.04 -
[Leetcode] 69. Sqrt(x)
Problem: Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well. You must not use any built-in exponent function or operator. For example, do not use pow(x, 0.5) in c++ or x ** 0.5 in python. Example 1: Input: x = 4 Output: 2 Explanation: The square root of 4 is 2, so we return 2. Example 2: Input: x = ..
2024.04.04 -
[Leetcode] 35. Search Insert Position
Problem: Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algorithm with O(log n) runtime complexity. Example 1: Input: nums = [1,3,5,6], target = 5 Output: 2 Example 2: Input: nums = [1,3,5,6], target = 2 Output: 1 Example 3: Input: nums = [1,3,5,6], t..
2024.04.03 -
[Leetcode] 34. Find First and Last Position of Element in Sorted Array
Problem: Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. Example 1: Input: nums = [5,7,7,8,8,10], target = 8 Output: [3,4] Example 2: Input: nums = [5,7,7,8,8,10], target = 6 Output: [-1,-1] Example 3: I..
2024.04.02 -
[Leetcode] 33. Search in Rotated Sorted Array
Problem There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1
2024.03.30