[TENSORFLOW] How to Use HashTable 사용법

tensorflow에서 자바의 hashMap 가 같은 key-value 자료구조를 사용하고 싶은 경우, HashTable 을 사용하면 된다. 다만 Key-Value 데이터 타입이 한정적인게 흠이다.   사용 예시는 아래와 같다. import numpy as np import tensorflow as tf keys = tf.constant(np.array([1,2,3,4,5]), dtype=tf.int64) values = tf.constant(np.array([10,20,30,40,50]), dtype=tf.int64) input_value = tf.constant(2, dtype=tf.int64) default_value = tf.constant(-1, dtype=tf.int64) hashTable = tf.contrib.lookup.HashTable( tf.contrib.lookup.KeyValueTensorInitializer(keys, values), default_value) … Continue reading [TENSORFLOW] How to Use HashTable 사용법

Kernel Density Estimation? KDE 이해

  머신러닝 중에 Kernel Density Estimation (KDE) 에 대해 설명하고자 한다. 간단히 말하면 KDE는 데이터를 바탕으로 하는 밀도 추정으로 데이터마다 커널을 생성한 히스토그램이다.   밀도 추정에 대한 내용은 아래 블로그에서 자세히 설명되어 있어 생략한다. http://darkpgmr.tistory.com/147     KDE 란, 아래와 같이 데이터가 존재할 때에   각 데이터에 Kernel 함수를 그린다. (예시는 Gaussian) - Kernel 의 조건 K(x) … Continue reading Kernel Density Estimation? KDE 이해