본문 바로가기
728x90

분류 전체보기423

[R-CNN] Rich feature hierarchies for accurate object detection and semantic segmentation Tech report(v5) R-CNN에 대한 논문으로 Ross. Girshick이 1저자로 CVPR 2014년도에 게재된 논문이다. https://arxiv.org/abs/1311.2524 Rich feature hierarchies for accurate object detection and semantic segmentation Object detection performance, as measured on the canonical PASCAL VOC dataset, has plateaued in the last few years. The best-performing methods are complex ensemble systems that typically combine multiple low-level image featu.. 2023. 11. 10.
[python] 백준 3043 장난감 탱크 https://www.acmicpc.net/problem/3043 3043번: 장난감 탱크 상근이는 생일 선물로 장난감 탱크 N개를 받았다. 탱크를 가지고 놀기 전장을 만들었다. 전장은 나무판 위에 N행 N열 크기로 만들었다. 각 탱크가 한 번에 움직일 수 칸은 인접한 네 칸이다. 탱크 www.acmicpc.net 문제 해결 N행 N열 크기의 나무판이므로 각 행마다 하나의 탱크가 들어가고 각 열마다 하나의 탱크가 들어가야 한다는 것은 쉽게 알 수 있다. 문제는 겹치지 않고 어떻게 순서를 정해서 이동시킬 것이며 어떤 기준으로 이동시킬 것이냐가 문제이다. 어동 시키는 방법은 간단하다. 행을 기준으로 각 탱크의 위치를 정렬시킨다. 그 다음 맨 위에 행부터 아래행으로 내려가면서 1행, 2행, 3행 . . .에 .. 2023. 11. 10.
[PyTorch] (B,C,H,W) 이어 붙이기 tensor.randn((B,) + (C,H,W)) CNN을 이용하여 Image Classification하는 훈련 train을 시킬 때 데이터를 (배치사이즈(B), 채널(C), 높이(H), 너비(W))를 차례대로 텐서의 크기를 맞춰서 코드를 작성해야할 때가 있다. 이때 배치사이즈만 따로 떨어져 있는 때가 있다. 이 때 tensor.randn((B,) + (C,H,W))를 이용하면 tensor((B,C,H,W)) 사이즈라는 것을 알릴 수 있다. 예제 # x_dim = (1,28,28) batch_in.view(-1,x_dim) #(batch_size, 1 * 28 * 28) batch_in.view((-1,)+x_dim) #(batch_size, 1, 28, 28) 2023. 11. 9.
torch.Tensor.item https://pytorch.org/docs/stable/generated/torch.Tensor.item.html torch.Tensor.item — PyTorch 2.1 documentation Shortcuts pytorch.org 모델에서 예측한 값(y_pred)과 참 값(y_trgt)값이 같은 것의 개수를 구하려 할 때 (y_pred==y_trgt).sum().item()을 쓰는 코드를 발견해서 디버깅을 해보면서 torch.Tensor.item()이 텐서 값을 숫자만으로 나타낼 수 있다는 것을 알았다. 이는 dictionary에서 (key, value) 값으로 나타내는 items과 다른 의미를 나타낼 수 있다는 것을 알았다. python items code car = { "brand": "BMW.. 2023. 11. 9.
728x90