목록DNN (29)
The Beautiful Future
https://www.youtube.com/watch?v=_JQSMhqXw-4 고려대학교 산업경영공학과 김정섭 text to image generation EBMs Flow-based models GANs VAEs DALL-E ( VAE 기반 활용, OpenAI January 2021 ) GLIDE ( diffusion, OpenAI December 2021 ) DALL-E 2 ( diffusion, OpenAI April 2022 ) Imagen ( diffusion, Google Brain May 2022 ) Diffusion 이란 물리 통계 동역학 Thermodynamics Deep Unsupervised Learning using Nonequilibrium Thermodynamics ICML 20..

Quantization scheme affine mapping of integers q to real numbers r r = S(q-Z), r: real value, q: quantized value, S: scale, Z: zero point S는 양의 실수 이다, Z는 q와 같은 타입의 콴타이즈되어있는 수이고 q = Z 이면 real value 0이다. weight는 8bit integer로 퀀타이즈되고 bias는 32bit로 콴타이즈된다. Integerarithmeticonly matrix multiplication (4)에서 M 만 int가 아니다. M을 int로 바꾸고 fixed-point mul을 한다. 실험적으로 S1, S2, S3는 항상 (0,1)사이에 있다는 것을 찾았다. M0 는 [0..
https://github.com/google/gemmlowp/blob/master/doc/quantization.md google/gemmlowp Low-precision matrix multiplication. Contribute to google/gemmlowp development by creating an account on GitHub. github.com Overview gemmlowp 은 내부적으로 32bit accumulator을 사용하고 최종으로는 8bit 출력을 내보낸다. Quantization as an affine map realvalue=A∗quantizedvalue+B realvalue=C∗(quantizedvalue+D) Do..
@ tensorflow quantize tf.quantization.quantize( input, min_range, max_range, T, mode='MIN_COMBINED', round_mode='HALF_AWAY_FROM_ZERO', name=None, narrow_range=False, axis=None, ensure_minimum_range=0.01 ) - min_range = min( input_tensor ), max_range = max( input_tensor) - MIN_COMBINED mode 인경우, out[i] = (in[i] - min_range) * range(T) / (max_range - min_range) if ( T == qint8 ) out[i] -= (range(T..
https://pytorch.org/docs/stable/quantization.html Quantization — PyTorch 1.6.0 documentation Shortcuts pytorch.org Introduction 콴타이제이션하면 2~4배 빠르다. x86 CPU에서 AVX2 이상 SIMD연산을 지원한다. ARM CPU에서 일반적으로 mobile/embedded devices를 찾을 수 있다. Backend 파이토치는 콴타이제이션은 현재 x86과 ARM용으로 두가지 백엔드를 지원한다. fbgemm for x86, qnnpack for ARM QNNPACK 이 두 모드지원은 qconfig에서 설정이 가능하다. post training quantization qconfig = torch.quan..
HRNet 만든 사람들이 만들었다. Deep High-Resolution Representation Learning for Human Pose Estimation 이 논문 제목이다. HRNet은 COCO test-dev2017 에서 AP 77.0을 달성하였고 MPII test set에서 PCKh@0.5 92.3%을 달성함. PoseTrack2018 Multi-person Pose Tracking Challenge에서 우승하였고 keypoint detection task of COCO 2018에서 2등을 차지하였다. Simple Baseline for Human Pose Estimation and Tracking 논문을 구현한 리포다. 싱글모델로 74.3 mAP을 달성하였다, MPII val 결과 (PCK..
https://github.com/eriklindernoren/PyTorch-YOLOv3 코드분석 Grid Anchor 쿠다 사용사용 가능인지 보고 Float 타입선택 그리드 싸이즈는 출력의 높이 넓이, 입력 이미지 크기를 나눠서 스트라이드 크기를 지정 그리드 x, y를 arange를 사용해서 0~g까지 만들고 반복해서 그리드로 만듬, 그리드 shape은 11gg anchor의 넓이 높이 크기를 스트라이드 대비한 크기로 만들어 줌, 즉 원래 anchor의 크기는 입력 이미지에 대비한 크기였다. 리스트 튜플로 w, h 순으로 담기고 1n11 shape으로 w와 h를 나눔. def compute_grid_offsets(self, grid_size, cuda=True): self.grid_size = grid..
Convolutional Pose Machine CPM (https://github.com/namedBen/Convolutional-Pose-Machines-Pytorch/blob/master/config/config.yml) def adjust_learning_rate(optimizer, iters, base_lr, policy_parameter, policy='step', multiple=[1]): if policy == 'fixed': lr = base_lr elif policy == 'step': lr = base_lr * (policy_parameter['gamma'] ** (iters // policy_parameter['step_size'])) elif policy == 'exp': lr =..
1. Gaussian Distribution Initialization(Normal Distribution Initialization) 가우시안 분포의 평균과 분산을 지정해서 weight의 값을 지정한다. sigmoid나 hyperbolic tangent의 경우 입력 값이 커지면 gradient가 작아지기 때문에 업데이트가 적게 일어나는 문제가 있어서, weight 초기화시 gaussian 분포의 외곽을 잘라내는 truncated normal distribution을 사용한다. 잘라내는 범위는 주로 2 standard deviations을 사용한다. https://stackoverflow.com/questions/41704484/what-is-difference-between-tf-truncated-no..
https://stackoverflow.com/questions/49536856/tensorflow-how-to-merge-batchnorm-into-convolution-for-faster-inference To the best of my knowledge, there is no built-in feature in TensorFlow for folding batch normalization. That being said, it's not that hard to do it manually. One note, there is no such thing as folding dropoutas dropout is simply deactivated at inference time. To fold batch norm..
0. SSD를 직접 구현한 코드https://github.com/seann999/ssd_tensorflow 1. protocol buffer 설치anaconda 환경에 tensorflow을 설치했다면 아래 명령어고 protocol buffer를 설치할 수 있다.condainstall−canacondaprotobuf설치가제대로됐는지확인하려면아래명령어로할수있다.protoc 2. tensorflow Detection API 다운로드 및 설치gitclonehttps://github.com/tensorflow/models3.protocolbuffer컴파일models폴더에서아래명령어로컴파일할수있다.protoc object_detection/protos/*.prot..
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/model_pruning기존 웨이트를 마스킹하는 방법을 사용, pruning.py가 제공함.conv = tf.nn.conv2d( images, pruning.apply_mask(weights), stride, padding)이렇게 감싸지 않고 이미 감싸진 funcion도 있음. layers.masked_conv2d 등 . @ 하이퍼파라미터- namestring타입, 디폴트 model_pruning썸마리, 오피들 이 네임공간에 있게된다?- begin_pruing_stepint 타입, 디폴트 0글로발 스텝에서 프르닝 시작 적용- end_pruning_stepint 타입, 디폴트 -..
TFRecord 을 읽는방법에 대해 살펴보자!cifar10 예제에서는 class Cifar10DataSet(object):는 클래스에서 저장해 두었던 TFRecord 를 알맞게 읽어드리도록 설계되어있다.CIFAR10을 이미 train.tfrecords, validation.tfrecords, eval.tfrecords로 이미 저장해놨고필요에 따라 위 세계중 하나를 택해서 사용한다. 1. tfrecords 읽는 방법dataset = tf.contrib.data.TFRecordDataset(filenames).repeat()위는 tfrecords와의 인터페이스를 마련했다고 보면 될것 같다.이제 데이터를 어떻게 읽을지 방법을 제공하는 parser와 몇개씩 읽을지 쓰레드 개수 , 버퍼크기를 map을 이용하여 지..
cifar 10 estimator 예제를 살펴보자!https://github.com/tensorflow/models/tree/master/tutorials/image/cifar10_estimator우선 READ.md부터 읽어보면 TF 1.2.1 이상버전을 설치하라고 한다.그리고 cifar10 db를 받아서 TFRecord file을 만들라고 한다. TFRecord은 학습시 대량의 이미지를 빠르게 읽을 수 있게해주는 포멧이다.pythongeneratecifar10tfrecords.py−−data−dir={PWD}/cifar-10-data을 실행하면 이미지를 다운로드하고 TFRecord도 만들어 준다는데 일단 이것부터 살펴보자 1. CIFAE 이미지 다운로드 텐서플로우에서 다운로드는 functio..
https://github.com/vdumoulin/conv_arithmetichttps://towardsdatascience.com/types-of-convolutions-in-deep-learning-717013397f4d
### LayerSetUp channel_axis_ = 1 // n c h wfirst_spatial_axis = channel_axis_ + 1 // h , wnum_spatial_axes_ = 4 // n c h w num_output_ = num of filtersconv_out_channels_ = num_output_ weight_shape0 = conv_out_channels_weight_shape1 = conv_in_channels_ / group_weight_shape2 = kernel_hweight_shape3 = kernel_w conv_out_spatial_dim_ = top_h * top_wkernel_dim_ = kernel_c *kernel_h * kernel_wweight_of..
Shmuel Winograd. Arithmetic complexity of computations, volume 33. Siam, 1980 page.39에 컨볼루션 연산을 줄일수있는 minimal filtering algorithm이 정리되어있다.?!FIR filter: 출력이 다시 입력으로 들어가지 않는 필터, 반대는 IIR 필터로 출력이 다시 입력으로 들어감.r-tap FIR filter: r차원 벡터로 쉽게 생각하자.r-tap FIR filter를 가지고 m개의 output을 출력하는 Winograd FFTs는 F(m,r)로 표현되며 사용되는 곱연산은 뮤기호를 사용 로 표현된다.즉, F( # of output, filter dim)으로 볼 수 있다.Winograd FFTs의 핵심은 연산량을 줄이는 ..
Adam: Adaptive Moment Estimation ** Original Paper- ADAM: A METHOD FOR STOCHASTIC OPTIMIZATION ** 정리 잘되어있는 블로그http://shuuki4.github.io/deep%20learning/2016/05/20/Gradient-Descent-Algorithm-Overview.html ** 설명RMSProp과 Momentum 방식을 합친 알고리즘Momentum과 유사하게 Gradient의 지수평균을 저장mt=β1mt−1+(1−β1)∇θJ(θ)RMSProp과 유사하게 Gradient의 제곱을 지수평균으로 저장\( v_{t} = \beta_{2..
@ 텐서플로우 윈도우설치 전체적인내용 , 소스로부터 빌드하는 방법은 없다.https://www.tensorflow.org/install/install_windows @ Bazel 빌드를 이용하여 텐서플로우를 윈도우에 설치 할 수 있으나 굉장히 실험적이라고 한다.도전해보자!!https://www.tensorflow.org/install/install_sources