In [35]:
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline  
print(tf.__version__)
print(np.__version__)


1.2.0
1.13.0

In [9]:
txt = tf.constant("Hello")

In [10]:
with tf.Session() as sess:
    print(sess.run(txt))


b'Hello'

In [11]:
with tf.Session() as sess:
    print(str(sess.run(txt), encoding = "utf-8"))


Hello

In [21]:
def make_dataset():
    num_points = 1000
    vectors_set = []
    
    for i in range(num_points):
        x1 = np.random.normal(0.0,0.55)
        y1 = x1 * 0.1 + 0.3 + np.random.normal(0.0,0.03)
        vectors_set.append([x1,y1])
    
    x_data = [v[0] for v in vectors_set]
    y_data = [v[1] for v in vectors_set]
    
    return x_data, y_data

In [ ]:


In [22]:
x_data, y_data = make_dataset()

In [49]:
plt.plot(x_data, y_data, 'yo', alpha=0.5)
# plt.legend()
plt.show()



In [39]:
np.random.seed(379)
x_data = np.random.normal(0, 0.55, 1000) # 0을 기준으로 표준편차 0.55인 정규분포를 만듬 1000개만듬
y_data = x_data * 0.1 + np.random.normal(0.3,0.03, 1000)

In [41]:
plt.plot(x_data,y_data,'ro',alpha=0.5)
plt.show()



In [45]:
temp = np.linspace(0,1000,8)

In [46]:
temp = np.floor(temp)

In [47]:
print(temp)


[    0.   142.   285.   428.   571.   714.   857.  1000.]

In [ ]:
y_data =