본문 바로가기

Deep Learning

Entropy, Mutual Information, KL Divergence 1. 정보량 주머니에 N개의 서로다른 색의 공이 섞여있다고 가정하자. xi는 i번째 색의 공을 주머니에서 꺼내는 사건을 의미. xi의 확률이 높다면, 즉 너무 자주 발생하는 사건이라면 이로 부터 얻을 수 있는 정보는 적다. 반대로 xi의 확률이 낮다면, 즉 자주 발생하지 않은 사건이라면 이로 부터 얻을 수 있는 정보는 많다. 정보량은 위와 같이 표현한다. 2. 엔트로피 (Entropy) x의 확률 분포 p(x)로 부터 기대되는 정보량. 엔트로피는 모든 사건이 동일한 확률을 가질 때 최대 값을 갖는다. 즉 p(x)가 Uniform Distribution 일 때 최대 정보량을 갖는다. 랜덤 변수 x, y의 joint distribution p(x,y)로 부터 기대되는 정보량은 joint entropy라 하며.. 더보기
Kullback–Leibler divergence (KL divergence) 1) Q를 P대신 사용할 경우의 엔트로피 변화가 0이라는건 Q와 P가 동일한 양의 정보를 가지고 있다라는 의미 2) KLD는 항상 0보다 크거나 같은 값을 갖는다 3) KLD를 최소화 ▶ Q와 P가 동일한 양의 정보를 가지도록 강요 4) (-1 x KLD)를 최소화 ▶ KLD를 최대화 ▶ Q와 P가 다른 양의 정보를 가지도록 강요 더보기
Kullback–Leibler divergence (KL divergence) 1) Q를 P대신 사용할 경우의 엔트로피 변화가 0이라는건 Q와 P가 동일한 양의 정보를 가지고 있다라는 의미 2) KLD는 항상 0보다 크거나 같은 값을 갖는다 3) KLD를 최소화 ▶ Q와 P가 동일한 양의 정보를 가지도록 강요 4) (-1 x KLD)를 최소화 ▶ KLD를 최대화 ▶ Q와 P가 다른 양의 정보를 가지도록 강요 더보기
How to make novel ideas? 더보기
[Pytorch] Stop updating params of a layer of a model during back-propagation for param in self.model.Traj_Dec.decoder_mlp.parameters(): param.requires_grad = False 더보기
[Pytorch] Assign (loaded) pre-trained model params to a specific layer of a new model self.model.Traj_Dec.decoder_mlp[0].weight.data = checkpoint['scratch_state_dict']['Traj_Dec.decoder_mlp.0.weight'] self.model.Traj_Dec.decoder_mlp[0].bias.data = checkpoint['scratch_state_dict']['Traj_Dec.decoder_mlp.0.bias'] 더보기
D. Choi et al., "Regularizing neural networks for future trajectory prediction via inverse reinforcement learning framework," IET Computer Vision, In Press. Abstract Predicting distant future trajectories of agents in a dynamic scene is not an easy problem because the future trajectory of an agent is affected by not only his/her past trajectory but also the scene contexts. To tackle this problem, we propose a model based on recurrent neural networks (RNNs) and a novel method for training the model. The proposed model is based on an encoder-decoder a.. 더보기
[Pytorch] 2D Conv using F.conv2d (2d conv with a pre-defined filter) import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np input = torch.Tensor(np.array([[[ [1,1,1,0,0], [0,1,1,1,0], [0,0,1,1,1], [0,0,1,1,0], [0,1,1,0,0] ]]])) filter = torch.Tensor(np.array([[[ [1,0,1], [0,1,0], [1,0,1] ]]])) input = Variable(input, requires\_grad=True) filter = Variable(filter) out = F.conv2d(input, filter) prin.. 더보기
[tensorflow] install tensorflow on ubuntu https://medium.com/@whiteuj/%EC%9A%B0%EB%B6%84%ED%88%AC-14-04-lts-%EC%82%AC%EC%9A%A9%EA%B8%B0-%EB%84%A4%ED%8A%B8%EC%9B%8C%ED%81%AC-%EA%B3%A0%EC%A0%95-ip-%EC%84%A4%EC%A0%95-d7a5c425e356#.el4i8xivp IP : 129.254.94.21 서브넷 마스크 : 255.255.255.0 기본 게이트웨이 : 129.254.94.1 (쉼표로 구분) 기본 DNS : 129.254.16.61 보조 DNS : 129.254.16.62 ++++++++++++++++++++++++++++++++++++++++++++++ 4. 우분투 NVIDIA 그래픽카드, CUDA, cuDNN .. 더보기
Very simple LSTM example 1. Notation x_{t} : input vector at time t h_{t} : hidden state of RNN at time t C_{t} : cell state of RNN at time t f_{t} = sigmoid(W1 x [h_{t-1} x_{t}] + b1) i_{t} = sigmoid(W2 x [h_{t-1} x_{t}] + b2) tilde{C}_{t} = tanh(W3 x [h_{t-1} x_{t}] + b3) 2. Explanation Cell state can be regarded as a bag of information obtained previously from past inputs. Everytime RNN gets an input from outside, RN.. 더보기