View AdAccount.cs
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
public class AdAccount : ValueObject | |
{ | |
private AdAccount() | |
{ | |
} | |
public static AdAccount For(string accountString) | |
{ | |
var account = new AdAccount(); |
View rnn_mnist_05_builtin.py
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
rnn_cell = tf.contrib.rnn.BasicRNNCell(hidden_layer_size) | |
outputs, _ = tf.nn.dynamic_rnn(rnn_cell, _inputs, dtype=tf.float32) |
View rnn_minist_04_train_and_test.py
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
# Merge all the summaries | |
merged = tf.summary.merge_all() | |
# Get a small test set | |
test_data = mnist.test.images[:batch_size].reshape((-1, time_steps, element_size)) | |
test_label = mnist.test.labels[:batch_size] | |
with tf.Session() as sess: | |
# Write summaries to LOG_DIR -- used by TensorBoard | |
train_writer = tf.summary.FileWriter(LOG_DIR + '/train', |
View rnn_minist_03_outputs.py
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
# Weights for output layers | |
with tf.name_scope('linear_layer_weights') as scope: | |
with tf.name_scope("W_linear"): | |
Wl = tf.Variable(tf.truncated_normal([hidden_layer_size, num_classes], | |
mean=0, stddev=.01)) | |
variable_summaries(Wl) | |
with tf.name_scope("Bias_linear"): | |
bl = tf.Variable(tf.truncated_normal([num_classes], | |
mean=0, stddev=.01)) | |
variable_summaries(bl) |
View rnn_minist_02_states.py
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
# Weights and bias for input and hidden layer | |
with tf.name_scope('rnn_weights'): | |
with tf.name_scope("W_x"): | |
Wx = tf.Variable(tf.zeros([element_size, hidden_layer_size])) | |
variable_summaries(Wx) | |
with tf.name_scope("W_h"): | |
Wh = tf.Variable(tf.zeros([hidden_layer_size, hidden_layer_size])) | |
variable_summaries(Wh) | |
with tf.name_scope("Bias"): | |
b_rnn = tf.Variable(tf.zeros([hidden_layer_size])) |
View rnn_minist_01_input.py
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
from __future__ import print_function | |
import tensorflow as tf | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) | |
element_size = 28 | |
time_steps = 28 | |
num_classes = 10 | |
batch_size = 128 |