MewwSikk
article thumbnail
ResNet v1 vs ResNet v2 - 더 깊이 들여다보기

1. 배경 및 문제 정의신경망의 깊이를 증가시키는 것은 일반적으로 모델의 성능을 향상시키는 데 도움이 됩니다. 하지만 일정 수준 이상의 깊이에 도달하면 오히려 학습이 더 어려워지고 성능이 떨어지는 Degradation Problem이 발생합니다.이 문제를 해결하기 위한 접근법으로 Residual Learning이 제안되었습니다.2. ResNet v1 - 잔차 학습의 시작주요 아이디어모델이 학습해야 할 함수를 직접 학습하는 대신, 잔차 함수 F(x) = H(x) - x를 학습하고,결과적으로 F(x) + x 형태로 출력하도록 합니다. 쉽게 말하면, x는 그냥 지나가는 통로라고 생각하면 됩니다.학습되는 부분은 가중치가 포함된 F(x)뿐이며, 순전파 관점에서 x는 그대로 더해지며 특징을 유지하는 역할을 하고,역..

백준 17142 - 연구소 3 (python)
📚 Algorithm 2024. 7. 13. 20:53

bfs, visited를 set으로 구현한 코드from collections import dequefrom itertools import combinationsimport sysn, m = map(int, input().split())matrix = [list(map(int, input().split())) for _ in range(n)]viruses = [(i, j, 1) for i in range(n) for j in range(n) if matrix[i][j] == 2]time = sys.maxsizedx, dy = [1, 0, 0, -1], [0, 1, -1, 0]def check_full(visited): for i in range(n): for j in range(n): ..

백준 2606 - 바이러스 (python)
📚 Algorithm 2024. 7. 13. 14:29

# dfs n = int(input()) com = [list(map(int, input().split())) for _ in range(int(input()))] link = [[0 for _ in range(n + 1)] for _ in range(n + 1)] addicted = [False] * (n + 1) for a, b in com: link[a][b], link[b][a] = 1, 1 def dfs(com): global link, addicted # 다음으로 넘어가진 컴퓨터 for i in range(1, n + 1): if not addicted[i] and link[com][i] == 1: addicted[i] = True dfs(i) addicted[1] = True dfs(1) p..

Implementation code for convolution layer for single kernel and image
카테고리 없음 2024. 7. 4. 13:55

n, m = map(int, input().split()) kernel = [list(map(int, input().split())) for _ in range(n)] image = [list(map(int, input().split())) for _ in range(m)] result = [[0 for i in range(m-n+1)] for j in range(m-n+1)] ​ def check_in_square(ker_point, n): dir = [[0, 0], [1, 0], [0, 1], [1, 1]] ker_points = [[ker_point[0] + n * dir[i][0] - 1, ker_point[1] + n * dir[i][1] - 1] for i in range(4)] for i i..

article thumbnail
오일러 항등식 (Euler’s Identity)의 성질, 유도
♾️ Math 2024. 5. 18. 15:31

여기서 얻을 수 있는 통찰은 자연로그의 밑(e)과 허수 (i), 원주율(pi), 정보이론 연산자 (1, 0)의 긴밀하고 간명한 관계를 나타내는 등식이기 때문에 단언코 “세상에서 가장 아름다운 등식” 임을 알 수 있다.

article thumbnail
[백준 14888] 연산자 끼워넣기
📚 Algorithm 2023. 12. 27. 15:51

문제 유형 브루트포스, permutation 사용 언어 파이썬, C++ 해결의 기본 아이디어 Permutation(순열)을 기본 아이디어로 사용하여 문제를 해결하였다. 파이썬에서는 itertools라는 라이브러리에 permutation함수가 있어 쉽게 해결하였지만, CPP에는 없었기에 클래스 내부에 dfs를 사용하여 Permutation을 구현하였다. 코드 #include #include using namespace std; int cal(int op, int a, int b) { if (op == 0) return a + b; else if (op == 1) return a - b; else if (op == 2) return a * b; else return a / b; } class Perm { v..