In [1]:
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import scipy
import math
import random
import string
import tensorflow as tf
random.seed(123)
# Display plots inline
get_ipython().magic('matplotlib inline')
# Define plot's default figure size
matplotlib.rcParams['figure.figsize'] = (10.0, 8.0)
In [2]:
# Read input data
train = pd.read_csv("Course/code/data/intro_to_ann.csv")
print (train.head())
X, Y = np.array(train.ix[:,0:2]), np.array(train.ix[:,2])
#X, Y = np.array(train.ix[:,0:2]), np.array(train.ix[:,2:3])
print(X.shape, Y.shape)
plt.scatter(X[:,0], X[:,1], s=40, c=Y, cmap=plt.cm.BuGn)
#labels to one-hot matrix
onehotVec = (np.arange(2) == Y[:, None]).astype(np.float32)
Feature1 Feature2 Target
0 2.067788 0.258133 1
1 0.993994 -0.609145 1
2 -0.690315 0.749921 0
3 1.023582 0.529003 0
4 0.700747 -0.496724 1
[5 rows x 3 columns]
(500, 2) (500,)
/usr/lib/python3/dist-packages/matplotlib/collections.py:549: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if self._edgecolors == 'face':
In [3]:
x_input = tf.placeholder(tf.float32, shape=[None, 2])
y_label = tf.placeholder(tf.float32, shape=[None, 2])
#y_label = tf.placeholder(tf.float32, shape=[None, 1])
# Weights for Input to Hidden Layer and Hidden Layer to Output Layer
W1 = tf.Variable(tf.random_normal([2, 4]))
b1 = tf.Variable(tf.zeros([4]))
W2 = tf.Variable(tf.random_normal([4, 2]))
b2 = tf.Variable(tf.zeros([2]))
#Sigmoid acivation function on the weighted inputs(with bias added)
y1_inter = tf.nn.sigmoid(tf.add(tf.matmul(x_input,W1), b1))
#yPredicted is the predicted result which needs to be compared with the labels
yPredicted = tf.nn.softmax(tf.add(tf.matmul(y1_inter,W2), b2))
In [4]:
# Cross Entropy Error
cross_entropy = tf.reduce_mean(-tf.reduce_sum(y_label*tf.log(yPredicted)))
#Gradient descent optimizer
train_step = tf.train.GradientDescentOptimizer(0.001).minimize(cross_entropy)
# Initializes variables
init = tf.initialize_all_variables()
In [5]:
# Launch the Session
errors = []
with tf.Session() as sess:
sess.run(init)
correct_prediction = tf.equal(tf.argmax(yPredicted,1), tf.argmax(y_label,1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
print('Within Session.')
for step in range(3000):
sess.run(train_step, feed_dict={x_input: X, y_label: onehotVec})
accuracy_value = sess.run(accuracy, feed_dict={x_input: X, y_label: onehotVec})
#accuracy_value = sess.run(accuracy, feed_dict={x_input: X, y_label: Y})
errors.append(1 - accuracy_value)
#accuracy_value = sess.run(accuracy, feed_dict={x_input: X, y_label: onehotVec})
#errors.append(1 - accuracy_value)
print('Weights and Bias values:')
print(sess.run(W2), " ", sess.run(b2))
print("Error: ", errors[-1])
Within Session.
Weights and Bias values:
[[ 2.59976864 -2.73695683]
[ 4.16891575 -5.90053415]
[-6.54648542 4.90237951]
[ 3.81523395 -4.2036562 ]] [-2.84647036 2.84647584]
Error: 0.033999979496
In [6]:
errors[:]
Out[6]:
[0.5,
0.5,
0.49800002574920654,
0.23199999332427979,
0.17799997329711914,
0.15600001811981201,
0.14800000190734863,
0.14999997615814209,
0.15200001001358032,
0.15200001001358032,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15600001811981201,
0.15600001811981201,
0.15600001811981201,
0.15600001811981201,
0.15600001811981201,
0.15600001811981201,
0.15600001811981201,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15399998426437378,
0.15200001001358032,
0.15200001001358032,
0.15200001001358032,
0.15200001001358032,
0.15200001001358032,
0.15200001001358032,
0.15200001001358032,
0.15200001001358032,
0.15200001001358032,
0.14999997615814209,
0.14999997615814209,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14800000190734863,
0.14399999380111694,
0.14399999380111694,
0.14399999380111694,
0.14200001955032349,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.1380000114440918,
0.1380000114440918,
0.1380000114440918,
0.1380000114440918,
0.1380000114440918,
0.1380000114440918,
0.1380000114440918,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.13999998569488525,
0.1380000114440918,
0.1380000114440918,
0.1380000114440918,
0.1380000114440918,
0.1380000114440918,
0.1380000114440918,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13599997758865356,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13400000333786011,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
0.13200002908706665,
...]
In [7]:
plt.title('Error Plot')
plt.plot([np.mean(errors[i-50:i]) for i in range(len(errors))])
plt.show()
/usr/local/lib/python3.4/dist-packages/numpy/core/_methods.py:59: RuntimeWarning: Mean of empty slice.
warnings.warn("Mean of empty slice.", RuntimeWarning)
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
Content source: ml6973/Course
Similar notebooks: