앎을 경계하기

Contents 356

차근차근 Spinning Up 톺아보기 Key Paper : Dueling DQN

Dueling DQN의 구조 fully connected layer를 value function에 대해서, advantage function에 대해 분리하고 각 output을 다시 합쳐 Q-value를 구한다. Value function : state에서 얻을 수 있는 모든 action의 q-value의 기댓값. state의 가치이다. Advantage function : 주로 Q-V로 나타내며 특정 action이 평균 action의 value보다 얼마나 좋은지, 나쁜지를 판단할 수 있는 함수. 기존 DQN에서는 주어진 action에 대한 Q-value를 학습한다. 그러나 본 연구에서는 하나의 action만 해도 state value function을 학습할 수 있다. (1) Q(s, a) = V(s) ..

<DAFIT> 07 OpenCV 다루기 첫걸음 - 07 영상 어파인 변환

import cv2 from google.colab.patches import cv2_imshow import numpy as np img_path = '/content/drive/My Drive/다핏문제/907/lena.jpg' 세 개의 꼭지점을 정해주면 getAffineTransform을 통해 이미지 변환을 할 수 있다. img = cv2.imread(img_path,1) height, width = img.shape[:2] controls = [] controls.append((0,0)) controls.append((0,height)) controls.append((width,0)) controls.append((width, height)) src = np.float32([list(co..

<DAFIT> 07 OpenCV 다루기 첫걸음 - 06 영상 크기 조절

이번에는 resizing 문제이다. import cv2 from google.colab.patches import cv2_imshow img_path = '/content/drive/My Drive/다핏문제/907/lena.jpg' img = cv2.imread(img_path,1) height, width = img.shape[:2] down_img = cv2.resize(img,(height//2,width//2)) cv2_imshow(down_img) up_img = cv2.resize(img, (height*2, width*2)) cv2_imshow(up_img) img_list = [] for i in range(100): img_list.append(cv2.resize(img,(he..

<DAFIT> 07 OpenCV 다루기 첫걸음 - 05 영상 뒤집기

이번에는 flip을 해보는 문제이다. import cv2 from google.colab.patches import cv2_imshow import numpy as np img_path = '/content/drive/My Drive/다핏문제/907/lena.jpg' flip함수는 사용하는 게 굉장히 쉽다. 1이면 좌우반전, 0이면 상하반전을 한다. img = cv2.imread(img_path,1) print('origin') cv2_imshow(img) v_img = cv2.flip(img, 1) print('\n\nvertical flip') cv2_imshow(v_img) h_img = cv2.flip(img, 0) print('\n\nhorizontal flip') cv2_imshow..