In [2]:
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.layers import Embedding
from keras.layers import LSTM

Using TensorFlow backend.


# Question 1: Pade Approximants for e^x¶

In [ ]:

for N in range(1,6):
M = N # only care about diagonal values
c_l = 1.0 / np.array([numpy.math.factorial(x) for x in range(1,N+M + 1)])

# solve for b's first
C = np.zeros((M,M))
for l in range(N+1, N+M+1):
for m in range(1,M+1):
print M, l, m
C[l-m] = 1 / numpy.math.factorial(l-m)

b = - np.linalg.inv(C) * c_l
print "N,M,b coeffs", N, M, b

# solve for a's next
a = []
for n in range(1, N+1):
a_coeffs = []
for m in range(1,N+1):
a_coeffs.append(c_l[n] + b[m]*C[n-m])
a.append(a_coeffs)

print "N,M,a coeffs", N, M, a

return



# Question 3 - Neural Net on LFSR¶

In [3]:
def train_LSTM():

half= False

# create 4 tap LFSR register data
init_past = [1,1,1,1]
past = init_past

x_train = []
y_train = []
while True:
Xn = (past[0] + past[3]) % 2
y_train.append(Xn)
x_train.append(past)
past = [Xn] + past[0:3]
if past == init_past:
break

if half:
x_train = np.array(x_train)
y_train = np.array(y_train)
x_test = np.array(x_train)
y_test = np.array(y_train)

x_train = x_train[:7,:]
y_train = y_train[:7]
x_test = x_test[7:,:]
y_test = y_test[7:]

x_train = np.reshape(x_train, (7,4,1))
y_train = np.reshape(y_train, (7, 1))

x_test = np.reshape(x_test, (8,4,1))
y_test = np.reshape(y_test, (8, 1))

print x_train.shape
print y_train.shape
print x_test.shape
print y_test.shape
else:
x_train = np.reshape(x_train, (15,4,1))
y_train = np.reshape(y_train, (15, 1))

x_test = x_train
y_test = y_train

print x_train.shape
print y_train.shape
print x_test.shape
print y_test.shape

model = Sequential()
print model.output_shape

model.compile(loss='binary_crossentropy',
optimizer='rmsprop',
metrics=['accuracy'])

model.fit(x_train, y_train, batch_size=1, epochs=200)
score = model.evaluate(x_test, y_test, batch_size=1)

print "predictions", model.predict_classes(x_test)

print "labels", y_test

train_LSTM()

(15, 4, 1)
(15, 1)
(15, 4, 1)
(15, 1)
(None, 32)
Epoch 1/200
15/15 [==============================] - 0s - loss: 0.6988 - acc: 0.3333
Epoch 2/200
15/15 [==============================] - 0s - loss: 0.6965 - acc: 0.4667
Epoch 3/200
15/15 [==============================] - 0s - loss: 0.6961 - acc: 0.4000
Epoch 4/200
15/15 [==============================] - 0s - loss: 0.6961 - acc: 0.2667
Epoch 5/200
15/15 [==============================] - 0s - loss: 0.6959 - acc: 0.5333
Epoch 6/200
15/15 [==============================] - 0s - loss: 0.6958 - acc: 0.5333
Epoch 7/200
15/15 [==============================] - 0s - loss: 0.6957 - acc: 0.5333
Epoch 8/200
15/15 [==============================] - 0s - loss: 0.6956 - acc: 0.5333
Epoch 9/200
15/15 [==============================] - 0s - loss: 0.6956 - acc: 0.5333
Epoch 10/200
15/15 [==============================] - 0s - loss: 0.6952 - acc: 0.5333
Epoch 11/200
15/15 [==============================] - 0s - loss: 0.6952 - acc: 0.5333
Epoch 12/200
15/15 [==============================] - 0s - loss: 0.6950 - acc: 0.5333
Epoch 13/200
15/15 [==============================] - 0s - loss: 0.6950 - acc: 0.5333
Epoch 14/200
15/15 [==============================] - 0s - loss: 0.6948 - acc: 0.5333
Epoch 15/200
15/15 [==============================] - 0s - loss: 0.6948 - acc: 0.5333
Epoch 16/200
15/15 [==============================] - 0s - loss: 0.6947 - acc: 0.5333
Epoch 17/200
15/15 [==============================] - 0s - loss: 0.6945 - acc: 0.5333
Epoch 18/200
15/15 [==============================] - 0s - loss: 0.6944 - acc: 0.5333
Epoch 19/200
15/15 [==============================] - 0s - loss: 0.6943 - acc: 0.5333
Epoch 20/200
15/15 [==============================] - 0s - loss: 0.6941 - acc: 0.5333
Epoch 21/200
15/15 [==============================] - 0s - loss: 0.6940 - acc: 0.5333
Epoch 22/200
15/15 [==============================] - 0s - loss: 0.6939 - acc: 0.5333
Epoch 23/200
15/15 [==============================] - 0s - loss: 0.6939 - acc: 0.5333
Epoch 24/200
15/15 [==============================] - 0s - loss: 0.6937 - acc: 0.5333
Epoch 25/200
15/15 [==============================] - 0s - loss: 0.6937 - acc: 0.5333
Epoch 26/200
15/15 [==============================] - 0s - loss: 0.6934 - acc: 0.5333
Epoch 27/200
15/15 [==============================] - 0s - loss: 0.6935 - acc: 0.5333
Epoch 28/200
15/15 [==============================] - 0s - loss: 0.6933 - acc: 0.5333
Epoch 29/200
15/15 [==============================] - 0s - loss: 0.6932 - acc: 0.5333
Epoch 30/200
15/15 [==============================] - 0s - loss: 0.6931 - acc: 0.5333
Epoch 31/200
15/15 [==============================] - 0s - loss: 0.6931 - acc: 0.5333
Epoch 32/200
15/15 [==============================] - 0s - loss: 0.6930 - acc: 0.5333
Epoch 33/200
15/15 [==============================] - 0s - loss: 0.6928 - acc: 0.5333
Epoch 34/200
15/15 [==============================] - 0s - loss: 0.6928 - acc: 0.6000
Epoch 35/200
15/15 [==============================] - 0s - loss: 0.6927 - acc: 0.5333
Epoch 36/200
15/15 [==============================] - 0s - loss: 0.6925 - acc: 0.5333
Epoch 37/200
15/15 [==============================] - 0s - loss: 0.6925 - acc: 0.5333
Epoch 38/200
15/15 [==============================] - 0s - loss: 0.6923 - acc: 0.5333
Epoch 39/200
15/15 [==============================] - 0s - loss: 0.6923 - acc: 0.5333
Epoch 40/200
15/15 [==============================] - 0s - loss: 0.6921 - acc: 0.5333
Epoch 41/200
15/15 [==============================] - 0s - loss: 0.6921 - acc: 0.5333
Epoch 42/200
15/15 [==============================] - 0s - loss: 0.6919 - acc: 0.6000
Epoch 43/200
15/15 [==============================] - 0s - loss: 0.6918 - acc: 0.5333
Epoch 44/200
15/15 [==============================] - 0s - loss: 0.6918 - acc: 0.6000
Epoch 45/200
15/15 [==============================] - 0s - loss: 0.6916 - acc: 0.5333
Epoch 46/200
15/15 [==============================] - 0s - loss: 0.6915 - acc: 0.5333
Epoch 47/200
15/15 [==============================] - 0s - loss: 0.6914 - acc: 0.5333
Epoch 48/200
15/15 [==============================] - 0s - loss: 0.6911 - acc: 0.5333
Epoch 49/200
15/15 [==============================] - 0s - loss: 0.6911 - acc: 0.5333
Epoch 50/200
15/15 [==============================] - 0s - loss: 0.6911 - acc: 0.4667
Epoch 51/200
15/15 [==============================] - 0s - loss: 0.6910 - acc: 0.5333
Epoch 52/200
15/15 [==============================] - 0s - loss: 0.6907 - acc: 0.6000
Epoch 53/200
15/15 [==============================] - 0s - loss: 0.6906 - acc: 0.5333
Epoch 54/200
15/15 [==============================] - 0s - loss: 0.6906 - acc: 0.5333
Epoch 55/200
15/15 [==============================] - 0s - loss: 0.6905 - acc: 0.5333
Epoch 56/200
15/15 [==============================] - 0s - loss: 0.6903 - acc: 0.5333
Epoch 57/200
15/15 [==============================] - 0s - loss: 0.6901 - acc: 0.6000
Epoch 58/200
15/15 [==============================] - 0s - loss: 0.6900 - acc: 0.5333
Epoch 59/200
15/15 [==============================] - 0s - loss: 0.6899 - acc: 0.6000
Epoch 60/200
15/15 [==============================] - 0s - loss: 0.6896 - acc: 0.6000
Epoch 61/200
15/15 [==============================] - 0s - loss: 0.6897 - acc: 0.6000
Epoch 62/200
15/15 [==============================] - 0s - loss: 0.6893 - acc: 0.6000
Epoch 63/200
15/15 [==============================] - 0s - loss: 0.6893 - acc: 0.5333
Epoch 64/200
15/15 [==============================] - 0s - loss: 0.6893 - acc: 0.5333
Epoch 65/200
15/15 [==============================] - 0s - loss: 0.6891 - acc: 0.6000
Epoch 66/200
15/15 [==============================] - 0s - loss: 0.6889 - acc: 0.5333
Epoch 67/200
15/15 [==============================] - 0s - loss: 0.6885 - acc: 0.6000
Epoch 68/200
15/15 [==============================] - 0s - loss: 0.6886 - acc: 0.5333
Epoch 69/200
15/15 [==============================] - 0s - loss: 0.6883 - acc: 0.5333
Epoch 70/200
15/15 [==============================] - 0s - loss: 0.6882 - acc: 0.5333
Epoch 71/200
15/15 [==============================] - 0s - loss: 0.6881 - acc: 0.5333
Epoch 72/200
15/15 [==============================] - 0s - loss: 0.6877 - acc: 0.5333
Epoch 73/200
15/15 [==============================] - 0s - loss: 0.6877 - acc: 0.5333
Epoch 74/200
15/15 [==============================] - 0s - loss: 0.6875 - acc: 0.5333
Epoch 75/200
15/15 [==============================] - 0s - loss: 0.6873 - acc: 0.6000
Epoch 76/200
15/15 [==============================] - 0s - loss: 0.6871 - acc: 0.6000
Epoch 77/200
15/15 [==============================] - 0s - loss: 0.6868 - acc: 0.5333
Epoch 78/200
15/15 [==============================] - 0s - loss: 0.6868 - acc: 0.6000
Epoch 79/200
15/15 [==============================] - 0s - loss: 0.6864 - acc: 0.6000
Epoch 80/200
15/15 [==============================] - 0s - loss: 0.6863 - acc: 0.6000
Epoch 81/200
15/15 [==============================] - 0s - loss: 0.6861 - acc: 0.6667
Epoch 82/200
15/15 [==============================] - 0s - loss: 0.6860 - acc: 0.6000
Epoch 83/200
15/15 [==============================] - 0s - loss: 0.6855 - acc: 0.6000
Epoch 84/200
15/15 [==============================] - 0s - loss: 0.6854 - acc: 0.6667
Epoch 85/200
15/15 [==============================] - 0s - loss: 0.6850 - acc: 0.6000
Epoch 86/200
15/15 [==============================] - 0s - loss: 0.6846 - acc: 0.5333
Epoch 87/200
15/15 [==============================] - 0s - loss: 0.6845 - acc: 0.6667
Epoch 88/200
15/15 [==============================] - 0s - loss: 0.6845 - acc: 0.6000
Epoch 89/200
15/15 [==============================] - 0s - loss: 0.6841 - acc: 0.6000
Epoch 90/200
15/15 [==============================] - 0s - loss: 0.6839 - acc: 0.6667
Epoch 91/200
15/15 [==============================] - 0s - loss: 0.6838 - acc: 0.6000
Epoch 92/200
15/15 [==============================] - 0s - loss: 0.6833 - acc: 0.6000
Epoch 93/200
15/15 [==============================] - 0s - loss: 0.6831 - acc: 0.6000
Epoch 94/200
15/15 [==============================] - 0s - loss: 0.6830 - acc: 0.5333
Epoch 95/200
15/15 [==============================] - 0s - loss: 0.6826 - acc: 0.6000
Epoch 96/200
15/15 [==============================] - 0s - loss: 0.6822 - acc: 0.6000
Epoch 97/200
15/15 [==============================] - 0s - loss: 0.6817 - acc: 0.6667
Epoch 98/200
15/15 [==============================] - 0s - loss: 0.6816 - acc: 0.6667
Epoch 99/200
15/15 [==============================] - 0s - loss: 0.6813 - acc: 0.6667
Epoch 100/200
15/15 [==============================] - 0s - loss: 0.6809 - acc: 0.6000
Epoch 101/200
15/15 [==============================] - 0s - loss: 0.6808 - acc: 0.6667
Epoch 102/200
15/15 [==============================] - 0s - loss: 0.6798 - acc: 0.6667
Epoch 103/200
15/15 [==============================] - 0s - loss: 0.6798 - acc: 0.6667
Epoch 104/200
15/15 [==============================] - 0s - loss: 0.6797 - acc: 0.6000
Epoch 105/200
15/15 [==============================] - 0s - loss: 0.6791 - acc: 0.6000
Epoch 106/200
15/15 [==============================] - 0s - loss: 0.6785 - acc: 0.6000
Epoch 107/200
15/15 [==============================] - 0s - loss: 0.6782 - acc: 0.5333
Epoch 108/200
15/15 [==============================] - 0s - loss: 0.6772 - acc: 0.5333
Epoch 109/200
15/15 [==============================] - 0s - loss: 0.6775 - acc: 0.6000
Epoch 110/200
15/15 [==============================] - 0s - loss: 0.6770 - acc: 0.6000
Epoch 111/200
15/15 [==============================] - 0s - loss: 0.6765 - acc: 0.6000
Epoch 112/200
15/15 [==============================] - 0s - loss: 0.6758 - acc: 0.6000
Epoch 113/200
15/15 [==============================] - 0s - loss: 0.6755 - acc: 0.6000
Epoch 114/200
15/15 [==============================] - 0s - loss: 0.6749 - acc: 0.6000
Epoch 115/200
15/15 [==============================] - 0s - loss: 0.6746 - acc: 0.6000
Epoch 116/200
15/15 [==============================] - 0s - loss: 0.6740 - acc: 0.6000
Epoch 117/200
15/15 [==============================] - 0s - loss: 0.6732 - acc: 0.6000
Epoch 118/200
15/15 [==============================] - 0s - loss: 0.6724 - acc: 0.6000
Epoch 119/200
15/15 [==============================] - 0s - loss: 0.6720 - acc: 0.6000
Epoch 120/200
15/15 [==============================] - 0s - loss: 0.6715 - acc: 0.6000
Epoch 121/200
15/15 [==============================] - 0s - loss: 0.6710 - acc: 0.6000
Epoch 122/200
15/15 [==============================] - 0s - loss: 0.6701 - acc: 0.6000
Epoch 123/200
15/15 [==============================] - 0s - loss: 0.6697 - acc: 0.6000
Epoch 124/200
15/15 [==============================] - 0s - loss: 0.6681 - acc: 0.6667
Epoch 125/200
15/15 [==============================] - 0s - loss: 0.6680 - acc: 0.6000
Epoch 126/200
15/15 [==============================] - 0s - loss: 0.6669 - acc: 0.5333
Epoch 127/200
15/15 [==============================] - 0s - loss: 0.6661 - acc: 0.6000
Epoch 128/200
15/15 [==============================] - 0s - loss: 0.6655 - acc: 0.6000
Epoch 129/200
15/15 [==============================] - 0s - loss: 0.6645 - acc: 0.6000
Epoch 130/200
15/15 [==============================] - 0s - loss: 0.6635 - acc: 0.6000
Epoch 131/200
15/15 [==============================] - 0s - loss: 0.6624 - acc: 0.6000
Epoch 132/200
15/15 [==============================] - 0s - loss: 0.6613 - acc: 0.6000
Epoch 133/200
15/15 [==============================] - 0s - loss: 0.6604 - acc: 0.6000
Epoch 134/200
15/15 [==============================] - 0s - loss: 0.6582 - acc: 0.5333
Epoch 135/200
15/15 [==============================] - 0s - loss: 0.6580 - acc: 0.6000
Epoch 136/200
15/15 [==============================] - 0s - loss: 0.6569 - acc: 0.6000
Epoch 137/200
15/15 [==============================] - 0s - loss: 0.6553 - acc: 0.6000
Epoch 138/200
15/15 [==============================] - 0s - loss: 0.6538 - acc: 0.6000
Epoch 139/200
15/15 [==============================] - 0s - loss: 0.6527 - acc: 0.6000
Epoch 140/200
15/15 [==============================] - 0s - loss: 0.6510 - acc: 0.6000
Epoch 141/200
15/15 [==============================] - 0s - loss: 0.6495 - acc: 0.6000
Epoch 142/200
15/15 [==============================] - 0s - loss: 0.6477 - acc: 0.6000
Epoch 143/200
15/15 [==============================] - 0s - loss: 0.6455 - acc: 0.6000
Epoch 144/200
15/15 [==============================] - 0s - loss: 0.6435 - acc: 0.6000
Epoch 145/200
15/15 [==============================] - 0s - loss: 0.6418 - acc: 0.6000
Epoch 146/200
15/15 [==============================] - 0s - loss: 0.6404 - acc: 0.6000
Epoch 147/200
15/15 [==============================] - 0s - loss: 0.6374 - acc: 0.5333
Epoch 148/200
15/15 [==============================] - 0s - loss: 0.6352 - acc: 0.5333
Epoch 149/200
15/15 [==============================] - 0s - loss: 0.6321 - acc: 0.5333
Epoch 150/200
15/15 [==============================] - 0s - loss: 0.6312 - acc: 0.6000
Epoch 151/200
15/15 [==============================] - 0s - loss: 0.6280 - acc: 0.6000
Epoch 152/200
15/15 [==============================] - 0s - loss: 0.6250 - acc: 0.6667
Epoch 153/200
15/15 [==============================] - 0s - loss: 0.6225 - acc: 0.6000
Epoch 154/200
15/15 [==============================] - 0s - loss: 0.6184 - acc: 0.6000
Epoch 155/200
15/15 [==============================] - 0s - loss: 0.6171 - acc: 0.6000
Epoch 156/200
15/15 [==============================] - 0s - loss: 0.6130 - acc: 0.6000
Epoch 157/200
15/15 [==============================] - 0s - loss: 0.6102 - acc: 0.6667
Epoch 158/200
15/15 [==============================] - 0s - loss: 0.6046 - acc: 0.6667
Epoch 159/200
15/15 [==============================] - 0s - loss: 0.6029 - acc: 0.6667
Epoch 160/200
15/15 [==============================] - 0s - loss: 0.5988 - acc: 0.6667
Epoch 161/200
15/15 [==============================] - 0s - loss: 0.5944 - acc: 0.6000
Epoch 162/200
15/15 [==============================] - 0s - loss: 0.5893 - acc: 0.6667
Epoch 163/200
15/15 [==============================] - 0s - loss: 0.5857 - acc: 0.6667
Epoch 164/200
15/15 [==============================] - 0s - loss: 0.5805 - acc: 0.6667
Epoch 165/200
15/15 [==============================] - 0s - loss: 0.5768 - acc: 0.6667
Epoch 166/200
15/15 [==============================] - 0s - loss: 0.5709 - acc: 0.7333
Epoch 167/200
15/15 [==============================] - 0s - loss: 0.5656 - acc: 0.7333
Epoch 168/200
15/15 [==============================] - 0s - loss: 0.5605 - acc: 0.7333
Epoch 169/200
15/15 [==============================] - 0s - loss: 0.5549 - acc: 0.7333
Epoch 170/200
15/15 [==============================] - 0s - loss: 0.5484 - acc: 0.6667
Epoch 171/200
15/15 [==============================] - 0s - loss: 0.5424 - acc: 0.7333
Epoch 172/200
15/15 [==============================] - 0s - loss: 0.5361 - acc: 0.7333
Epoch 173/200
15/15 [==============================] - 0s - loss: 0.5287 - acc: 0.8000
Epoch 174/200
15/15 [==============================] - 0s - loss: 0.5227 - acc: 0.8000
Epoch 175/200
15/15 [==============================] - 0s - loss: 0.5151 - acc: 0.8000
Epoch 176/200
15/15 [==============================] - 0s - loss: 0.5070 - acc: 0.8000
Epoch 177/200
15/15 [==============================] - 0s - loss: 0.5003 - acc: 0.8000
Epoch 178/200
15/15 [==============================] - 0s - loss: 0.4921 - acc: 0.8000
Epoch 179/200
15/15 [==============================] - 0s - loss: 0.4841 - acc: 0.8667
Epoch 180/200
15/15 [==============================] - 0s - loss: 0.4764 - acc: 0.9333
Epoch 181/200
15/15 [==============================] - 0s - loss: 0.4685 - acc: 0.8667
Epoch 182/200
15/15 [==============================] - 0s - loss: 0.4600 - acc: 0.9333
Epoch 183/200
15/15 [==============================] - 0s - loss: 0.4505 - acc: 0.9333
Epoch 184/200
15/15 [==============================] - 0s - loss: 0.4428 - acc: 0.9333
Epoch 185/200
15/15 [==============================] - 0s - loss: 0.4331 - acc: 1.0000
Epoch 186/200
15/15 [==============================] - 0s - loss: 0.4247 - acc: 0.9333
Epoch 187/200
15/15 [==============================] - 0s - loss: 0.4161 - acc: 1.0000
Epoch 188/200
15/15 [==============================] - 0s - loss: 0.4077 - acc: 1.0000
Epoch 189/200
15/15 [==============================] - 0s - loss: 0.3990 - acc: 1.0000
Epoch 190/200
15/15 [==============================] - 0s - loss: 0.3900 - acc: 1.0000
Epoch 191/200
15/15 [==============================] - 0s - loss: 0.3826 - acc: 1.0000
Epoch 192/200
15/15 [==============================] - 0s - loss: 0.3738 - acc: 1.0000
Epoch 193/200
15/15 [==============================] - 0s - loss: 0.3651 - acc: 1.0000
Epoch 194/200
15/15 [==============================] - 0s - loss: 0.3576 - acc: 1.0000
Epoch 195/200
15/15 [==============================] - 0s - loss: 0.3493 - acc: 1.0000
Epoch 196/200
15/15 [==============================] - 0s - loss: 0.3419 - acc: 1.0000
Epoch 197/200
15/15 [==============================] - 0s - loss: 0.3341 - acc: 1.0000
Epoch 198/200
15/15 [==============================] - 0s - loss: 0.3262 - acc: 1.0000
Epoch 199/200
15/15 [==============================] - 0s - loss: 0.3190 - acc: 1.0000
Epoch 200/200
15/15 [==============================] - 0s - loss: 0.3104 - acc: 1.0000
15/15 [==============================] - 0s
[[0]
[1]
[0]
[1]
[1]
[0]
[0]
[1]
[0]
[0]
[0]
[1]
[1]
[1]
[1]]
labels [[0]
[1]
[0]
[1]
[1]
[0]
[0]
[1]
[0]
[0]
[0]
[1]
[1]
[1]
[1]]

In [4]:
def train_nn():
# create 4 tap LFSR register data
init_past = [1,1,1,1]
past = init_past

x_train = []
y_train = []
while True:
Xn = (past[0] + past[3]) % 2
y_train.append(Xn)
x_train.append(past)
past = [Xn] + past[0:3]
if past == init_past:
break

#x_train = np.reshape(x_train, (1,15,4))
#y_train = np.reshape(y_train, (1, 1))

x_train_orig  = np.array(x_train)
x_train = x_train_orig[:7, :]
print x_train_orig.shape
y_train_orig = np.array(y_train)
print y_train_orig.shape
y_train = y_train_orig[:7]

x_test = x_train_orig[7:, :]
y_test = y_train_orig[7:]

print type(x_test)

model = Sequential()
model.compile(optimizer='rmsprop',
loss='binary_crossentropy',
metrics=['accuracy'])

# Train the model, iterating on the data in batches
model.fit(x_train, y_train, epochs=200, batch_size=1)

score = model.evaluate(x_test, y_test, batch_size=1)
print "Score", score

print "predictions and labels"
print model.predict_classes(x_test), y_test.T

train_nn()

(15, 4)
(15,)
<type 'numpy.ndarray'>
Epoch 1/200
7/7 [==============================] - 0s - loss: 0.7107 - acc: 0.4286
Epoch 2/200
7/7 [==============================] - 0s - loss: 0.6961 - acc: 0.7143
Epoch 3/200
7/7 [==============================] - 0s - loss: 0.6883 - acc: 0.7143
Epoch 4/200
7/7 [==============================] - 0s - loss: 0.6818 - acc: 0.7143
Epoch 5/200
7/7 [==============================] - 0s - loss: 0.6759 - acc: 0.7143
Epoch 6/200
7/7 [==============================] - 0s - loss: 0.6707 - acc: 0.5714
Epoch 7/200
7/7 [==============================] - 0s - loss: 0.6659 - acc: 0.5714
Epoch 8/200
7/7 [==============================] - 0s - loss: 0.6617 - acc: 0.5714
Epoch 9/200
7/7 [==============================] - 0s - loss: 0.6573 - acc: 0.5714
Epoch 10/200
7/7 [==============================] - 0s - loss: 0.6532 - acc: 0.5714
Epoch 11/200
7/7 [==============================] - 0s - loss: 0.6494 - acc: 0.5714
Epoch 12/200
7/7 [==============================] - 0s - loss: 0.6455 - acc: 0.5714
Epoch 13/200
7/7 [==============================] - 0s - loss: 0.6418 - acc: 0.5714
Epoch 14/200
7/7 [==============================] - 0s - loss: 0.6380 - acc: 0.5714
Epoch 15/200
7/7 [==============================] - 0s - loss: 0.6347 - acc: 0.5714
Epoch 16/200
7/7 [==============================] - 0s - loss: 0.6311 - acc: 0.5714
Epoch 17/200
7/7 [==============================] - 0s - loss: 0.6272 - acc: 0.5714
Epoch 18/200
7/7 [==============================] - 0s - loss: 0.6239 - acc: 0.5714
Epoch 19/200
7/7 [==============================] - 0s - loss: 0.6204 - acc: 0.5714
Epoch 20/200
7/7 [==============================] - 0s - loss: 0.6167 - acc: 0.5714
Epoch 21/200
7/7 [==============================] - 0s - loss: 0.6135 - acc: 0.5714
Epoch 22/200
7/7 [==============================] - 0s - loss: 0.6100 - acc: 0.5714
Epoch 23/200
7/7 [==============================] - 0s - loss: 0.6064 - acc: 0.5714
Epoch 24/200
7/7 [==============================] - 0s - loss: 0.6035 - acc: 0.5714
Epoch 25/200
7/7 [==============================] - 0s - loss: 0.6000 - acc: 0.5714
Epoch 26/200
7/7 [==============================] - 0s - loss: 0.5963 - acc: 0.5714
Epoch 27/200
7/7 [==============================] - 0s - loss: 0.5927 - acc: 0.5714
Epoch 28/200
7/7 [==============================] - 0s - loss: 0.5892 - acc: 0.5714
Epoch 29/200
7/7 [==============================] - 0s - loss: 0.5861 - acc: 0.5714
Epoch 30/200
7/7 [==============================] - 0s - loss: 0.5825 - acc: 0.5714
Epoch 31/200
7/7 [==============================] - 0s - loss: 0.5790 - acc: 0.5714
Epoch 32/200
7/7 [==============================] - 0s - loss: 0.5759 - acc: 0.5714
Epoch 33/200
7/7 [==============================] - 0s - loss: 0.5727 - acc: 0.5714
Epoch 34/200
7/7 [==============================] - 0s - loss: 0.5692 - acc: 0.5714
Epoch 35/200
7/7 [==============================] - 0s - loss: 0.5662 - acc: 0.5714
Epoch 36/200
7/7 [==============================] - 0s - loss: 0.5630 - acc: 0.5714
Epoch 37/200
7/7 [==============================] - 0s - loss: 0.5599 - acc: 0.5714
Epoch 38/200
7/7 [==============================] - 0s - loss: 0.5565 - acc: 0.5714
Epoch 39/200
7/7 [==============================] - 0s - loss: 0.5530 - acc: 0.7143
Epoch 40/200
7/7 [==============================] - 0s - loss: 0.5500 - acc: 0.7143
Epoch 41/200
7/7 [==============================] - 0s - loss: 0.5476 - acc: 0.7143
Epoch 42/200
7/7 [==============================] - 0s - loss: 0.5435 - acc: 0.7143
Epoch 43/200
7/7 [==============================] - 0s - loss: 0.5413 - acc: 0.7143
Epoch 44/200
7/7 [==============================] - 0s - loss: 0.5381 - acc: 0.7143
Epoch 45/200
7/7 [==============================] - 0s - loss: 0.5347 - acc: 0.7143
Epoch 46/200
7/7 [==============================] - 0s - loss: 0.5320 - acc: 0.7143
Epoch 47/200
7/7 [==============================] - 0s - loss: 0.5281 - acc: 0.7143
Epoch 48/200
7/7 [==============================] - 0s - loss: 0.5254 - acc: 0.7143
Epoch 49/200
7/7 [==============================] - 0s - loss: 0.5225 - acc: 0.7143
Epoch 50/200
7/7 [==============================] - 0s - loss: 0.5193 - acc: 0.7143
Epoch 51/200
7/7 [==============================] - 0s - loss: 0.5161 - acc: 0.8571
Epoch 52/200
7/7 [==============================] - 0s - loss: 0.5132 - acc: 0.7143
Epoch 53/200
7/7 [==============================] - 0s - loss: 0.5093 - acc: 0.8571
Epoch 54/200
7/7 [==============================] - 0s - loss: 0.5070 - acc: 0.8571
Epoch 55/200
7/7 [==============================] - 0s - loss: 0.5038 - acc: 0.8571
Epoch 56/200
7/7 [==============================] - 0s - loss: 0.5003 - acc: 0.8571
Epoch 57/200
7/7 [==============================] - 0s - loss: 0.4974 - acc: 0.8571
Epoch 58/200
7/7 [==============================] - 0s - loss: 0.4942 - acc: 0.8571
Epoch 59/200
7/7 [==============================] - 0s - loss: 0.4909 - acc: 0.8571
Epoch 60/200
7/7 [==============================] - 0s - loss: 0.4873 - acc: 1.0000
Epoch 61/200
7/7 [==============================] - 0s - loss: 0.4844 - acc: 1.0000
Epoch 62/200
7/7 [==============================] - 0s - loss: 0.4810 - acc: 1.0000
Epoch 63/200
7/7 [==============================] - 0s - loss: 0.4779 - acc: 1.0000
Epoch 64/200
7/7 [==============================] - 0s - loss: 0.4747 - acc: 1.0000
Epoch 65/200
7/7 [==============================] - 0s - loss: 0.4716 - acc: 1.0000
Epoch 66/200
7/7 [==============================] - 0s - loss: 0.4685 - acc: 1.0000
Epoch 67/200
7/7 [==============================] - 0s - loss: 0.4650 - acc: 1.0000
Epoch 68/200
7/7 [==============================] - 0s - loss: 0.4615 - acc: 1.0000
Epoch 69/200
7/7 [==============================] - 0s - loss: 0.4583 - acc: 1.0000
Epoch 70/200
7/7 [==============================] - 0s - loss: 0.4552 - acc: 1.0000
Epoch 71/200
7/7 [==============================] - 0s - loss: 0.4513 - acc: 1.0000
Epoch 72/200
7/7 [==============================] - 0s - loss: 0.4484 - acc: 1.0000
Epoch 73/200
7/7 [==============================] - 0s - loss: 0.4456 - acc: 1.0000
Epoch 74/200
7/7 [==============================] - 0s - loss: 0.4418 - acc: 1.0000
Epoch 75/200
7/7 [==============================] - 0s - loss: 0.4377 - acc: 1.0000
Epoch 76/200
7/7 [==============================] - 0s - loss: 0.4355 - acc: 1.0000
Epoch 77/200
7/7 [==============================] - 0s - loss: 0.4319 - acc: 1.0000
Epoch 78/200
7/7 [==============================] - 0s - loss: 0.4283 - acc: 1.0000
Epoch 79/200
7/7 [==============================] - 0s - loss: 0.4252 - acc: 1.0000
Epoch 80/200
7/7 [==============================] - 0s - loss: 0.4221 - acc: 1.0000
Epoch 81/200
7/7 [==============================] - 0s - loss: 0.4187 - acc: 1.0000
Epoch 82/200
7/7 [==============================] - 0s - loss: 0.4152 - acc: 1.0000
Epoch 83/200
7/7 [==============================] - 0s - loss: 0.4120 - acc: 1.0000
Epoch 84/200
7/7 [==============================] - 0s - loss: 0.4081 - acc: 1.0000
Epoch 85/200
7/7 [==============================] - 0s - loss: 0.4056 - acc: 1.0000
Epoch 86/200
7/7 [==============================] - 0s - loss: 0.4023 - acc: 1.0000
Epoch 87/200
7/7 [==============================] - 0s - loss: 0.3985 - acc: 1.0000
Epoch 88/200
7/7 [==============================] - 0s - loss: 0.3957 - acc: 1.0000
Epoch 89/200
7/7 [==============================] - 0s - loss: 0.3920 - acc: 1.0000
Epoch 90/200
7/7 [==============================] - 0s - loss: 0.3893 - acc: 1.0000
Epoch 91/200
7/7 [==============================] - 0s - loss: 0.3860 - acc: 1.0000
Epoch 92/200
7/7 [==============================] - 0s - loss: 0.3826 - acc: 1.0000
Epoch 93/200
7/7 [==============================] - 0s - loss: 0.3792 - acc: 1.0000
Epoch 94/200
7/7 [==============================] - 0s - loss: 0.3758 - acc: 1.0000
Epoch 95/200
7/7 [==============================] - 0s - loss: 0.3722 - acc: 1.0000
Epoch 96/200
7/7 [==============================] - 0s - loss: 0.3694 - acc: 1.0000
Epoch 97/200
7/7 [==============================] - 0s - loss: 0.3655 - acc: 1.0000
Epoch 98/200
7/7 [==============================] - 0s - loss: 0.3637 - acc: 1.0000
Epoch 99/200
7/7 [==============================] - 0s - loss: 0.3598 - acc: 1.0000
Epoch 100/200
7/7 [==============================] - 0s - loss: 0.3570 - acc: 1.0000
Epoch 101/200
7/7 [==============================] - 0s - loss: 0.3538 - acc: 1.0000
Epoch 102/200
7/7 [==============================] - 0s - loss: 0.3507 - acc: 1.0000
Epoch 103/200
7/7 [==============================] - 0s - loss: 0.3476 - acc: 1.0000
Epoch 104/200
7/7 [==============================] - 0s - loss: 0.3440 - acc: 1.0000
Epoch 105/200
7/7 [==============================] - 0s - loss: 0.3415 - acc: 1.0000
Epoch 106/200
7/7 [==============================] - 0s - loss: 0.3386 - acc: 1.0000
Epoch 107/200
7/7 [==============================] - 0s - loss: 0.3351 - acc: 1.0000
Epoch 108/200
7/7 [==============================] - 0s - loss: 0.3317 - acc: 1.0000
Epoch 109/200
7/7 [==============================] - 0s - loss: 0.3294 - acc: 1.0000
Epoch 110/200
7/7 [==============================] - 0s - loss: 0.3256 - acc: 1.0000
Epoch 111/200
7/7 [==============================] - 0s - loss: 0.3230 - acc: 1.0000
Epoch 112/200
7/7 [==============================] - 0s - loss: 0.3196 - acc: 1.0000
Epoch 113/200
7/7 [==============================] - 0s - loss: 0.3163 - acc: 1.0000
Epoch 114/200
7/7 [==============================] - 0s - loss: 0.3133 - acc: 1.0000
Epoch 115/200
7/7 [==============================] - 0s - loss: 0.3105 - acc: 1.0000
Epoch 116/200
7/7 [==============================] - 0s - loss: 0.3073 - acc: 1.0000
Epoch 117/200
7/7 [==============================] - 0s - loss: 0.3042 - acc: 1.0000
Epoch 118/200
7/7 [==============================] - 0s - loss: 0.3008 - acc: 1.0000
Epoch 119/200
7/7 [==============================] - 0s - loss: 0.2981 - acc: 1.0000
Epoch 120/200
7/7 [==============================] - 0s - loss: 0.2949 - acc: 1.0000
Epoch 121/200
7/7 [==============================] - 0s - loss: 0.2919 - acc: 1.0000
Epoch 122/200
7/7 [==============================] - 0s - loss: 0.2883 - acc: 1.0000
Epoch 123/200
7/7 [==============================] - 0s - loss: 0.2855 - acc: 1.0000
Epoch 124/200
7/7 [==============================] - 0s - loss: 0.2821 - acc: 1.0000
Epoch 125/200
7/7 [==============================] - 0s - loss: 0.2789 - acc: 1.0000
Epoch 126/200
7/7 [==============================] - 0s - loss: 0.2759 - acc: 1.0000
Epoch 127/200
7/7 [==============================] - 0s - loss: 0.2726 - acc: 1.0000
Epoch 128/200
7/7 [==============================] - 0s - loss: 0.2697 - acc: 1.0000
Epoch 129/200
7/7 [==============================] - 0s - loss: 0.2665 - acc: 1.0000
Epoch 130/200
7/7 [==============================] - 0s - loss: 0.2632 - acc: 1.0000
Epoch 131/200
7/7 [==============================] - 0s - loss: 0.2603 - acc: 1.0000
Epoch 132/200
7/7 [==============================] - 0s - loss: 0.2572 - acc: 1.0000
Epoch 133/200
7/7 [==============================] - 0s - loss: 0.2536 - acc: 1.0000
Epoch 134/200
7/7 [==============================] - 0s - loss: 0.2506 - acc: 1.0000
Epoch 135/200
7/7 [==============================] - 0s - loss: 0.2480 - acc: 1.0000
Epoch 136/200
7/7 [==============================] - 0s - loss: 0.2449 - acc: 1.0000
Epoch 137/200
7/7 [==============================] - 0s - loss: 0.2418 - acc: 1.0000
Epoch 138/200
7/7 [==============================] - 0s - loss: 0.2388 - acc: 1.0000
Epoch 139/200
7/7 [==============================] - 0s - loss: 0.2352 - acc: 1.0000
Epoch 140/200
7/7 [==============================] - 0s - loss: 0.2330 - acc: 1.0000
Epoch 141/200
7/7 [==============================] - 0s - loss: 0.2296 - acc: 1.0000
Epoch 142/200
7/7 [==============================] - 0s - loss: 0.2273 - acc: 1.0000
Epoch 143/200
7/7 [==============================] - 0s - loss: 0.2239 - acc: 1.0000
Epoch 144/200
7/7 [==============================] - 0s - loss: 0.2217 - acc: 1.0000
Epoch 145/200
7/7 [==============================] - 0s - loss: 0.2183 - acc: 1.0000
Epoch 146/200
7/7 [==============================] - 0s - loss: 0.2161 - acc: 1.0000
Epoch 147/200
7/7 [==============================] - 0s - loss: 0.2130 - acc: 1.0000
Epoch 148/200
7/7 [==============================] - 0s - loss: 0.2102 - acc: 1.0000
Epoch 149/200
7/7 [==============================] - 0s - loss: 0.2077 - acc: 1.0000
Epoch 150/200
7/7 [==============================] - 0s - loss: 0.2050 - acc: 1.0000
Epoch 151/200
7/7 [==============================] - 0s - loss: 0.2018 - acc: 1.0000
Epoch 152/200
7/7 [==============================] - 0s - loss: 0.1986 - acc: 1.0000
Epoch 153/200
7/7 [==============================] - 0s - loss: 0.1965 - acc: 1.0000
Epoch 154/200
7/7 [==============================] - 0s - loss: 0.1936 - acc: 1.0000
Epoch 155/200
7/7 [==============================] - 0s - loss: 0.1909 - acc: 1.0000
Epoch 156/200
7/7 [==============================] - 0s - loss: 0.1883 - acc: 1.0000
Epoch 157/200
7/7 [==============================] - 0s - loss: 0.1859 - acc: 1.0000
Epoch 158/200
7/7 [==============================] - 0s - loss: 0.1825 - acc: 1.0000
Epoch 159/200
7/7 [==============================] - 0s - loss: 0.1810 - acc: 1.0000
Epoch 160/200
7/7 [==============================] - 0s - loss: 0.1779 - acc: 1.0000
Epoch 161/200
7/7 [==============================] - 0s - loss: 0.1749 - acc: 1.0000
Epoch 162/200
7/7 [==============================] - 0s - loss: 0.1725 - acc: 1.0000
Epoch 163/200
7/7 [==============================] - 0s - loss: 0.1705 - acc: 1.0000
Epoch 164/200
7/7 [==============================] - 0s - loss: 0.1677 - acc: 1.0000
Epoch 165/200
7/7 [==============================] - 0s - loss: 0.1654 - acc: 1.0000
Epoch 166/200
7/7 [==============================] - 0s - loss: 0.1629 - acc: 1.0000
Epoch 167/200
7/7 [==============================] - 0s - loss: 0.1603 - acc: 1.0000
Epoch 168/200
7/7 [==============================] - 0s - loss: 0.1578 - acc: 1.0000
Epoch 169/200
7/7 [==============================] - 0s - loss: 0.1551 - acc: 1.0000
Epoch 170/200
7/7 [==============================] - 0s - loss: 0.1528 - acc: 1.0000
Epoch 171/200
7/7 [==============================] - 0s - loss: 0.1505 - acc: 1.0000
Epoch 172/200
7/7 [==============================] - 0s - loss: 0.1482 - acc: 1.0000
Epoch 173/200
7/7 [==============================] - 0s - loss: 0.1460 - acc: 1.0000
Epoch 174/200
7/7 [==============================] - 0s - loss: 0.1438 - acc: 1.0000
Epoch 175/200
7/7 [==============================] - 0s - loss: 0.1413 - acc: 1.0000
Epoch 176/200
7/7 [==============================] - 0s - loss: 0.1391 - acc: 1.0000
Epoch 177/200
7/7 [==============================] - 0s - loss: 0.1365 - acc: 1.0000
Epoch 178/200
7/7 [==============================] - 0s - loss: 0.1346 - acc: 1.0000
Epoch 179/200
7/7 [==============================] - 0s - loss: 0.1321 - acc: 1.0000
Epoch 180/200
7/7 [==============================] - 0s - loss: 0.1301 - acc: 1.0000
Epoch 181/200
7/7 [==============================] - 0s - loss: 0.1282 - acc: 1.0000
Epoch 182/200
7/7 [==============================] - 0s - loss: 0.1259 - acc: 1.0000
Epoch 183/200
7/7 [==============================] - 0s - loss: 0.1234 - acc: 1.0000
Epoch 184/200
7/7 [==============================] - 0s - loss: 0.1215 - acc: 1.0000
Epoch 185/200
7/7 [==============================] - 0s - loss: 0.1193 - acc: 1.0000
Epoch 186/200
7/7 [==============================] - 0s - loss: 0.1172 - acc: 1.0000
Epoch 187/200
7/7 [==============================] - 0s - loss: 0.1154 - acc: 1.0000
Epoch 188/200
7/7 [==============================] - 0s - loss: 0.1143 - acc: 1.0000
Epoch 189/200
7/7 [==============================] - 0s - loss: 0.1118 - acc: 1.0000
Epoch 190/200
7/7 [==============================] - 0s - loss: 0.1094 - acc: 1.0000
Epoch 191/200
7/7 [==============================] - 0s - loss: 0.1078 - acc: 1.0000
Epoch 192/200
7/7 [==============================] - 0s - loss: 0.1058 - acc: 1.0000
Epoch 193/200
7/7 [==============================] - 0s - loss: 0.1042 - acc: 1.0000
Epoch 194/200
7/7 [==============================] - 0s - loss: 0.1021 - acc: 1.0000
Epoch 195/200
7/7 [==============================] - 0s - loss: 0.1000 - acc: 1.0000
Epoch 196/200
7/7 [==============================] - 0s - loss: 0.0984 - acc: 1.0000
Epoch 197/200
7/7 [==============================] - 0s - loss: 0.0963 - acc: 1.0000
Epoch 198/200
7/7 [==============================] - 0s - loss: 0.0948 - acc: 1.0000
Epoch 199/200
7/7 [==============================] - 0s - loss: 0.0928 - acc: 1.0000
Epoch 200/200
7/7 [==============================] - 0s - loss: 0.0908 - acc: 1.0000
1/8 [==>...........................] - ETA: 0sScore [0.68034101324155927, 0.625]
predictions and labels
8/8 [==============================] - 0s
[[1]
[0]
[0]
[1]
[1]
[1]
[0]
[0]] [1 0 0 0 1 1 1 1]

In [ ]: