Skip to content

Instantly share code, notes, and snippets.

import tensorflow as tf
import matplotlib.pyplot as plt
tf.logging.set_verbosity(tf.logging.INFO)
tf.reset_default_graph()
def parser(serialized_example):
features = {
'age': tf.FixedLenFeature([1], tf.int64),
'img': tf.FixedLenFeature([61*49], tf.int64)
import tensorflow as tf
import matplotlib.pyplot as plt
tf.logging.set_verbosity(tf.logging.INFO)
tf.reset_default_graph()
def parser(serialized_example):
features = {
'age': tf.FixedLenFeature([1], tf.int64),
'img': tf.FixedLenFeature([61*49], tf.int64)
import tensorflow as tf
import matplotlib.pyplot as plt
tf.reset_default_graph()
tf.logging.set_verbosity(tf.logging.INFO)
import tensorflow as tf
import matplotlib.pyplot as plt
tf.reset_default_graph()
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
tf.reset_default_graph()
samples = 1000
times = [1e-2*i for i in range(samples+1)]
sin = np.sin(times[:-1])
sin_next = np.sin(times[1:])
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
tf.reset_default_graph()
samples = 10000
times = [1e-2*float(i) for i in range(samples+1)]
sin = np.sin(times[:-1])
sin_next = np.sin(times[1:])
@leechanwoo
leechanwoo / cnn_gpu.py
Last active December 8, 2017 08:45
B class sources
import tensorflow as tf
tf.reset_default_graph()
def parser(serialized_example):
features = {
'age': tf.FixedLenFeature([1], tf.int64),
'img': tf.FixedLenFeature([61*49], tf.int64)
}
import tensorflow as tf
import matplotlib.pyplot as plt
tf.reset_default_graph()
def parser(serialized_example):
features = {
'age': tf.FixedLenFeature([1], tf.int64),
'img': tf.FixedLenFeature([61*49], tf.int64)
}
import os
import tensorflow as tf
import matplotlib.pyplot as plt
tf.reset_default_graph()
img_dir = './tfrecord_dataset/images_png/'
label_filename = './tfrecord_dataset/label_csv/label.csv'
img_names = sorted([os.path.join(img_dir, n) for n in os.listdir(img_dir)])
import tensorflow as tf
import matplotlib.pyplot as plt
import os
tf.reset_default_graph()
image_dir = './tfrecord_dataset/images_png/
label_name = './tfrecord_dataset/label_csv/label.csv'
image_names = [os.path.join(image_dir, n) for n in os.listdir(image_dir)]
img_name_queue = tf.train.string_input_producer(image_names, seed=7777)
@leechanwoo
leechanwoo / ffnn_B.py
Last active December 1, 2017 08:40
tensorboard -logdir=/path/of/your/logs
import tensorflow as tf
import numpy as np
import csv
samples = 1000
test_samples = 100
train_dataset_dir = './ffnn_dataset/train_dataset.csv'
test_dataset_dir = './ffnn_dataset/test_dataset.csv'
def write_dataset(samples, test_samples, train_dir, test_dir):