Created
April 6, 2017 07:07
-
-
Save manashmandal/4bd4ea45dafd9b459dede5aff107d21c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 numpy as np | |
import tensorflow as tf | |
sess = tf.Session() | |
inp = tf.Variable(np.array([0.0, 0.0, 0.0, 0.0, 1.0]).reshape(1, 1, 5, 1), name="inp") | |
fil = tf.Variable(np.array([0.0, 0.5, 1.0]).reshape(1, 3, 1, 1), name="fil") | |
op = tf.nn.conv2d(inp, fil, strides=[1, 1, 1, 1], padding='SAME') | |
init = tf.global_variables_initializer() | |
with tf.Session() as sess: | |
sess.run(init) | |
print("input") | |
print(input.eval()) | |
print("filter") | |
print(filter.eval()) | |
result = sess.run(op) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment