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 | |
mu = 0 | |
sigma = 0.1 | |
rate = 0.001 | |
x = tf.placeholder(tf.float32, (None, 32, 32, 1), name = "input") | |
y = tf.placeholder(tf.int32, (None),name = "label") | |
one_hot_y = tf.one_hot(y, 10) | |
with tf.name_scope("conv1"): # Layer 1: Convolutional. Input = 32x32x1. Output = 28x28x6. |
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 | |
x = tf.placeholder(tf.float32, shape=[None, 784], name = "input") | |
y_ = tf.placeholder(tf.float32, shape=[None, 10], name = "label") # labels | |
# Weight Initialization | |
def weight_variable(shape): | |
initial = tf.truncated_normal(shape, stddev=0.1) | |
return tf.Variable(initial, name = "weight") |
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 argparse | |
import sys | |
from tensorflow.examples.tutorials.mnist import input_data | |
from time import time | |
t0 = time() | |
import tensorflow as tf | |
tf.summary.FileWriterCache.clear() |
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
package etl; | |
import java.sql.ResultSet; | |
import java.sql.ResultSetMetaData; | |
import java.sql.SQLException; | |
import java.sql.Connection; | |
import java.sql.Statement; | |
import java.sql.DriverManager; | |
public class etl { | |
private static String driverName = "org.apache.hive.jdbc.HiveDriver"; |
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 numpy as np | |
import cv2 | |
import matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
% matplotlib inline | |
image = mpimg.imread('bbox-example-image.jpg') | |
def draw_boxes(img, bboxes, color=(0, 0, 255), thick=6): | |
imcopy = np.copy(img) | |
for bbox in bboxes: |
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 cv2 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
def plot3d(pixels, colors_rgb, | |
axis_labels=list("RGB"), axis_limits=[(0, 255), (0, 255), (0, 255)]): | |
"""Plot pixels in 3D.""" | |
# Create figure and 3D axes |
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 numpy as np | |
class Node(object): | |
""" | |
Base class for nodes in the network. | |
Arguments: | |
`inbound_nodes`: A list of nodes with edges into this node. | |
""" | |
def __init__(self, inbound_nodes=[]): |
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
batch_size = 128 | |
hidden_size = 1024 | |
graph = tf.Graph() | |
with graph.as_default(): | |
# place holder for train set, constant for other set | |
X_train = tf.placeholder(tf.float32,shape=(None, 784)) | |
y_train = tf.placeholder(tf.float32, shape=(None, 10)) | |
# Variables. |