본문 바로가기

반응형

분류 전체보기

(66)
[Pytorch] network(model) parameter 얻는 방법 소개 최근 경량화 스터디를 시작했다. 경량화 스터디에서 첫 주제는 Pruning이었다. Pruning은 가지치기 기법으로 모델에서 중요하지 않은 weight나 filter를 제거함으로써 계산량과 모델 크기를 줄여주는 방법이다. 중요한 weight나 filter를 찾아내기 위해 모델 내부의 parameter에 직접 접근하고, 변경도 해야해서 구현이 쉽지 않았다. 구현을 위해 여러 시도를 해보면서 알게된 점을 정리해보았다. 정리 0. state_dict를 사용하여 값을 변경하면 된다. 나의 목표는 parameter 참고와 변경이었으니, get_parameters와 state_dict를 적절히 활용하면 될 것 같다. 1. 모듈에 named_parameters / parameters, named_children..
Pruning 논문 리뷰 리스트 Rethinking The Value of Network Pruning - https://dbwp031.tistory.com/27 Dynamic Model Pruning with Feedback(DPF) - 2021.08. 작성중 Picking Winning Tickets Before Training By Preserving Gradient Flow - 2021.08.15
[논문 리뷰] Filter Pruning via Geometric Median for Deep Convolutional Neural Networks Acceleration 논문 자료: https://arxiv.org/pdf/1811.00250.pdf 해당 논문에서 사용되는 사진 및 자료를 사용하였습니다. ## New Concept norm-based criterion ## Abstract 기존 논문들은 "smaller-norm-less-important"라는 기준이 prune filter에 활용되었다. 그러나 이런 norm based criterion은 다음 2가지에 의해 effectiveness가 결정되는데 이 둘은 항상은 충족하지 않는다. 1) 필터들의 표준편차들은 커야한다. 2) 필터들의 minimum norm(최소 표준)은 작아야 한다. 이 논문에서는 이 두 문제에 상관없이 모델을 압축할 수 있는 새로운 filter pruning method(Filter Pruni..
Machine Learning - Quantization 양자화 양자화에 대한 논문 리뷰, 개념들을 정리할 예정이다.
[LeetCode][Python3] 130. Surrounded Regions class Solution: def solve(self, board: List[List[str]]) -> None: """ Do not return anything, modify board in-place instead. """ if not board: return m = len(board) n = len(board[0]) def isEdge(row,col): if 0
[LeetCode][Python3] 116. Populating Next Right Pointers in Each Node """ # Definition for a Node. class Node: def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None): self.val = val self.left = left self.right = right self.next = next """ class Solution: def connect(self, root: 'Node') -> 'Node': if not root: return root queue = [] queue.append(root) while(len(queue)!=0): leftqueue = [] prenode = queue.pop(0) if prenode.le..
[LeetCode][Python3] 111. Minimum Depth of Binary Tree # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def minDepth(self, root: TreeNode) -> int: queue = [] if not root: return 0 depth = 1 queue.append(root) while(len(queue)!=0): for _ in range(0,len(queue)): node = queue.pop(0) if not node.left and not node.right: retu..
[LeetCode][Python3] 107. Binary Tree Level Order Traversal II # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def levelOrderBottom(self, root: TreeNode) -> List[List[int]]: queue = [] answer = [] if not root: return [] queue.append(root) while(len(queue)!=0): floor=[] for _ in range(0,len(queue)): node = queue.pop(0) if node.l..

반응형