Skip to content

Instantly share code, notes, and snippets.

import tensorflow as tf
i = tf.constant(0)
def cond(i):
return tf.less(i, 10)
def body(i):
return tf.add(i, 1)
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
def get_input_fn(dataset_split, batch_size, capacity=10000, min_after_dequeue=3000):
def _input_fn():
images_batch, labels_batch = tf.train.shuffle_batch(
tensors=[dataset_split.images, dataset_split.labels.astype(np.int32)],
batch_size=batch_size,
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
def get_input_fn(dataset_split, batch_size, capacity=10000, min_after_dequeue=3000):
def _input_fn():
images_batch, labels_batch = tf.train.shuffle_batch(
tensors=[dataset_split.images, dataset_split.labels.astype(np.int32)],
batch_size=batch_size,
# -*- coding: utf-8 -*-
"""tf.estimator API를 이용한 TensorFlow Wide & Deep Tutorial 예제"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
from absl import app as absl_app
# -*- coding: utf-8 -*-
# Convolutional Neural Networks(CNN)을 이용한 MNIST 분류기(Classifier)
# Author : solaris33
# Project URL : http://solarisailab.com/archives/2524
import tensorflow as tf
import os
# MNIST 데이터를 다운로드 합니다.
from tensorflow.examples.tutorials.mnist import input_data
# -*- coding: utf-8 -*-
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import tensorflow as tf
import tensorflow_hub as hub
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import re
import seaborn as sns
# -*- coding: utf-8 -*-
# Char-RNN 예제
# Author : solaris33
# Project URL : http://solarisailab.com/archives/2487
# GitHub Repository : https://github.com/solaris33/char-rnn-tensorflow/
# Reference : https://github.com/sherjilozair/char-rnn-tensorflow
import tensorflow as tf
import numpy as np
# -*- coding: utf-8 -*-
"""
GAN(Generative Adversarial Networks)을 이용한 MNIST 데이터 생성
Reference : https://github.com/TengdaHan/GAN-TensorFlow
Author : solaris33
Project URL : http://solarisailab.com/archives/2482
"""
# -*- coding: utf-8 -*-
# tf.train.QueueRunner 예제
# original source:
# https://github.com/Hezi-Resheff/Oreilly-Learning-TensorFlow/blob/master/08__queues_threads/queue_basic.py
from __future__ import print_function
import tensorflow as tf