๋ฐ˜์‘ํ˜•

๐ŸŒŒ Deep Learning 50

[๋”ฅ๋Ÿฌ๋‹ ๋…ผ๋ฌธ๋ฆฌ๋ทฐ] CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted Instances (NeurIPS 2020)

NeurIPS 2020์—์„œ ๋ฐœํ‘œ๋œ CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted Instances ๋ผ๋Š” ๋…ผ๋ฌธ์ด๋‹ค. Out-of-distribution detection์— SimCLR์„ ํ† ๋Œ€๋กœ ํ•œ contrastive learning์„ ์ ์šฉํ•˜์˜€๋‹ค. ๋…ผ๋ฌธ: https://arxiv.org/pdf/2007.08176.pdf ์ฝ”๋“œ: https://github.com/alinlab/CSI Abstract Novelty detection์ด๋ผ๊ณ ๋„ ๋ถ€๋ฅด๋Š” Out-of-distribution (OOD) detection์€, ์ฃผ์–ด์ง„ sample์ด training distribution ๋‚ด๋ถ€์˜ ๊ฒƒ์ธ์ง€ (in-distribution), ..

[๋”ฅ๋Ÿฌ๋‹ ๋…ผ๋ฌธ๋ฆฌ๋ทฐ + ์ฝ”๋“œ] CoordConv: An intriguing failing of convolutional neural networks and the CoordConv solution (NeurIPS 2018)

NeurIPS 2018์—์„œ ๋ฐœํ‘œ๋œ ๋…ผ๋ฌธ์ด๋‹ค. ๋งค์šฐ ๊ฐ„๋‹จํ•œ toy set์—์„œ standard convolution layer์˜ ๋งน์ ์„ ๋ณด์˜€์œผ๋ฉฐ, coordinate ์ •๋ณด๋ฅผ extra channel์— ํฌํ•จ์‹œํ‚ค๋Š” ๋งค์šฐ ๊ฐ„๋‹จํ•œ ๋ฐฉ์‹์œผ๋กœ convolution layer์˜ ์„ฑ๋Šฅ์„ ๋†’์ผ ์ˆ˜ ์žˆ๋Š” CoordConv๋ฅผ ์ œ์•ˆํ•˜์˜€๋‹ค. Paper: https://proceedings.neurips.cc/paper/2018/file/60106888f8977b71e1f15db7bc9a88d1-Paper.pdf Code: https://github.com/uber-research/coordconv Abstract ๋ณธ ๋…ผ๋ฌธ์—์„œ๋Š”, convolution ๊ตฌ์กฐ๊ฐ€ ์ž˜ ๋™์ž‘ํ•˜์ง€ ์•Š๋Š” example์ธ coordinate transform p..

[๋”ฅ๋Ÿฌ๋‹ ๋…ผ๋ฌธ๋ฆฌ๋ทฐ] DANet: Dual Attention Network for Scene Segmentation (CVPR 2019)

CVPR 2019์— ๋ฐœํ‘œ๋œ Dual Attention Network for Scene Segmentation์ด๋‹ค. Scene segmentation์— attention์„ ์ ์šฉํ•˜์—ฌ ์„ฑ๋Šฅ์„ ํ–ฅ์ƒ์‹œ์ผฐ๋‹ค. ๋…ผ๋ฌธ ๋งํฌ: https://openaccess.thecvf.com/content_CVPR_2019/papers/Fu_Dual_Attention_Network_for_Scene_Segmentation_CVPR_2019_paper.pdf Code: https://github.com/junfu1115/DANet Abstract - self-attention์„ ์ด์šฉํ•ด scene segmentation task์—์„œ rich contextual dependency๋ฅผ ํฌ์ฐฉ๋Š” ๊ฒƒ์„ ๋ชฉํ‘œ๋กœ ํ•œ๋‹ค. - ๊ธฐ์กด์˜ attention..

[GAN Overview] GAN ์ฃผ์š” ๋ชจ๋ธ ์ •๋ฆฌ (GAN survey ๋…ผ๋ฌธ ๋ฆฌ๋ทฐ)

Generative Adversarial Networks in Computer Vision: A Survey and Taxonomy (CSUR 2021) ์„ ๋ฐ”ํƒ•์œผ๋กœ, ์ค‘์š”ํ•œ GAN ๋ชจ๋ธ๋“ค์„ ์ •๋ฆฌํ•ด ๋ณด๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค. ๋…ผ๋ฌธ์—๋Š” ๋” ๋‹ค์–‘ํ•œ ๋ชจ๋ธ๋“ค์ด ์†Œ๊ฐœ๋˜์–ด ์žˆ์œผ๋‚˜, ๊ทธ ์ค‘ ์ผ๋ถ€๋งŒ ์ •๋ฆฌํ•˜์˜€์Šต๋‹ˆ๋‹ค. GAN์— ๋Œ€ํ•ด ์–ด๋Š ์ •๋„ ๋ฐฐ๊ฒฝ์ง€์‹์ด ์žˆ๋Š” ๋ถ„๋“ค์„ ์œ„ํ•œ ๊ธ€์ด๋ฉฐ, ๋ณธ ๋…ผ๋ฌธ์—์„œ๋Š” ๊ฐ ๋ชจ๋ธ์— ๋Œ€ํ•œ ๊ฐ„๋‹จํ•œ ์š”์•ฝ๋งŒ ํฌํ•จํ•˜๊ณ  ์žˆ์–ด, ์ถ”๊ฐ€๋กœ ์กฐ์‚ฌํ•œ ๋‚ด์šฉ์„ ํฌํ•จ์‹œ์ผฐ์œผ๋ฉฐ ์ฐธ๊ณ ํ•  ๋งŒํ•œ ์™ธ๋ถ€ ๊ธ€๋“ค์€ ๋งํฌ๋ฅผ ๊ฑธ์–ด๋†“์•˜์Šต๋‹ˆ๋‹ค. Paper: https://dl.acm.org/doi/pdf/10.1145/3439723 Code: https://github.com/sheqi/GAN_Review ๋ชฉ์ฐจ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. Introduction B..

[๋”ฅ๋Ÿฌ๋‹ ๋…ผ๋ฌธ๋ฆฌ๋ทฐ] Decoupling Representation and Classifier for Long-Tailed Recognition (ICLR 2020)

๋…ผ๋ฌธ: https://arxiv.org/abs/1910.09217 ์ฝ”๋“œ: https://github.com/facebookresearch/classifier-balancing [ENG] https://bo-10000.tistory.com/110 [Review] Decoupling Representation and Classifier for Long-Tailed Recognition (ICLR 2020) Paper: https://arxiv.org/abs/1910.09217 Code: https://github.com/facebookresearch/classifier-balancing [KOR] https://bo-10000.tistory.com/109 [๋”ฅ๋Ÿฌ๋‹ ๋…ผ๋ฌธ๋ฆฌ๋ทฐ] Decoupling Represe..

T test ์™€ P value

T test๋ž€? T test๋Š” ๋‘ group๊ฐ„์˜ ์ฐจ์ด๊ฐ€ ์–ผ๋งˆ๋‚˜ "significant"ํ•œ์ง€๋ฅผ ์˜๋ฏธํ•œ๋‹ค. ์ฆ‰, ๋‘ group๊ฐ„์˜ ์ฐจ์ด๊ฐ€ "์šฐ์—ฐํžˆ" ์ผ์–ด๋‚œ ์ผ์ผ ํ™•๋ฅ ์„ ์ธก์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ณดํ†ต ๋ฐ์ดํ„ฐ ์ˆ˜๊ฐ€ ์ ์€ ๊ฒฝ์šฐ์— ์‚ฌ์šฉํ•œ๋‹ค. ํ•˜๋‚˜์˜ ์˜ˆ์‹œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. ์ œ์•ฝํšŒ์‚ฌ์—์„œ ์ƒˆ๋กœ์šด ํ•ญ์•”์ œ๋ฅผ ๊ฐœ๋ฐœํ•ด ์ด๊ฒƒ์ด ๊ธฐ๋Œ€์ˆ˜๋ช…์— ๋ฏธ์น˜๋Š” ์˜ํ–ฅ์„ ์กฐ์‚ฌํ•˜๊ณ  ์‹ถ๋‹ค๊ณ  ํ•˜์ž. ์ด๋Ÿฌํ•œ ์‹คํ—˜์„ ์ง„ํ–‰ํ•  ๋•Œ์—๋Š”, ํ•ญ์ƒ ๋Œ€์กฐ๊ตฐ(placebo ๋ณต์šฉ)์ด ์กด์žฌํ•œ๋‹ค. ์‹คํ—˜ ๊ฒฐ๊ณผ ๋Œ€์กฐ๊ตฐ์˜ ๊ธฐ๋Œ€์ˆ˜๋ช…์ด ํ‰๊ท ์ ์œผ๋กœ 5๋…„ ์ฆ๊ฐ€ํ–ˆ๊ณ , ์‹คํ—˜๊ตฐ(์‹ค์ œ ํ•ญ์•”์ œ ๋ณต์šฉ)์˜ ๊ธฐ๋Œ€์ˆ˜๋ช…์ด ํ‰๊ท ์ ์œผ๋กœ 6๋…„ ์ฆ๊ฐ€ํ–ˆ๋‹ค๊ณ  ํ•œ๋‹ค๋ฉด, ์–ธ๋œป ๋ณด๊ธฐ์—๋Š” ํ•ญ์•”์ œ๊ฐ€ ์‹ค์ œ๋กœ ๊ธฐ๋Œ€์ˆ˜๋ช…์„ ๋Š˜๋ ค์ฃผ๋Š” ํšจ๊ณผ๊ฐ€ ์žˆ์–ด ๋ณด์ธ๋‹ค. ์‹ค์ œ๋กœ ์ด๊ฒƒ์ด ์šฐ์—ฐ์— ์˜ํ•ด ๋ฐœ์ƒํ•œ ์ผ์ธ์ง€, ์•„๋‹Œ์ง€๋ฅผ T test๋Š” ํ™•๋ฅ ์„ ํ†ตํ•ด ์•Œ๋ ค์ค„ ์ˆ˜..

Transformer์˜ positional encoding (PE)

Transformer์„ ๊ตฌ์„ฑํ•˜๋Š” Multi-Head Self-Attention layer๋Š” permutation equivariantํ•œ ํŠน์„ฑ์„ ๊ฐ–๊ธฐ ๋•Œ๋ฌธ์—, postitional encoding์ด ํ•„์ˆ˜์ ์œผ๋กœ ํ•„์š”ํ•˜๋‹ค. Transformer์—์„œ ์‚ฌ์šฉํ•˜๋Š” positional encoding ์šฐ์„ , Transformer์—์„œ ์‚ฌ์šฉํ•˜๋Š” positional encoding์˜ ์‹์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. $PE_{(pos,2i)}=sin(pos/10000^{2i/d_{model}})$ $PE_{(pos,2i+1)}=cos(pos/10000^{2i/d_{model}})$ ์ด๋ฅผ ํ’€์–ด ์“ฐ๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ˜•ํƒœ๋ฅผ ๊ฐ–๊ฒŒ ๋˜๊ณ , ์ด๋ฅผ ์‹œ๊ฐํ™”ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. ๋ณธ ๊ธ€์—์„œ๋Š” ์™œ transformer์˜ positional encoding์ด ์ด..

[ML] Kernel Density Estimation (KDE)์™€ Kernel Regression (KR)

I. Kernel Density Estimation (KDE) KDE๋Š” kernel ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•ด ํ™•๋ฅ ๋ฐ€๋„ํ•จ์ˆ˜๋ฅผ ์ถ”์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค. ํ•˜๋‚˜์˜ ์˜ˆ์‹œ๋กœ, ๊ธธ๊ฑฐ๋ฆฌ์—์˜ ๋ฒ”์ฃ„ ๋ฐœ์ƒ๋Ÿ‰์„ ๋‚˜ํƒ€๋‚ธ ๋ฐ์ดํ„ฐ๊ฐ€ ์žˆ๋‹ค๊ณ  ํ•˜์ž. Crime Location 1 15 2 12 3 10 ... ... ์ด ๋ฐ์ดํ„ฐ๋ฅผ ์ด์šฉํ•ด, ๊ธธ๊ฑฐ๋ฆฌ ๊ฐ ์ง€์ ์—์„œ์˜ ๋ฒ”์ฃ„ ๋ฐœ์ƒ ๊ฐ€๋Šฅ์„ฑ์„ ์ถ”์ •ํ•˜๊ณ  ์‹ถ๋‹ค๊ณ  ํ•˜์ž. ํŠน์ • ์ง€์ ์—์„œ ๋ฒ”์ฃ„๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค๋ฉด, ๊ทธ ๊ทผ์ฒ˜์—๋„ ๋ฒ”์ฃ„๊ฐ€ ๋ฐœ์ƒํ–ˆ์„ ํ™•๋ฅ ์ด ๋†’๋‹ค๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋”ฐ๋ผ์„œ ์šฐ๋ฆฌ๋Š” ๊ณผ๊ฑฐ์— ๋ฒ”์ฃ„๊ฐ€ ๋ฐœ์ƒํ–ˆ๋˜ ์œ„์น˜๋งˆ๋‹ค kernel์„ ์Œ“๊ณ , ์ด๋ฅผ ๋ชจ๋‘ ๋”ํ•˜์—ฌ ๋ฒ”์ฃ„์œจ์— ๋Œ€ํ•œ ๋ฐ€๋„ํ•จ์ˆ˜(KDE)๋ฅผ ์ถ”์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. $\hat{f}_h(x)=\frac{q}{nh}\sum_{i-1}^nK(\frac{x-x_i}{h})$ Kernel ํ•จ์ˆ˜ $K..

Python์œผ๋กœ Multiclass sensitivity, specificity ๊ณ„์‚ฐํ•˜๊ธฐ

Multiclass ๋ฌธ์ œ์˜ ๊ฒฝ์šฐ sensitivity(๋ฏผ๊ฐ๋„)์™€ specificity(ํŠน์ด๋„)๋ฅผ ๊ฐ class๋งˆ๋‹ค ๊ณ„์‚ฐํ•ด์•ผ ํ•œ๋‹ค. sklearn.metrics.confusion_matrix๋ฅผ ์ด์šฉํ•ด ๊ฐ class์˜ sensitivity์™€ specificity๋ฅผ ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ๋‹ค. from sklearn.metrics import confusion_matrix y = y.argmax(axis=-1) y_pred = y_pred.argmax(axis=-1) y_i = np.where(y==y_class, 1, 0) y_pred_i = np.where(y_pred==y_class, 1, 0) cfx = confusion_matrix(y_i, y_pred_i) y_i์™€ y_pred_i๋Š” y_class์— ์†ํ•˜๋Š” s..

Convolution layer์˜ parameter ๊ฐœ์ˆ˜

Input channel์ด 1์ด๊ณ , output channel๋„ 1์ธ ๊ฒฝ์šฐ๋Š” ๋‹จ์ˆœํžˆ single-channel image์— convolution์„ ํ•˜๊ณ  bias term์„ ๋”ํ•ด์ฃผ๋ฉด ๋œ๋‹ค. ์•„๋ž˜ ๊ทธ๋ฆผ์—์„œ๋Š” bias term์€ ์ƒ๋žต๋์ง€๋งŒ, 2*2 kernel์„ ์‚ฌ์šฉํ•˜๊ณ  ์ถ”๊ฐ€๋กœ bias term์ด ํ•˜๋‚˜ ์žˆ์œผ๋‹ˆ ์ด ๊ฒฝ์šฐ ์ด parameter ์ˆ˜๋Š” 5์ด๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์‹ค์ œ๋กœ deep learning model์— convolution layer์„ ์ด์šฉํ•  ๋•Œ์—๋Š” input channel์˜ ์ˆ˜๋„ ์—ฌ๋Ÿฌ ๊ฐœ์ด๊ณ , output channel์˜ ์ˆ˜๋„ ์—ฌ๋Ÿฌ ๊ฐœ์ธ ๊ฒฝ์šฐ๊ฐ€ ๋งŽ๋‹ค. ์ด ๊ฒฝ์šฐ parameter ๊ฐœ์ˆ˜๋ฅผ ๊ณ„์‚ฐํ•˜๋Š” ๋ฒ•์„ ์„ค๋ช…ํ•˜๊ฒ ๋‹ค. Input channel์˜ ์ˆ˜๋ฅผ $C_{in}$, output channel์˜ ์ˆ˜๋ฅผ $C_{ou..

๋ฐ˜์‘ํ˜•