-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha.py
More file actions
38 lines (31 loc) · 927 Bytes
/
a.py
File metadata and controls
38 lines (31 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import os
print os.environ
import pip
installed_packages = pip.get_installed_distributions()
installed_packages_list = sorted(["%s==%s" % (i.key, i.version)
for i in installed_packages])
print(installed_packages_list)
# plt.plot([1,2,3])
#print np.random.randn(200,80*80)
n_values = 32
x = tf.linspace(-3.0, 3.0, n_values)
# %% Construct a tf.Session to execute the graph.
sess = tf.Session()
result = sess.run(x)
print result
sigma = 1.0
mean = 0.0
z = (tf.exp(tf.neg(tf.pow(x - mean, 2.0) /
(2.0 * tf.pow(sigma, 2.0)))) *
(1.0 / (sigma * tf.sqrt(2.0 * 3.1415))))
assert z.graph is tf.get_default_graph()
plt.imshow(z.eval(session=sess))
print(z.get_shape())
print tf.shape(z).eval(session=sess)
print(tf.pack([tf.shape(z), tf.shape(z), [3], [4]]).eval(session=sess))
result = sess.run(z)
print result
sess.close()