boost-devs / peer-session

🚀 부스트캠프 AI Tech 1기 U-Stage 4조 피어 세션 자료/질문 모음 (archived)
8 stars 2 forks source link

[DAY 38] Acceleration & Pruning for network compression #106

Closed changwoomon closed 3 years ago

changwoomon commented 3 years ago

🤷‍♀️Further Question🤷‍♀️

(6강) 빠르게

2) 두 계산에 차이가 발생하는 이유는 뭘까?(p 4)

3) Compression과 acceleration의 관계는? (p 22)

(7강) 가지치기

2) Mask는 언제 사용하는게 유용할까? (p 4)

code 결과

  vec1: [0.1 0.325 0.55 0.775 1. ] 
  array: [0.1 0.325 0.55 -- 1.0] 
  masked_array: [0.1 0.325 0.55 -- 1.0] 
  masked_outside: [-- 0.325 0.55 0.775 --] 

  vec2: [0, 1, 2, 3, 4, -9999] 
  masked_values: [0 1 2 3 4 --] 
  masked_values & filled: [ 0 1 2 3 4 5555]

3) Lottery Ticket Hypothesis의 key idea는 무엇인가? (p 28)


❓ Toy code

(6강) toy code

Q) 속도 체감이 안되는데..?

Ray (num_cpus=1)

Ray (num_cpus=2)

Sequential

(7강) toy code

Q) weight, bias, weight_orig, bias_orig의 차이는..?

weight

  ('weight', Parameter containing:
  tensor([[[[ 0.1672, -0.1517, -0.1711],
            [ 0.1280, -0.1407,  0.3215],
            [-0.1074,  0.2512,  0.2103]]],

          [[[ 0.0602,  0.2026,  0.0181],
            [ 0.1411,  0.0426,  0.1177],
            [-0.0267,  0.1855,  0.0767]]],

          [[[ 0.3355,  0.0562, -0.5521],
            [-0.1873,  0.0618, -0.2184],
            [-0.0807,  0.2019,  0.4228]]],

          [[[ 0.3663, -0.0216,  0.2986],
            [ 0.1475,  0.4550,  0.3350],
            [-0.6378, -0.6662, -0.2658]]],

          [[[ 0.2871,  0.1041,  0.2666],
            [ 0.0158,  0.4709, -0.2112],
            [ 0.4000,  0.0856, -0.3989]]],

          [[[ 0.4908,  0.0509,  0.2348],
            [-0.3349, -0.2446, -0.7014],
            [-0.6735, -0.3921, -0.2518]]]], requires_grad=True))

bias

  ('bias', Parameter containing:
  tensor([ 0.1874,  0.0468,  0.0102, -0.1306,  0.2191,  0.4025],
         requires_grad=True))

weight_orig

  ('weight_orig', Parameter containing:
  tensor([[[[ 0.1672, -0.1517, -0.1711],
            [ 0.1280, -0.1407,  0.3215],
            [-0.1074,  0.2512,  0.2103]]],

          [[[ 0.0602,  0.2026,  0.0181],
            [ 0.1411,  0.0426,  0.1177],
            [-0.0267,  0.1855,  0.0767]]],

          [[[ 0.3355,  0.0562, -0.5521],
            [-0.1873,  0.0618, -0.2184],
            [-0.0807,  0.2019,  0.4228]]],

          [[[ 0.3663, -0.0216,  0.2986],
            [ 0.1475,  0.4550,  0.3350],
            [-0.6378, -0.6662, -0.2658]]],

          [[[ 0.2871,  0.1041,  0.2666],
            [ 0.0158,  0.4709, -0.2112],
            [ 0.4000,  0.0856, -0.3989]]],

          [[[ 0.4908,  0.0509,  0.2348],
            [-0.3349, -0.2446, -0.7014],
            [-0.6735, -0.3921, -0.2518]]]], requires_grad=True))

bias_orig

  ('bias_orig', Parameter containing:
  tensor([ 0.1874,  0.0468,  0.0102, -0.1306,  0.2191,  0.4025],
         requires_grad=True))