[정리] 직무별 개념 정리(23)
-
[2019.01.30] AsyncTask, API 호출
RestAPIAsyncTask import android.content.ContentValues;import android.os.AsyncTask;import android.util.Log; import org.json.JSONObject; public class RestAPIAsyncTask extends AsyncTask{ private String url; private ContentValues values; public RestAPIAsyncTask(String url, ContentValues values){ this.url = url; this.values = values; } @Override protected void onPreExecute() { super.onPreExecute(); }..
2019.01.30 -
CNN Calculater
def getConv1DOutputSize(inputSize, kernelSize, stride, padding): output = int((inputSize + 2 * padding - kernelSize) / stride + 1) return output def getConv2DOutputSize(inputSize, kernelSize, stride, padding): output = [getConv1DOutputSize(inputSize[0], kernelSize, stride, padding), getConv1DOutputSize(inputSize[1], kernelSize, stride, padding)] return output def getConvT1DOutputSize(inputSize, ..
2019.01.24 -
KLDivergence
import numpy as npimport scipy.stats as stats def KLD(pk, qk): kld = stats.entropy(pk, qk) print(kld) # ppk = np.random.normal(0.1, 0.01, 100000)qk = np.random.normal(0.1, 0.01, 100000)KLD(pk, qk) pk = np.random.normal(0.1, 0.001, 100000)qk = np.random.normal(0.1, 0.001, 100000)KLD(pk, qk) 출처 : https://m.blog.naver.com/PostView.nhn?blogId=atelierjpro&logNo=220981354861&proxyReferer=&proxyReferer..
2019.01.24 -
pyTorch - Mnist VAE
import torchimport torch.nn as nnimport torch.nn.functional as Fimport torch.autograd as autogradimport torch.optim as optimimport numpy as npfrom torch.autograd import Variablefrom torchvision import datasetsfrom torchvision import transformsfrom torchvision.utils import save_image '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''# Mnist 데..
2019.01.24 -
Tensorflow - Mnist CNN 분류
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data Mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)NUM_CLASSES = 10TRAIN_EPOCH = 10BATCH_SIZE = 100LEARNING_RATE = 0.001 # 0.1 : Overshooting x = tf.placeholder(tf.float32, [None, 28*28])y_ = tf.placeholder(tf.float32, [None, NUM_CLASSES]) # Convolutional Layerx_img = tf.reshape(x, [-1, 28, 28, 1])LayerC..
2019.01.24