This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |