0
点赞
收藏
分享

微信扫一扫

tensorflow1-3

你的益达233 2022-04-21 阅读 51

Table of Contents

常用函数

import pandas as pd
import numpy as np
import tensorflow as tf
# 创建张量
# tf.constant(张量内容,dtype = 数据类型)
a=tf.constant([1,5],dtype= tf.float32)
print(a)
print(a.dtype)
print(a.shape)  #结果用逗号隔开几个元素,就是几维

# numpy转换数据类型为tf.tensor:tf.convert_to_tensor(数据名,dtype = 数据类型)
a = np.arange(0,5)
b = tf.convert_to_tensor(a,dtype = tf.float64)

a = tf.ones([2,4])   #中括号里面是维度
s = tf.zeros([2,3])
s = tf.fill([2,3],3)

#正太分布的随机数,默认均值为0,标准差为1
tf.random.normal(维度,mean=均值,stddev = 标准差)
#生成截断式正态分布的随机数,取值在均值加减二倍标准差的范围,
tf.random.truncated_normal(维度,mean=0,stddev = 标准差)
# 均匀分布
tf.random.uniform(维度,minval=最小值,maxval=最大值)

#强制tensor转换数据类型
tf.cast(张量名,dtype = 数据类型)
# 计算最小最大
tf.reduce_min(a,axis = 0)  #不加axis,表示全局最小,加上表示维度最小,0表示跨行,1表示跨列
tf.reduce_max(a) #
tf.reduce_mean(a,axis=0)
tf.reduce_sum(a,axis=0)

#该函数将变量标记为可训练,会在反向传播中记录梯度信息。在神经网络中,该函数用来标记训练参数
tf.Variable(初始值)
tf.Variable(tf.random.normal([2,2],mean=0,stddev=1))

#四则运算,对应元素处理,只有维度相同的张量可以运算
tf.add(a,b),  tf.substract,  tf.multiply,  tf.divide,  
tf.square(a)平方,   tf.pow(a,3)次方,  tf.sqrt开方,  tf.matmul()矩阵乘法


#切分张量传入的第一个维度,生成输入特征和标签对,构建数据集,
# numpy和tensor格式都可以该语句读入数据
data=tf.data.Dataset.from_tensor_slices((输入特征,标签))

#遍历
enumerate(li)一般在for循环中使用,可以遍历列表,元组,字符串中
Tensor("Const_5:0", shape=(2,), dtype=float32)
<dtype: 'float32'>
(2,)
feature = tf.constant([[12,23,10,17],[1,2,3,4],[2,3,4,5],[3,4,5,6]])
labels = tf.constant([0,1,1,0])
dataset = tf.data.Dataset.from_tensor_slices((feature,labels))
print(dataset)
for i,(x,y) in enumerate(dataset):
    print(i,x,y)
<TensorSliceDataset shapes: ((4,), ()), types: (tf.int32, tf.int32)>
0 tf.Tensor([12 23 10 17], shape=(4,), dtype=int32) tf.Tensor(0, shape=(), dtype=int32)
1 tf.Tensor([1 2 3 4], shape=(4,), dtype=int32) tf.Tensor(1, shape=(), dtype=int32)
2 tf.Tensor([2 3 4 5], shape=(4,), dtype=int32) tf.Tensor(1, shape=(), dtype=int32)
3 tf.Tensor([3 4 5 6], shape=(4,), dtype=int32) tf.Tensor(0, shape=(), dtype=int32)
# 计算梯度,实现函数对参数的求导
with tf.GradientTape() as tape:
    w = tf.Variable(tf.constant(3.0))
    loss = tf.pow(w,2)
grad = tape.gradient(loss,w)
print(grad)
tf.Tensor(6.0, shape=(), dtype=float32)
# 独热编码  tf.one_hot(待准换数据,depth=几类) 分类问题中常用独热编码做标签,1为是,0为非
classes = 3
labels = tf.constant([1,0,2])
output = tf.one_hot(labels,depth = classes)
print(output)

tf.Tensor(
[[0. 1. 0.]
 [1. 0. 0.]
 [0. 0. 1.]], shape=(3, 3), dtype=float32)
# 激活函数  tf.nn.softmax(x),使得输出符合概率分布,进行了非负数化和归一化
# softmax(yi) = (e^yi)/(sum(e^yi))
y = tf.constant([1.01, 2.01, -0.66])
y_pro = tf.nn.softmax(y)
print('after softmax ,y_pro is : ',y_pro)
after softmax ,y_pro is :  tf.Tensor([0.25598174 0.69583046 0.04818781], shape=(3,), dtype=float32)
# 参数更新  w.assign_sub(num)  w必须是可训练的,相当于减等
w = tf.Variable(4)
w.assign_sub(1)
print(w)
<tf.Variable 'Variable:0' shape=() dtype=int32, numpy=3>
a=tf.Variable(tf.constant([3]))
b=int(a)+1
print(b)
4
# 返回最大值索引  tf.argmax(a,axis=0)
test= np.array([[1,2,3],[2,3,4],[5,4,3],[8,7,2]])
print(tf.argmax(test,axis = 0))
print(tf.argmax(test,axis = 1))
tf.Tensor([3 3 1], shape=(3,), dtype=int64)
tf.Tensor([2 2 0 0], shape=(4,), dtype=int64)
# 函数:str.format() 通过{}和:代替%,

site = {"name": "菜鸟教程", "url": "www.runoob.com"}
print("网站名:{name}, 地址 {url}".format(**site))

my_list = ['菜鸟教程', 'www.runoob.com']
print("网站名:{0[0]}, 地址 {0[1]}".format(my_list))

"{0} {1} ".format("hello", "world")   #可以设置指定位置

神经网络实现鸢尾花分类步骤:

1、数据准备:
    数据读入
    数据集乱序
    生成训练集和测试机
    配对
2、搭建网络
    定义网络中所有可以训练的参数
3、参数优化
    嵌套循环迭代,with结构更新参数,显示当前loss
4、测试效果
    计算当前参数前向传播后的准确率,显示当前acc
5、acc/loss可视化
import pandas as pd
from sklearn.datasets import load_iris
x_data = load_iris().data   # 返回输入特征
y_data = load_iris().target  #返回数据集标签

x_data = pd.DataFrame(x_data,columns = ['花萼长度','花萼宽度','花瓣长度','花瓣宽度'])
pd.set_option('display.unicode.east_asian_width',True)  #设置列名对其
print('x_data add index:\n',x_data)

x_data['类别'] = y_data
print('x_data add a column: \n',x_data)


x_data add index:
      花萼长度  花萼宽度  花瓣长度  花瓣宽度
0         5.1       3.5       1.4       0.2
1         4.9       3.0       1.4       0.2
2         4.7       3.2       1.3       0.2
3         4.6       3.1       1.5       0.2
4         5.0       3.6       1.4       0.2
..        ...       ...       ...       ...
145       6.7       3.0       5.2       2.3
146       6.3       2.5       5.0       1.9
147       6.5       3.0       5.2       2.0
148       6.2       3.4       5.4       2.3
149       5.9       3.0       5.1       1.8

[150 rows x 4 columns]
x_data add a column: 
      花萼长度  花萼宽度  花瓣长度  花瓣宽度  类别
0         5.1       3.5       1.4       0.2     0
1         4.9       3.0       1.4       0.2     0
2         4.7       3.2       1.3       0.2     0
3         4.6       3.1       1.5       0.2     0
4         5.0       3.6       1.4       0.2     0
..        ...       ...       ...       ...   ...
145       6.7       3.0       5.2       2.3     2
146       6.3       2.5       5.0       1.9     2
147       6.5       3.0       5.2       2.0     2
148       6.2       3.4       5.4       2.3     2
149       5.9       3.0       5.1       1.8     2

[150 rows x 5 columns]
# 1、数据准备
import tensorflow as tf
import pandas as pd
from sklearn.datasets import load_iris
x_data = load_iris().data   # 返回输入特征
y_data = load_iris().target  #返回数据集标签
# 乱序
np.random.seed(116)
np.random.shuffle(x_data)
np.random.seed(116)
np.random.shuffle(y_data)
tf.random.set_seed(116)
# 将数据集分为训练集和测试集
x_train = x_data[:-30]
y_train = y_data[:-30]
x_test = x_data[-30:]
y_test = y_data[-30:]
# 配对
train_db = tf.data.Dataset.from_tensor_slices((x_train,y_train)).batch(32)
test_db = tf.data.Dataset.from_tensor_slices((x_test,y_test)).batch(32)

# 2、搭建网络,参数优化
# 定义参数:4个输入特征,,所以输入层为4个节点,结果类为3类,输出层为3个神经元
w1 = tf.Variable(tf.random.truncated_normal([4,3], stddev = 0.1, seed = 1))
b1 = tf.Variable(tf.random.truncated_normal([3],stddev=0.1, seed = 1))

lr = 0.1  #学习率
train_loss_results = []   #记录每轮的loss,为后续画图做准备
test_acc = []  #记录每轮acc
epoch = 500   #循环500轮
loss_all = 0 #每轮分为4step,loss_all记录四个step生成的四个loss


# 嵌套循环迭代,with结构更新参数,显示当前loss
# 训练部分
for epoch in range(epoch):
    for step,(x_train,y_train) in enumerate(train_db):
        x_train = tf.cast(x_train, dtype = w1.dtype)
        with tf.GradientTape() as tape:
            y = tf.matmul(x_train,w1) + b1
            y = tf.nn.softmax(y)
            y_1 = tf.one_hot(y_train, depth=3)
            loss = tf.reduce_mean(tf.square(y_1 - y))
            print(loss)
            loss_all += loss.numpy()
        # 计算loss对各个参数的梯度
        grads = tape.gradient(loss,[w1,b1])
        
        
        # 实现梯度更新 
        w1.assign_sub(lr * grads[0])
        b1.assign_sub(lr * grads[1])
    
    print('Epoch: {},loss: {}'.format(epoch,loss_all/4))
    train_loss_results.append(loss_all/4)
    loss_all = 0
    
    # 测试部分
    # total_correct为预测对的样本个数,total_number 为测试的总样本数,将这两个样本都初始化
    total_correct,total_number = 0,0
    for x_test,y_test in test_db:
        
        y = tf.matmul(tf.cast(x_test,dtype=w1.dtype),w1) + b1
        y = tf.nn.softmax(y)
        # 返回最大值的索引,也就是预测的分类
        pred = tf.argmax(y,axis = 1)
        # 将预测值转换为原始数据集格式
        pred = tf.cast(pred,dtype = y_test.dtype)
        # 若分类正确,则correct+1,否则为0,将bool类型转换为int类型
        correct = tf.cast(tf.equal(pred,y_test),dtype = tf.int32)
        correct = tf.reduce_sum(correct)
        total_correct += int(correct)
        total_number += x_test.shape[0]
    # 总的准确率等于total_correct/total_number
    acc = total_correct/total_number
    test_acc.append(acc)

    
tf.Tensor(0.33104187, shape=(), dtype=float32)
tf.Tensor(0.28411582, shape=(), dtype=float32)
tf.Tensor(0.28411487, shape=(), dtype=float32)
tf.Tensor(0.2292518, shape=(), dtype=float32)
Epoch: 0,loss: 0.282131090760231
test_acc:  0.16666666666666666
-----------------------------------
tf.Tensor(0.31756583, shape=(), dtype=float32)
tf.Tensor(0.24761875, shape=(), dtype=float32)
tf.Tensor(0.24895136, shape=(), dtype=float32)
tf.Tensor(0.20424862, shape=(), dtype=float32)
Epoch: 1,loss: 0.25459614023566246
test_acc:  0.16666666666666666
-----------------------------------
tf.Tensor(0.27454078, shape=(), dtype=float32)
tf.Tensor(0.22194922, shape=(), dtype=float32)
tf.Tensor(0.2192683, shape=(), dtype=float32)
tf.Tensor(0.18705167, shape=(), dtype=float32)
Epoch: 2,loss: 0.22570249438285828
test_acc:  0.16666666666666666
-----------------------------------
tf.Tensor(0.24604546, shape=(), dtype=float32)
tf.Tensor(0.21204929, shape=(), dtype=float32)
tf.Tensor(0.20379692, shape=(), dtype=float32)
tf.Tensor(0.17924434, shape=(), dtype=float32)
Epoch: 3,loss: 0.21028400212526321
test_acc:  0.16666666666666666
-----------------------------------
tf.Tensor(0.23131944, shape=(), dtype=float32)
tf.Tensor(0.19943242, shape=(), dtype=float32)
tf.Tensor(0.1944931, shape=(), dtype=float32)
tf.Tensor(0.17244564, shape=(), dtype=float32)
Epoch: 4,loss: 0.19942265003919601
test_acc:  0.16666666666666666
-----------------------------------
tf.Tensor(0.21819659, shape=(), dtype=float32)
tf.Tensor(0.18468428, shape=(), dtype=float32)
tf.Tensor(0.18625486, shape=(), dtype=float32)
tf.Tensor(0.1658098, shape=(), dtype=float32)
Epoch: 5,loss: 0.18873637914657593
test_acc:  0.5
-----------------------------------
tf.Tensor(0.20543306, shape=(), dtype=float32)
tf.Tensor(0.17076008, shape=(), dtype=float32)
tf.Tensor(0.17837131, shape=(), dtype=float32)
tf.Tensor(0.15948753, shape=(), dtype=float32)
Epoch: 6,loss: 0.17851299419999123
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.19357759, shape=(), dtype=float32)
tf.Tensor(0.15862869, shape=(), dtype=float32)
tf.Tensor(0.17099433, shape=(), dtype=float32)
tf.Tensor(0.15371445, shape=(), dtype=float32)
Epoch: 7,loss: 0.16922876238822937
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.18298475, shape=(), dtype=float32)
tf.Tensor(0.14842011, shape=(), dtype=float32)
tf.Tensor(0.1643079, shape=(), dtype=float32)
tf.Tensor(0.14859414, shape=(), dtype=float32)
Epoch: 8,loss: 0.16107672825455666
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.17375451, shape=(), dtype=float32)
tf.Tensor(0.13993742, shape=(), dtype=float32)
tf.Tensor(0.15837607, shape=(), dtype=float32)
tf.Tensor(0.14411938, shape=(), dtype=float32)
Epoch: 9,loss: 0.15404684469103813
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.16581891, shape=(), dtype=float32)
tf.Tensor(0.13289301, shape=(), dtype=float32)
tf.Tensor(0.1531689, shape=(), dtype=float32)
tf.Tensor(0.14022821, shape=(), dtype=float32)
Epoch: 10,loss: 0.14802725985646248
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.15903042, shape=(), dtype=float32)
tf.Tensor(0.12700975, shape=(), dtype=float32)
tf.Tensor(0.14861093, shape=(), dtype=float32)
tf.Tensor(0.13684103, shape=(), dtype=float32)
Epoch: 11,loss: 0.14287303388118744
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.15321958, shape=(), dtype=float32)
tf.Tensor(0.12205375, shape=(), dtype=float32)
tf.Tensor(0.14461316, shape=(), dtype=float32)
tf.Tensor(0.13387915, shape=(), dtype=float32)
Epoch: 12,loss: 0.1384414117783308
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.1482247, shape=(), dtype=float32)
tf.Tensor(0.11783805, shape=(), dtype=float32)
tf.Tensor(0.1410893, shape=(), dtype=float32)
tf.Tensor(0.13127224, shape=(), dtype=float32)
Epoch: 13,loss: 0.13460607267916203
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.14390375, shape=(), dtype=float32)
tf.Tensor(0.114216186, shape=(), dtype=float32)
tf.Tensor(0.1379625, shape=(), dtype=float32)
tf.Tensor(0.12896046, shape=(), dtype=float32)
Epoch: 14,loss: 0.13126072473824024
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.14013743, shape=(), dtype=float32)
tf.Tensor(0.11107399, shape=(), dtype=float32)
tf.Tensor(0.13516738, shape=(), dtype=float32)
tf.Tensor(0.12689407, shape=(), dtype=float32)
Epoch: 15,loss: 0.12831821851432323
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.13682781, shape=(), dtype=float32)
tf.Tensor(0.1083223, shape=(), dtype=float32)
tf.Tensor(0.13264951, shape=(), dtype=float32)
tf.Tensor(0.12503222, shape=(), dtype=float32)
Epoch: 16,loss: 0.12570795975625515
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.13389532, shape=(), dtype=float32)
tf.Tensor(0.10589113, shape=(), dtype=float32)
tf.Tensor(0.13036402, shape=(), dtype=float32)
tf.Tensor(0.12334148, shape=(), dtype=float32)
Epoch: 17,loss: 0.12337298691272736
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.13127582, shape=(), dtype=float32)
tf.Tensor(0.103725106, shape=(), dtype=float32)
tf.Tensor(0.1282743, shape=(), dtype=float32)
tf.Tensor(0.12179465, shape=(), dtype=float32)
Epoch: 18,loss: 0.12126746959984303
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.12891747, shape=(), dtype=float32)
tf.Tensor(0.10178015, shape=(), dtype=float32)
tf.Tensor(0.12635027, shape=(), dtype=float32)
tf.Tensor(0.12036942, shape=(), dtype=float32)
Epoch: 19,loss: 0.11935432627797127
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.12677841, shape=(), dtype=float32)
tf.Tensor(0.10002086, shape=(), dtype=float32)
tf.Tensor(0.12456739, shape=(), dtype=float32)
tf.Tensor(0.11904756, shape=(), dtype=float32)
Epoch: 20,loss: 0.11760355532169342
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.12482462, shape=(), dtype=float32)
tf.Tensor(0.09841865, shape=(), dtype=float32)
tf.Tensor(0.12290543, shape=(), dtype=float32)
tf.Tensor(0.117814, shape=(), dtype=float32)
Epoch: 21,loss: 0.11599067598581314
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.12302842, shape=(), dtype=float32)
tf.Tensor(0.096950226, shape=(), dtype=float32)
tf.Tensor(0.12134772, shape=(), dtype=float32)
tf.Tensor(0.116656385, shape=(), dtype=float32)
Epoch: 22,loss: 0.11449568718671799
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.12136707, shape=(), dtype=float32)
tf.Tensor(0.095596455, shape=(), dtype=float32)
tf.Tensor(0.119880415, shape=(), dtype=float32)
tf.Tensor(0.11556438, shape=(), dtype=float32)
Epoch: 23,loss: 0.11310208030045033
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.11982187, shape=(), dtype=float32)
tf.Tensor(0.094341554, shape=(), dtype=float32)
tf.Tensor(0.118492015, shape=(), dtype=float32)
tf.Tensor(0.11452942, shape=(), dtype=float32)
Epoch: 24,loss: 0.11179621517658234
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.11837729, shape=(), dtype=float32)
tf.Tensor(0.09317243, shape=(), dtype=float32)
tf.Tensor(0.117172875, shape=(), dtype=float32)
tf.Tensor(0.11354428, shape=(), dtype=float32)
Epoch: 25,loss: 0.11056671850383282
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.117020406, shape=(), dtype=float32)
tf.Tensor(0.09207811, shape=(), dtype=float32)
tf.Tensor(0.115914874, shape=(), dtype=float32)
tf.Tensor(0.112602934, shape=(), dtype=float32)
Epoch: 26,loss: 0.10940408147871494
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.11574038, shape=(), dtype=float32)
tf.Tensor(0.09104935, shape=(), dtype=float32)
tf.Tensor(0.11471111, shape=(), dtype=float32)
tf.Tensor(0.11170028, shape=(), dtype=float32)
Epoch: 27,loss: 0.10830028168857098
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.11452808, shape=(), dtype=float32)
tf.Tensor(0.090078354, shape=(), dtype=float32)
tf.Tensor(0.11355579, shape=(), dtype=float32)
tf.Tensor(0.110831976, shape=(), dtype=float32)
Epoch: 28,loss: 0.10724855028092861
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.11337578, shape=(), dtype=float32)
tf.Tensor(0.089158505, shape=(), dtype=float32)
tf.Tensor(0.11244393, shape=(), dtype=float32)
tf.Tensor(0.10999431, shape=(), dtype=float32)
Epoch: 29,loss: 0.10624313168227673
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.11227691, shape=(), dtype=float32)
tf.Tensor(0.08828411, shape=(), dtype=float32)
tf.Tensor(0.11137125, shape=(), dtype=float32)
tf.Tensor(0.10918413, shape=(), dtype=float32)
Epoch: 30,loss: 0.10527910105884075
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.11122581, shape=(), dtype=float32)
tf.Tensor(0.08745032, shape=(), dtype=float32)
tf.Tensor(0.110334046, shape=(), dtype=float32)
tf.Tensor(0.108398706, shape=(), dtype=float32)
Epoch: 31,loss: 0.10435222089290619
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.11021767, shape=(), dtype=float32)
tf.Tensor(0.08665291, shape=(), dtype=float32)
tf.Tensor(0.10932914, shape=(), dtype=float32)
tf.Tensor(0.1076357, shape=(), dtype=float32)
Epoch: 32,loss: 0.10345885530114174
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.10924832, shape=(), dtype=float32)
tf.Tensor(0.08588829, shape=(), dtype=float32)
tf.Tensor(0.10835379, shape=(), dtype=float32)
tf.Tensor(0.10689311, shape=(), dtype=float32)
Epoch: 33,loss: 0.10259587690234184
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.10831413, shape=(), dtype=float32)
tf.Tensor(0.08515326, shape=(), dtype=float32)
tf.Tensor(0.10740557, shape=(), dtype=float32)
tf.Tensor(0.10616915, shape=(), dtype=float32)
Epoch: 34,loss: 0.10176052711904049
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.10741196, shape=(), dtype=float32)
tf.Tensor(0.08444508, shape=(), dtype=float32)
tf.Tensor(0.10648236, shape=(), dtype=float32)
tf.Tensor(0.10546228, shape=(), dtype=float32)
Epoch: 35,loss: 0.10095041990280151
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.10653906, shape=(), dtype=float32)
tf.Tensor(0.083761334, shape=(), dtype=float32)
tf.Tensor(0.1055823, shape=(), dtype=float32)
tf.Tensor(0.104771204, shape=(), dtype=float32)
Epoch: 36,loss: 0.10016347467899323
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.105693035, shape=(), dtype=float32)
tf.Tensor(0.08309988, shape=(), dtype=float32)
tf.Tensor(0.10470378, shape=(), dtype=float32)
tf.Tensor(0.104094714, shape=(), dtype=float32)
Epoch: 37,loss: 0.09939785115420818
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.10487175, shape=(), dtype=float32)
tf.Tensor(0.08245888, shape=(), dtype=float32)
tf.Tensor(0.10384532, shape=(), dtype=float32)
tf.Tensor(0.10343178, shape=(), dtype=float32)
Epoch: 38,loss: 0.098651934415102
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.104073346, shape=(), dtype=float32)
tf.Tensor(0.08183666, shape=(), dtype=float32)
tf.Tensor(0.10300564, shape=(), dtype=float32)
tf.Tensor(0.102781504, shape=(), dtype=float32)
Epoch: 39,loss: 0.09792428836226463
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.10329616, shape=(), dtype=float32)
tf.Tensor(0.08123176, shape=(), dtype=float32)
tf.Tensor(0.1021836, shape=(), dtype=float32)
tf.Tensor(0.10214308, shape=(), dtype=float32)
Epoch: 40,loss: 0.09721365012228489
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.10253874, shape=(), dtype=float32)
tf.Tensor(0.08064285, shape=(), dtype=float32)
tf.Tensor(0.10137818, shape=(), dtype=float32)
tf.Tensor(0.1015158, shape=(), dtype=float32)
Epoch: 41,loss: 0.09651889279484749
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.101799764, shape=(), dtype=float32)
tf.Tensor(0.0800688, shape=(), dtype=float32)
tf.Tensor(0.10058848, shape=(), dtype=float32)
tf.Tensor(0.10089902, shape=(), dtype=float32)
Epoch: 42,loss: 0.09583901427686214
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.10107807, shape=(), dtype=float32)
tf.Tensor(0.079508536, shape=(), dtype=float32)
tf.Tensor(0.09981364, shape=(), dtype=float32)
tf.Tensor(0.100292176, shape=(), dtype=float32)
Epoch: 43,loss: 0.09517310559749603
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.10037261, shape=(), dtype=float32)
tf.Tensor(0.07896114, shape=(), dtype=float32)
tf.Tensor(0.099052936, shape=(), dtype=float32)
tf.Tensor(0.09969478, shape=(), dtype=float32)
Epoch: 44,loss: 0.09452036768198013
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.09968243, shape=(), dtype=float32)
tf.Tensor(0.07842579, shape=(), dtype=float32)
tf.Tensor(0.0983057, shape=(), dtype=float32)
tf.Tensor(0.09910639, shape=(), dtype=float32)
Epoch: 45,loss: 0.0938800759613514
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.09900669, shape=(), dtype=float32)
tf.Tensor(0.077901684, shape=(), dtype=float32)
tf.Tensor(0.09757132, shape=(), dtype=float32)
tf.Tensor(0.09852657, shape=(), dtype=float32)
Epoch: 46,loss: 0.09325156547129154
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.098344624, shape=(), dtype=float32)
tf.Tensor(0.077388175, shape=(), dtype=float32)
tf.Tensor(0.09684924, shape=(), dtype=float32)
tf.Tensor(0.09795496, shape=(), dtype=float32)
Epoch: 47,loss: 0.09263424947857857
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.09769555, shape=(), dtype=float32)
tf.Tensor(0.07688462, shape=(), dtype=float32)
tf.Tensor(0.09613898, shape=(), dtype=float32)
tf.Tensor(0.097391255, shape=(), dtype=float32)
Epoch: 48,loss: 0.09202760085463524
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.09705881, shape=(), dtype=float32)
tf.Tensor(0.0763905, shape=(), dtype=float32)
tf.Tensor(0.09544003, shape=(), dtype=float32)
tf.Tensor(0.09683514, shape=(), dtype=float32)
Epoch: 49,loss: 0.09143111854791641
test_acc:  0.5333333333333333
-----------------------------------
tf.Tensor(0.09643387, shape=(), dtype=float32)
tf.Tensor(0.075905256, shape=(), dtype=float32)
tf.Tensor(0.09475199, shape=(), dtype=float32)
tf.Tensor(0.096286334, shape=(), dtype=float32)
Epoch: 50,loss: 0.09084436297416687
test_acc:  0.5666666666666667
-----------------------------------
tf.Tensor(0.095820166, shape=(), dtype=float32)
tf.Tensor(0.075428456, shape=(), dtype=float32)
tf.Tensor(0.094074495, shape=(), dtype=float32)
tf.Tensor(0.09574464, shape=(), dtype=float32)
Epoch: 51,loss: 0.09026693925261497
test_acc:  0.5666666666666667
-----------------------------------
tf.Tensor(0.09521726, shape=(), dtype=float32)
tf.Tensor(0.07495967, shape=(), dtype=float32)
tf.Tensor(0.09340718, shape=(), dtype=float32)
tf.Tensor(0.095209755, shape=(), dtype=float32)
Epoch: 52,loss: 0.08969846554100513
test_acc:  0.5666666666666667
-----------------------------------
tf.Tensor(0.0946247, shape=(), dtype=float32)
tf.Tensor(0.07449853, shape=(), dtype=float32)
tf.Tensor(0.09274968, shape=(), dtype=float32)
tf.Tensor(0.09468154, shape=(), dtype=float32)
Epoch: 53,loss: 0.08913861028850079
test_acc:  0.6
-----------------------------------
tf.Tensor(0.09404206, shape=(), dtype=float32)
tf.Tensor(0.07404465, shape=(), dtype=float32)
tf.Tensor(0.09210172, shape=(), dtype=float32)
tf.Tensor(0.094159774, shape=(), dtype=float32)
Epoch: 54,loss: 0.08858705312013626
test_acc:  0.6
-----------------------------------
tf.Tensor(0.093469, shape=(), dtype=float32)
tf.Tensor(0.07359773, shape=(), dtype=float32)
tf.Tensor(0.09146301, shape=(), dtype=float32)
tf.Tensor(0.093644306, shape=(), dtype=float32)
Epoch: 55,loss: 0.08804351091384888
test_acc:  0.6
-----------------------------------
tf.Tensor(0.092905186, shape=(), dtype=float32)
tf.Tensor(0.073157474, shape=(), dtype=float32)
tf.Tensor(0.090833284, shape=(), dtype=float32)
tf.Tensor(0.09313496, shape=(), dtype=float32)
Epoch: 56,loss: 0.08750772662460804
test_acc:  0.6
-----------------------------------
tf.Tensor(0.09235028, shape=(), dtype=float32)
tf.Tensor(0.07272359, shape=(), dtype=float32)
tf.Tensor(0.09021231, shape=(), dtype=float32)
tf.Tensor(0.09263159, shape=(), dtype=float32)
Epoch: 57,loss: 0.08697944320738316
test_acc:  0.6
-----------------------------------
tf.Tensor(0.091804, shape=(), dtype=float32)
tf.Tensor(0.072295845, shape=(), dtype=float32)
tf.Tensor(0.089599825, shape=(), dtype=float32)
tf.Tensor(0.092134066, shape=(), dtype=float32)
Epoch: 58,loss: 0.08645843341946602
test_acc:  0.6
-----------------------------------
tf.Tensor(0.09126607, shape=(), dtype=float32)
tf.Tensor(0.071874, shape=(), dtype=float32)
tf.Tensor(0.088995636, shape=(), dtype=float32)
tf.Tensor(0.091642246, shape=(), dtype=float32)
Epoch: 59,loss: 0.08594448864459991
test_acc:  0.6
-----------------------------------
tf.Tensor(0.09073623, shape=(), dtype=float32)
tf.Tensor(0.07145783, shape=(), dtype=float32)
tf.Tensor(0.08839955, shape=(), dtype=float32)
tf.Tensor(0.091156036, shape=(), dtype=float32)
Epoch: 60,loss: 0.08543741330504417
test_acc:  0.6
-----------------------------------
tf.Tensor(0.09021426, shape=(), dtype=float32)
tf.Tensor(0.07104715, shape=(), dtype=float32)
tf.Tensor(0.08781134, shape=(), dtype=float32)
tf.Tensor(0.09067532, shape=(), dtype=float32)
Epoch: 61,loss: 0.08493701741099358
test_acc:  0.6
-----------------------------------
tf.Tensor(0.08969995, shape=(), dtype=float32)
tf.Tensor(0.07064176, shape=(), dtype=float32)
tf.Tensor(0.08723086, shape=(), dtype=float32)
tf.Tensor(0.09019996, shape=(), dtype=float32)
Epoch: 62,loss: 0.08444313332438469
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.08919307, shape=(), dtype=float32)
tf.Tensor(0.0702415, shape=(), dtype=float32)
tf.Tensor(0.08665794, shape=(), dtype=float32)
tf.Tensor(0.08972988, shape=(), dtype=float32)
Epoch: 63,loss: 0.08395559899508953
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.08869344, shape=(), dtype=float32)
tf.Tensor(0.06984622, shape=(), dtype=float32)
tf.Tensor(0.08609238, shape=(), dtype=float32)
tf.Tensor(0.089265004, shape=(), dtype=float32)
Epoch: 64,loss: 0.08347426168620586
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.08820087, shape=(), dtype=float32)
tf.Tensor(0.069455765, shape=(), dtype=float32)
tf.Tensor(0.085534066, shape=(), dtype=float32)
tf.Tensor(0.08880523, shape=(), dtype=float32)
Epoch: 65,loss: 0.0829989816993475
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.08771517, shape=(), dtype=float32)
tf.Tensor(0.069069974, shape=(), dtype=float32)
tf.Tensor(0.084982835, shape=(), dtype=float32)
tf.Tensor(0.08835047, shape=(), dtype=float32)
Epoch: 66,loss: 0.08252961188554764
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.087236226, shape=(), dtype=float32)
tf.Tensor(0.06868874, shape=(), dtype=float32)
tf.Tensor(0.08443854, shape=(), dtype=float32)
tf.Tensor(0.08790064, shape=(), dtype=float32)
Epoch: 67,loss: 0.08206603676080704
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.08676384, shape=(), dtype=float32)
tf.Tensor(0.06831194, shape=(), dtype=float32)
tf.Tensor(0.08390107, shape=(), dtype=float32)
tf.Tensor(0.08745568, shape=(), dtype=float32)
Epoch: 68,loss: 0.0816081315279007
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.08629789, shape=(), dtype=float32)
tf.Tensor(0.06793946, shape=(), dtype=float32)
tf.Tensor(0.083370276, shape=(), dtype=float32)
tf.Tensor(0.087015495, shape=(), dtype=float32)
Epoch: 69,loss: 0.08115578070282936
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.085838236, shape=(), dtype=float32)
tf.Tensor(0.067571186, shape=(), dtype=float32)
tf.Tensor(0.082846045, shape=(), dtype=float32)
tf.Tensor(0.08658004, shape=(), dtype=float32)
Epoch: 70,loss: 0.08070887625217438
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.085384734, shape=(), dtype=float32)
tf.Tensor(0.06720701, shape=(), dtype=float32)
tf.Tensor(0.08232826, shape=(), dtype=float32)
tf.Tensor(0.08614924, shape=(), dtype=float32)
Epoch: 71,loss: 0.08026731014251709
test_acc:  0.6333333333333333
-----------------------------------
tf.Tensor(0.08493728, shape=(), dtype=float32)
tf.Tensor(0.06684684, shape=(), dtype=float32)
tf.Tensor(0.081816815, shape=(), dtype=float32)
tf.Tensor(0.08572303, shape=(), dtype=float32)
Epoch: 72,loss: 0.07983099110424519
test_acc:  0.6666666666666666
-----------------------------------
tf.Tensor(0.08449573, shape=(), dtype=float32)
tf.Tensor(0.06649061, shape=(), dtype=float32)
tf.Tensor(0.081311576, shape=(), dtype=float32)
tf.Tensor(0.08530134, shape=(), dtype=float32)
Epoch: 73,loss: 0.07939981482923031
test_acc:  0.6666666666666666
-----------------------------------
tf.Tensor(0.084060006, shape=(), dtype=float32)
tf.Tensor(0.06613821, shape=(), dtype=float32)
tf.Tensor(0.08081246, shape=(), dtype=float32)
tf.Tensor(0.084884115, shape=(), dtype=float32)
Epoch: 74,loss: 0.07897369749844074
test_acc:  0.6666666666666666
-----------------------------------
tf.Tensor(0.08362994, shape=(), dtype=float32)
tf.Tensor(0.06578957, shape=(), dtype=float32)
tf.Tensor(0.08031937, shape=(), dtype=float32)
tf.Tensor(0.08447129, shape=(), dtype=float32)
Epoch: 75,loss: 0.07855254411697388
test_acc:  0.7
-----------------------------------
tf.Tensor(0.0832055, shape=(), dtype=float32)
tf.Tensor(0.06544461, shape=(), dtype=float32)
tf.Tensor(0.079832174, shape=(), dtype=float32)
tf.Tensor(0.084062815, shape=(), dtype=float32)
Epoch: 76,loss: 0.0781362745910883
test_acc:  0.7
-----------------------------------
tf.Tensor(0.08278651, shape=(), dtype=float32)
tf.Tensor(0.06510326, shape=(), dtype=float32)
tf.Tensor(0.07935082, shape=(), dtype=float32)
tf.Tensor(0.08365864, shape=(), dtype=float32)
Epoch: 77,loss: 0.07772480882704258
test_acc:  0.7
-----------------------------------
tf.Tensor(0.082372904, shape=(), dtype=float32)
tf.Tensor(0.06476545, shape=(), dtype=float32)
tf.Tensor(0.078875184, shape=(), dtype=float32)
tf.Tensor(0.08325872, shape=(), dtype=float32)
Epoch: 78,loss: 0.07731806486845016
test_acc:  0.7
-----------------------------------
tf.Tensor(0.08196461, shape=(), dtype=float32)
tf.Tensor(0.06443112, shape=(), dtype=float32)
tf.Tensor(0.078405194, shape=(), dtype=float32)
tf.Tensor(0.08286296, shape=(), dtype=float32)
Epoch: 79,loss: 0.07691597193479538
test_acc:  0.7
-----------------------------------
tf.Tensor(0.08156151, shape=(), dtype=float32)
tf.Tensor(0.0641002, shape=(), dtype=float32)
tf.Tensor(0.07794074, shape=(), dtype=float32)
tf.Tensor(0.08247134, shape=(), dtype=float32)
Epoch: 80,loss: 0.07651844806969166
test_acc:  0.7
-----------------------------------
tf.Tensor(0.081163526, shape=(), dtype=float32)
tf.Tensor(0.06377264, shape=(), dtype=float32)
tf.Tensor(0.07748178, shape=(), dtype=float32)
tf.Tensor(0.08208382, shape=(), dtype=float32)
Epoch: 81,loss: 0.07612544111907482
test_acc:  0.7333333333333333
-----------------------------------
tf.Tensor(0.08077057, shape=(), dtype=float32)
tf.Tensor(0.06344838, shape=(), dtype=float32)
tf.Tensor(0.07702818, shape=(), dtype=float32)
tf.Tensor(0.081700325, shape=(), dtype=float32)
Epoch: 82,loss: 0.0757368616759777
test_acc:  0.7333333333333333
-----------------------------------
tf.Tensor(0.08038256, shape=(), dtype=float32)
tf.Tensor(0.06312735, shape=(), dtype=float32)
tf.Tensor(0.076579876, shape=(), dtype=float32)
tf.Tensor(0.081320815, shape=(), dtype=float32)
Epoch: 83,loss: 0.07535265013575554
test_acc:  0.7333333333333333
-----------------------------------
tf.Tensor(0.079999425, shape=(), dtype=float32)
tf.Tensor(0.062809505, shape=(), dtype=float32)
tf.Tensor(0.076136805, shape=(), dtype=float32)
tf.Tensor(0.080945246, shape=(), dtype=float32)
Epoch: 84,loss: 0.07497274503111839
test_acc:  0.7333333333333333
-----------------------------------
tf.Tensor(0.07962107, shape=(), dtype=float32)
tf.Tensor(0.062494803, shape=(), dtype=float32)
tf.Tensor(0.07569888, shape=(), dtype=float32)
tf.Tensor(0.080573566, shape=(), dtype=float32)
Epoch: 85,loss: 0.07459708023816347
test_acc:  0.7666666666666667
-----------------------------------
tf.Tensor(0.07924744, shape=(), dtype=float32)
tf.Tensor(0.062183198, shape=(), dtype=float32)
tf.Tensor(0.075266026, shape=(), dtype=float32)
tf.Tensor(0.08020573, shape=(), dtype=float32)
Epoch: 86,loss: 0.07422559801489115
test_acc:  0.7666666666666667
-----------------------------------
tf.Tensor(0.07887841, shape=(), dtype=float32)
tf.Tensor(0.061874628, shape=(), dtype=float32)
tf.Tensor(0.07483816, shape=(), dtype=float32)
tf.Tensor(0.0798417, shape=(), dtype=float32)
Epoch: 87,loss: 0.0738582257181406
test_acc:  0.7666666666666667
-----------------------------------
tf.Tensor(0.07851399, shape=(), dtype=float32)
tf.Tensor(0.06156906, shape=(), dtype=float32)
tf.Tensor(0.07441522, shape=(), dtype=float32)
tf.Tensor(0.079481415, shape=(), dtype=float32)
Epoch: 88,loss: 0.07349492143839598
test_acc:  0.7666666666666667
-----------------------------------
tf.Tensor(0.078154035, shape=(), dtype=float32)
tf.Tensor(0.061266452, shape=(), dtype=float32)
tf.Tensor(0.07399713, shape=(), dtype=float32)
tf.Tensor(0.079124846, shape=(), dtype=float32)
Epoch: 89,loss: 0.07313561625778675
test_acc:  0.7666666666666667
-----------------------------------
tf.Tensor(0.07779852, shape=(), dtype=float32)
tf.Tensor(0.060966756, shape=(), dtype=float32)
tf.Tensor(0.07358382, shape=(), dtype=float32)
tf.Tensor(0.07877194, shape=(), dtype=float32)
Epoch: 90,loss: 0.0727802598848939
test_acc:  0.7666666666666667
-----------------------------------
tf.Tensor(0.07744736, shape=(), dtype=float32)
tf.Tensor(0.06066994, shape=(), dtype=float32)
tf.Tensor(0.07317523, shape=(), dtype=float32)
tf.Tensor(0.07842267, shape=(), dtype=float32)
Epoch: 91,loss: 0.0724288010969758
test_acc:  0.7666666666666667
-----------------------------------
tf.Tensor(0.07710051, shape=(), dtype=float32)
tf.Tensor(0.06037594, shape=(), dtype=float32)
tf.Tensor(0.07277129, shape=(), dtype=float32)
tf.Tensor(0.07807697, shape=(), dtype=float32)
Epoch: 92,loss: 0.07208117749541998
test_acc:  0.7666666666666667
-----------------------------------
tf.Tensor(0.076757886, shape=(), dtype=float32)
tf.Tensor(0.06008474, shape=(), dtype=float32)
tf.Tensor(0.07237192, shape=(), dtype=float32)
tf.Tensor(0.0777348, shape=(), dtype=float32)
Epoch: 93,loss: 0.07173733692616224
test_acc:  0.8
-----------------------------------
tf.Tensor(0.07641941, shape=(), dtype=float32)
tf.Tensor(0.0597963, shape=(), dtype=float32)
tf.Tensor(0.07197709, shape=(), dtype=float32)
tf.Tensor(0.07739615, shape=(), dtype=float32)
Epoch: 94,loss: 0.07139723654836416
test_acc:  0.8
-----------------------------------
tf.Tensor(0.07608507, shape=(), dtype=float32)
tf.Tensor(0.059510592, shape=(), dtype=float32)
tf.Tensor(0.07158669, shape=(), dtype=float32)
tf.Tensor(0.07706094, shape=(), dtype=float32)
Epoch: 95,loss: 0.07106082234531641
test_acc:  0.8
-----------------------------------
tf.Tensor(0.075754754, shape=(), dtype=float32)
tf.Tensor(0.05922756, shape=(), dtype=float32)
tf.Tensor(0.07120069, shape=(), dtype=float32)
tf.Tensor(0.07672915, shape=(), dtype=float32)
Epoch: 96,loss: 0.07072803843766451
test_acc:  0.8
-----------------------------------
tf.Tensor(0.07542843, shape=(), dtype=float32)
tf.Tensor(0.058947176, shape=(), dtype=float32)
tf.Tensor(0.07081901, shape=(), dtype=float32)
tf.Tensor(0.07640073, shape=(), dtype=float32)
Epoch: 97,loss: 0.07039883732795715
test_acc:  0.8
-----------------------------------
tf.Tensor(0.07510603, shape=(), dtype=float32)
tf.Tensor(0.058669418, shape=(), dtype=float32)
tf.Tensor(0.07044161, shape=(), dtype=float32)
tf.Tensor(0.07607566, shape=(), dtype=float32)
Epoch: 98,loss: 0.07007317990064621
test_acc:  0.8333333333333334
-----------------------------------
tf.Tensor(0.07478753, shape=(), dtype=float32)
tf.Tensor(0.058394253, shape=(), dtype=float32)
tf.Tensor(0.07006842, shape=(), dtype=float32)
tf.Tensor(0.07575386, shape=(), dtype=float32)
Epoch: 99,loss: 0.06975101493299007
test_acc:  0.8666666666666667
-----------------------------------
tf.Tensor(0.07447279, shape=(), dtype=float32)
tf.Tensor(0.058121633, shape=(), dtype=float32)
tf.Tensor(0.069699384, shape=(), dtype=float32)
tf.Tensor(0.07543535, shape=(), dtype=float32)
Epoch: 100,loss: 0.069432289339602
test_acc:  0.8666666666666667
-----------------------------------
tf.Tensor(0.07416186, shape=(), dtype=float32)
tf.Tensor(0.05785154, shape=(), dtype=float32)
tf.Tensor(0.06933445, shape=(), dtype=float32)
tf.Tensor(0.07512004, shape=(), dtype=float32)
Epoch: 101,loss: 0.06911697145551443
test_acc:  0.8666666666666667
-----------------------------------
tf.Tensor(0.07385462, shape=(), dtype=float32)
tf.Tensor(0.057583947, shape=(), dtype=float32)
tf.Tensor(0.068973534, shape=(), dtype=float32)
tf.Tensor(0.07480791, shape=(), dtype=float32)
Epoch: 102,loss: 0.06880500260740519
test_acc:  0.8666666666666667
-----------------------------------
tf.Tensor(0.07355105, shape=(), dtype=float32)
tf.Tensor(0.057318807, shape=(), dtype=float32)
tf.Tensor(0.068616614, shape=(), dtype=float32)
tf.Tensor(0.07449893, shape=(), dtype=float32)
Epoch: 103,loss: 0.06849635019898415
test_acc:  0.8666666666666667
-----------------------------------
tf.Tensor(0.07325106, shape=(), dtype=float32)
tf.Tensor(0.057056103, shape=(), dtype=float32)
tf.Tensor(0.06826362, shape=(), dtype=float32)
tf.Tensor(0.07419305, shape=(), dtype=float32)
Epoch: 104,loss: 0.06819095928221941
test_acc:  0.8666666666666667
-----------------------------------
tf.Tensor(0.072954625, shape=(), dtype=float32)
tf.Tensor(0.056795806, shape=(), dtype=float32)
tf.Tensor(0.06791449, shape=(), dtype=float32)
tf.Tensor(0.07389025, shape=(), dtype=float32)
Epoch: 105,loss: 0.06788879260420799
test_acc:  0.8666666666666667
-----------------------------------
tf.Tensor(0.072661705, shape=(), dtype=float32)
tf.Tensor(0.0565379, shape=(), dtype=float32)
tf.Tensor(0.067569196, shape=(), dtype=float32)
tf.Tensor(0.07359048, shape=(), dtype=float32)
Epoch: 106,loss: 0.0675898203626275
test_acc:  0.8666666666666667
-----------------------------------
tf.Tensor(0.07237222, shape=(), dtype=float32)
tf.Tensor(0.056282327, shape=(), dtype=float32)
tf.Tensor(0.06722767, shape=(), dtype=float32)
tf.Tensor(0.0732937, shape=(), dtype=float32)
Epoch: 107,loss: 0.06729397922754288
test_acc:  0.9
-----------------------------------
tf.Tensor(0.07208613, shape=(), dtype=float32)
tf.Tensor(0.056029085, shape=(), dtype=float32)
tf.Tensor(0.06688986, shape=(), dtype=float32)
tf.Tensor(0.07299987, shape=(), dtype=float32)
Epoch: 108,loss: 0.06700123753398657
test_acc:  0.9
-----------------------------------
tf.Tensor(0.07180339, shape=(), dtype=float32)
tf.Tensor(0.055778142, shape=(), dtype=float32)
tf.Tensor(0.066555716, shape=(), dtype=float32)
tf.Tensor(0.072709, shape=(), dtype=float32)
Epoch: 109,loss: 0.06671156268566847
test_acc:  0.9
-----------------------------------
tf.Tensor(0.07152399, shape=(), dtype=float32)
tf.Tensor(0.055529475, shape=(), dtype=float32)
tf.Tensor(0.06622518, shape=(), dtype=float32)
tf.Tensor(0.07242101, shape=(), dtype=float32)
Epoch: 110,loss: 0.06642491184175014
test_acc:  0.9
-----------------------------------
tf.Tensor(0.071247816, shape=(), dtype=float32)
tf.Tensor(0.05528304, shape=(), dtype=float32)
tf.Tensor(0.065898225, shape=(), dtype=float32)
tf.Tensor(0.07213586, shape=(), dtype=float32)
Epoch: 111,loss: 0.06614123471081257
test_acc:  0.9
-----------------------------------
tf.Tensor(0.070974864, shape=(), dtype=float32)
tf.Tensor(0.05503884, shape=(), dtype=float32)
tf.Tensor(0.06557477, shape=(), dtype=float32)
tf.Tensor(0.07185355, shape=(), dtype=float32)
Epoch: 112,loss: 0.06586050614714622
test_acc:  0.9
-----------------------------------
tf.Tensor(0.070705086, shape=(), dtype=float32)
tf.Tensor(0.054796826, shape=(), dtype=float32)
tf.Tensor(0.06525481, shape=(), dtype=float32)
tf.Tensor(0.071574025, shape=(), dtype=float32)
Epoch: 113,loss: 0.0655826861038804
test_acc:  0.9
-----------------------------------
tf.Tensor(0.07043842, shape=(), dtype=float32)
tf.Tensor(0.05455698, shape=(), dtype=float32)
tf.Tensor(0.064938255, shape=(), dtype=float32)
tf.Tensor(0.071297236, shape=(), dtype=float32)
Epoch: 114,loss: 0.0653077233582735
test_acc:  0.9
-----------------------------------
tf.Tensor(0.07017484, shape=(), dtype=float32)
tf.Tensor(0.054319292, shape=(), dtype=float32)
tf.Tensor(0.064625084, shape=(), dtype=float32)
tf.Tensor(0.07102319, shape=(), dtype=float32)
Epoch: 115,loss: 0.06503560207784176
test_acc:  0.9
-----------------------------------
tf.Tensor(0.0699143, shape=(), dtype=float32)
tf.Tensor(0.05408372, shape=(), dtype=float32)
tf.Tensor(0.064315245, shape=(), dtype=float32)
tf.Tensor(0.070751816, shape=(), dtype=float32)
Epoch: 116,loss: 0.06476627103984356
test_acc:  0.9
-----------------------------------
tf.Tensor(0.06965675, shape=(), dtype=float32)
tf.Tensor(0.053850252, shape=(), dtype=float32)
tf.Tensor(0.06400868, shape=(), dtype=float32)
tf.Tensor(0.07048312, shape=(), dtype=float32)
Epoch: 117,loss: 0.0644997013732791
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.069402166, shape=(), dtype=float32)
tf.Tensor(0.05361886, shape=(), dtype=float32)
tf.Tensor(0.06370538, shape=(), dtype=float32)
tf.Tensor(0.070217036, shape=(), dtype=float32)
Epoch: 118,loss: 0.06423585955053568
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.069150455, shape=(), dtype=float32)
tf.Tensor(0.05338953, shape=(), dtype=float32)
tf.Tensor(0.06340526, shape=(), dtype=float32)
tf.Tensor(0.06995354, shape=(), dtype=float32)
Epoch: 119,loss: 0.06397469621151686
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.068901636, shape=(), dtype=float32)
tf.Tensor(0.05316223, shape=(), dtype=float32)
tf.Tensor(0.063108295, shape=(), dtype=float32)
tf.Tensor(0.06969262, shape=(), dtype=float32)
Epoch: 120,loss: 0.06371619459241629
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.068655655, shape=(), dtype=float32)
tf.Tensor(0.05293693, shape=(), dtype=float32)
tf.Tensor(0.06281445, shape=(), dtype=float32)
tf.Tensor(0.069434226, shape=(), dtype=float32)
Epoch: 121,loss: 0.06346031557768583
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.068412445, shape=(), dtype=float32)
tf.Tensor(0.05271362, shape=(), dtype=float32)
tf.Tensor(0.06252366, shape=(), dtype=float32)
tf.Tensor(0.06917832, shape=(), dtype=float32)
Epoch: 122,loss: 0.06320701260119677
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06817199, shape=(), dtype=float32)
tf.Tensor(0.05249228, shape=(), dtype=float32)
tf.Tensor(0.062235918, shape=(), dtype=float32)
tf.Tensor(0.06892489, shape=(), dtype=float32)
Epoch: 123,loss: 0.06295626983046532
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06793424, shape=(), dtype=float32)
tf.Tensor(0.052272875, shape=(), dtype=float32)
tf.Tensor(0.06195115, shape=(), dtype=float32)
tf.Tensor(0.068673916, shape=(), dtype=float32)
Epoch: 124,loss: 0.06270804442465305
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.067699164, shape=(), dtype=float32)
tf.Tensor(0.05205542, shape=(), dtype=float32)
tf.Tensor(0.06166933, shape=(), dtype=float32)
tf.Tensor(0.068425335, shape=(), dtype=float32)
Epoch: 125,loss: 0.062462312169373035
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06746674, shape=(), dtype=float32)
tf.Tensor(0.05183984, shape=(), dtype=float32)
tf.Tensor(0.06139042, shape=(), dtype=float32)
tf.Tensor(0.068179145, shape=(), dtype=float32)
Epoch: 126,loss: 0.06221903674304485
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06723689, shape=(), dtype=float32)
tf.Tensor(0.051626157, shape=(), dtype=float32)
tf.Tensor(0.061114382, shape=(), dtype=float32)
tf.Tensor(0.06793531, shape=(), dtype=float32)
Epoch: 127,loss: 0.061978185549378395
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.067009635, shape=(), dtype=float32)
tf.Tensor(0.051414337, shape=(), dtype=float32)
tf.Tensor(0.060841173, shape=(), dtype=float32)
tf.Tensor(0.06769379, shape=(), dtype=float32)
Epoch: 128,loss: 0.06173973437398672
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06678488, shape=(), dtype=float32)
tf.Tensor(0.051204357, shape=(), dtype=float32)
tf.Tensor(0.06057075, shape=(), dtype=float32)
tf.Tensor(0.06745456, shape=(), dtype=float32)
Epoch: 129,loss: 0.061503637582063675
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06656262, shape=(), dtype=float32)
tf.Tensor(0.0509962, shape=(), dtype=float32)
tf.Tensor(0.060303092, shape=(), dtype=float32)
tf.Tensor(0.067217626, shape=(), dtype=float32)
Epoch: 130,loss: 0.061269884929060936
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06634284, shape=(), dtype=float32)
tf.Tensor(0.05078985, shape=(), dtype=float32)
tf.Tensor(0.060038146, shape=(), dtype=float32)
tf.Tensor(0.0669829, shape=(), dtype=float32)
Epoch: 131,loss: 0.061038434505462646
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06612546, shape=(), dtype=float32)
tf.Tensor(0.0505853, shape=(), dtype=float32)
tf.Tensor(0.059775874, shape=(), dtype=float32)
tf.Tensor(0.066750415, shape=(), dtype=float32)
Epoch: 132,loss: 0.060809262096881866
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06591046, shape=(), dtype=float32)
tf.Tensor(0.050382495, shape=(), dtype=float32)
tf.Tensor(0.05951625, shape=(), dtype=float32)
tf.Tensor(0.06652011, shape=(), dtype=float32)
Epoch: 133,loss: 0.06058232858777046
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06569784, shape=(), dtype=float32)
tf.Tensor(0.05018145, shape=(), dtype=float32)
tf.Tensor(0.059259247, shape=(), dtype=float32)
tf.Tensor(0.06629196, shape=(), dtype=float32)
Epoch: 134,loss: 0.06035762373358011
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06548754, shape=(), dtype=float32)
tf.Tensor(0.04998214, shape=(), dtype=float32)
tf.Tensor(0.059004802, shape=(), dtype=float32)
tf.Tensor(0.06606594, shape=(), dtype=float32)
Epoch: 135,loss: 0.06013510562479496
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.0652795, shape=(), dtype=float32)
tf.Tensor(0.049784537, shape=(), dtype=float32)
tf.Tensor(0.058752913, shape=(), dtype=float32)
tf.Tensor(0.065842055, shape=(), dtype=float32)
Epoch: 136,loss: 0.05991475097835064
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.065073766, shape=(), dtype=float32)
tf.Tensor(0.049588602, shape=(), dtype=float32)
tf.Tensor(0.058503527, shape=(), dtype=float32)
tf.Tensor(0.065620214, shape=(), dtype=float32)
Epoch: 137,loss: 0.05969652719795704
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06487023, shape=(), dtype=float32)
tf.Tensor(0.049394354, shape=(), dtype=float32)
tf.Tensor(0.058256615, shape=(), dtype=float32)
tf.Tensor(0.06540047, shape=(), dtype=float32)
Epoch: 138,loss: 0.05948041658848524
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.0646689, shape=(), dtype=float32)
tf.Tensor(0.049201775, shape=(), dtype=float32)
tf.Tensor(0.058012147, shape=(), dtype=float32)
tf.Tensor(0.06518274, shape=(), dtype=float32)
Epoch: 139,loss: 0.05926639027893543
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06446973, shape=(), dtype=float32)
tf.Tensor(0.049010813, shape=(), dtype=float32)
tf.Tensor(0.057770073, shape=(), dtype=float32)
tf.Tensor(0.06496702, shape=(), dtype=float32)
Epoch: 140,loss: 0.059054410085082054
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.0642727, shape=(), dtype=float32)
tf.Tensor(0.04882149, shape=(), dtype=float32)
tf.Tensor(0.057530392, shape=(), dtype=float32)
tf.Tensor(0.06475328, shape=(), dtype=float32)
Epoch: 141,loss: 0.058844465762376785
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06407779, shape=(), dtype=float32)
tf.Tensor(0.048633765, shape=(), dtype=float32)
tf.Tensor(0.057293046, shape=(), dtype=float32)
tf.Tensor(0.06454152, shape=(), dtype=float32)
Epoch: 142,loss: 0.05863652937114239
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06388494, shape=(), dtype=float32)
tf.Tensor(0.048447635, shape=(), dtype=float32)
tf.Tensor(0.057058018, shape=(), dtype=float32)
tf.Tensor(0.06433167, shape=(), dtype=float32)
Epoch: 143,loss: 0.058430567383766174
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06369417, shape=(), dtype=float32)
tf.Tensor(0.048263073, shape=(), dtype=float32)
tf.Tensor(0.05682527, shape=(), dtype=float32)
tf.Tensor(0.06412374, shape=(), dtype=float32)
Epoch: 144,loss: 0.05822656396776438
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.063505374, shape=(), dtype=float32)
tf.Tensor(0.04808007, shape=(), dtype=float32)
tf.Tensor(0.05659477, shape=(), dtype=float32)
tf.Tensor(0.06391772, shape=(), dtype=float32)
Epoch: 145,loss: 0.05802448373287916
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.0633186, shape=(), dtype=float32)
tf.Tensor(0.04789859, shape=(), dtype=float32)
tf.Tensor(0.056366503, shape=(), dtype=float32)
tf.Tensor(0.06371355, shape=(), dtype=float32)
Epoch: 146,loss: 0.05782431177794933
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06313378, shape=(), dtype=float32)
tf.Tensor(0.047718648, shape=(), dtype=float32)
tf.Tensor(0.056140434, shape=(), dtype=float32)
tf.Tensor(0.06351124, shape=(), dtype=float32)
Epoch: 147,loss: 0.0576260257512331
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.0629509, shape=(), dtype=float32)
tf.Tensor(0.047540206, shape=(), dtype=float32)
tf.Tensor(0.05591653, shape=(), dtype=float32)
tf.Tensor(0.06331074, shape=(), dtype=float32)
Epoch: 148,loss: 0.0574295949190855
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06276994, shape=(), dtype=float32)
tf.Tensor(0.04736325, shape=(), dtype=float32)
tf.Tensor(0.055694744, shape=(), dtype=float32)
tf.Tensor(0.06311205, shape=(), dtype=float32)
Epoch: 149,loss: 0.05723499692976475
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06259087, shape=(), dtype=float32)
tf.Tensor(0.047187775, shape=(), dtype=float32)
tf.Tensor(0.055475086, shape=(), dtype=float32)
tf.Tensor(0.06291514, shape=(), dtype=float32)
Epoch: 150,loss: 0.05704221688210964
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.062413633, shape=(), dtype=float32)
tf.Tensor(0.04701376, shape=(), dtype=float32)
tf.Tensor(0.0552575, shape=(), dtype=float32)
tf.Tensor(0.06271999, shape=(), dtype=float32)
Epoch: 151,loss: 0.0568512212485075
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.062238257, shape=(), dtype=float32)
tf.Tensor(0.046841174, shape=(), dtype=float32)
tf.Tensor(0.055041973, shape=(), dtype=float32)
tf.Tensor(0.06252657, shape=(), dtype=float32)
Epoch: 152,loss: 0.05666199326515198
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.062064677, shape=(), dtype=float32)
tf.Tensor(0.04667004, shape=(), dtype=float32)
tf.Tensor(0.054828484, shape=(), dtype=float32)
tf.Tensor(0.06233487, shape=(), dtype=float32)
Epoch: 153,loss: 0.05647451709955931
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.061892886, shape=(), dtype=float32)
tf.Tensor(0.046500314, shape=(), dtype=float32)
tf.Tensor(0.054616977, shape=(), dtype=float32)
tf.Tensor(0.062144876, shape=(), dtype=float32)
Epoch: 154,loss: 0.0562887629494071
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.061722863, shape=(), dtype=float32)
tf.Tensor(0.04633196, shape=(), dtype=float32)
tf.Tensor(0.054407462, shape=(), dtype=float32)
tf.Tensor(0.061956566, shape=(), dtype=float32)
Epoch: 155,loss: 0.05610471311956644
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06155457, shape=(), dtype=float32)
tf.Tensor(0.046165023, shape=(), dtype=float32)
tf.Tensor(0.054199886, shape=(), dtype=float32)
tf.Tensor(0.061769903, shape=(), dtype=float32)
Epoch: 156,loss: 0.055922345258295536
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.061387986, shape=(), dtype=float32)
tf.Tensor(0.04599944, shape=(), dtype=float32)
tf.Tensor(0.05399424, shape=(), dtype=float32)
tf.Tensor(0.061584856, shape=(), dtype=float32)
Epoch: 157,loss: 0.055741630494594574
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.061223105, shape=(), dtype=float32)
tf.Tensor(0.04583521, shape=(), dtype=float32)
tf.Tensor(0.05379049, shape=(), dtype=float32)
tf.Tensor(0.061401453, shape=(), dtype=float32)
Epoch: 158,loss: 0.05556256417185068
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.061059874, shape=(), dtype=float32)
tf.Tensor(0.045672327, shape=(), dtype=float32)
tf.Tensor(0.05358861, shape=(), dtype=float32)
tf.Tensor(0.06121965, shape=(), dtype=float32)
Epoch: 159,loss: 0.055385115556418896
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.060898278, shape=(), dtype=float32)
tf.Tensor(0.04551078, shape=(), dtype=float32)
tf.Tensor(0.05338859, shape=(), dtype=float32)
tf.Tensor(0.06103943, shape=(), dtype=float32)
Epoch: 160,loss: 0.05520926974713802
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06073833, shape=(), dtype=float32)
tf.Tensor(0.045350548, shape=(), dtype=float32)
tf.Tensor(0.053190395, shape=(), dtype=float32)
tf.Tensor(0.06086076, shape=(), dtype=float32)
Epoch: 161,loss: 0.05503500811755657
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.06057997, shape=(), dtype=float32)
tf.Tensor(0.045191597, shape=(), dtype=float32)
tf.Tensor(0.05299401, shape=(), dtype=float32)
tf.Tensor(0.06068365, shape=(), dtype=float32)
Epoch: 162,loss: 0.0548623064532876
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.060423207, shape=(), dtype=float32)
tf.Tensor(0.04503393, shape=(), dtype=float32)
tf.Tensor(0.0527994, shape=(), dtype=float32)
tf.Tensor(0.06050804, shape=(), dtype=float32)
Epoch: 163,loss: 0.05469114426523447
test_acc:  0.9333333333333333
-----------------------------------
tf.Tensor(0.060267974, shape=(), dtype=float32)
tf.Tensor(0.04487756, shape=(), dtype=float32)
tf.Tensor(0.052606553, shape=(), dtype=float32)
tf.Tensor(0.060333967, shape=(), dtype=float32)
Epoch: 164,loss: 0.05452151317149401
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.06011429, shape=(), dtype=float32)
tf.Tensor(0.04472244, shape=(), dtype=float32)
tf.Tensor(0.05241544, shape=(), dtype=float32)
tf.Tensor(0.060161367, shape=(), dtype=float32)
Epoch: 165,loss: 0.05435338523238897
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.059962135, shape=(), dtype=float32)
tf.Tensor(0.04456855, shape=(), dtype=float32)
tf.Tensor(0.052226026, shape=(), dtype=float32)
tf.Tensor(0.059990227, shape=(), dtype=float32)
Epoch: 166,loss: 0.05418673437088728
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.059811447, shape=(), dtype=float32)
tf.Tensor(0.04441591, shape=(), dtype=float32)
tf.Tensor(0.052038316, shape=(), dtype=float32)
tf.Tensor(0.059820566, shape=(), dtype=float32)
Epoch: 167,loss: 0.05402155965566635
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.059662253, shape=(), dtype=float32)
tf.Tensor(0.044264495, shape=(), dtype=float32)
tf.Tensor(0.051852275, shape=(), dtype=float32)
tf.Tensor(0.059652336, shape=(), dtype=float32)
Epoch: 168,loss: 0.05385783966630697
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.05951451, shape=(), dtype=float32)
tf.Tensor(0.04411429, shape=(), dtype=float32)
tf.Tensor(0.051667888, shape=(), dtype=float32)
tf.Tensor(0.05948553, shape=(), dtype=float32)
Epoch: 169,loss: 0.053695554845035076
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.059368193, shape=(), dtype=float32)
tf.Tensor(0.043965265, shape=(), dtype=float32)
tf.Tensor(0.051485132, shape=(), dtype=float32)
tf.Tensor(0.059320126, shape=(), dtype=float32)
Epoch: 170,loss: 0.05353467911481857
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.059223335, shape=(), dtype=float32)
tf.Tensor(0.04381742, shape=(), dtype=float32)
tf.Tensor(0.051303968, shape=(), dtype=float32)
tf.Tensor(0.059156105, shape=(), dtype=float32)
Epoch: 171,loss: 0.053375206887722015
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.059079845, shape=(), dtype=float32)
tf.Tensor(0.04367076, shape=(), dtype=float32)
tf.Tensor(0.051124405, shape=(), dtype=float32)
tf.Tensor(0.058993466, shape=(), dtype=float32)
Epoch: 172,loss: 0.053217118605971336
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.058937732, shape=(), dtype=float32)
tf.Tensor(0.043525252, shape=(), dtype=float32)
tf.Tensor(0.050946403, shape=(), dtype=float32)
tf.Tensor(0.058832187, shape=(), dtype=float32)
Epoch: 173,loss: 0.053060393780469894
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.05879699, shape=(), dtype=float32)
tf.Tensor(0.043380886, shape=(), dtype=float32)
tf.Tensor(0.05076996, shape=(), dtype=float32)
tf.Tensor(0.058672257, shape=(), dtype=float32)
Epoch: 174,loss: 0.05290502309799194
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.058657598, shape=(), dtype=float32)
tf.Tensor(0.043237675, shape=(), dtype=float32)
tf.Tensor(0.050595026, shape=(), dtype=float32)
tf.Tensor(0.05851364, shape=(), dtype=float32)
Epoch: 175,loss: 0.05275098513811827
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.058519512, shape=(), dtype=float32)
tf.Tensor(0.043095578, shape=(), dtype=float32)
tf.Tensor(0.050421614, shape=(), dtype=float32)
tf.Tensor(0.058356337, shape=(), dtype=float32)
Epoch: 176,loss: 0.0525982603430748
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.05838274, shape=(), dtype=float32)
tf.Tensor(0.042954594, shape=(), dtype=float32)
tf.Tensor(0.050249707, shape=(), dtype=float32)
tf.Tensor(0.058200333, shape=(), dtype=float32)
Epoch: 177,loss: 0.05244684312492609
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.058247253, shape=(), dtype=float32)
tf.Tensor(0.042814713, shape=(), dtype=float32)
tf.Tensor(0.050079256, shape=(), dtype=float32)
tf.Tensor(0.05804562, shape=(), dtype=float32)
Epoch: 178,loss: 0.05229671020060778
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.058113072, shape=(), dtype=float32)
tf.Tensor(0.042675924, shape=(), dtype=float32)
tf.Tensor(0.049910262, shape=(), dtype=float32)
tf.Tensor(0.057892177, shape=(), dtype=float32)
Epoch: 179,loss: 0.052147858776152134
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.05798014, shape=(), dtype=float32)
tf.Tensor(0.042538196, shape=(), dtype=float32)
tf.Tensor(0.0497427, shape=(), dtype=float32)
tf.Tensor(0.05773996, shape=(), dtype=float32)
Epoch: 180,loss: 0.05200024787336588
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.057848442, shape=(), dtype=float32)
tf.Tensor(0.042401534, shape=(), dtype=float32)
tf.Tensor(0.04957657, shape=(), dtype=float32)
tf.Tensor(0.057589013, shape=(), dtype=float32)
Epoch: 181,loss: 0.05185388959944248
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.057717964, shape=(), dtype=float32)
tf.Tensor(0.042265948, shape=(), dtype=float32)
tf.Tensor(0.049411833, shape=(), dtype=float32)
tf.Tensor(0.057439275, shape=(), dtype=float32)
Epoch: 182,loss: 0.05170875508338213
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.057588696, shape=(), dtype=float32)
tf.Tensor(0.042131394, shape=(), dtype=float32)
tf.Tensor(0.049248487, shape=(), dtype=float32)
tf.Tensor(0.057290766, shape=(), dtype=float32)
Epoch: 183,loss: 0.05156483594328165
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.057460636, shape=(), dtype=float32)
tf.Tensor(0.041997883, shape=(), dtype=float32)
tf.Tensor(0.0490865, shape=(), dtype=float32)
tf.Tensor(0.057143435, shape=(), dtype=float32)
Epoch: 184,loss: 0.05142211355268955
test_acc:  0.9666666666666667
-----------------------------------
tf.Tensor(0.05733378, shape=(), dtype=float32)
tf.Tensor(0.041865382, shape=(), dtype=float32)
tf.Tensor(0.048925877, shape=(), dtype=float32)
tf.Tensor(0.0569973, shape=(), dtype=float32)
Epoch: 185,loss: 0.051280584186315536
test_acc:  1.0
-----------------------------------
tf.Tensor(0.057208043, shape=(), dtype=float32)
tf.Tensor(0.041733906, shape=(), dtype=float32)
tf.Tensor(0.04876657, shape=(), dtype=float32)
tf.Tensor(0.05685235, shape=(), dtype=float32)
Epoch: 186,loss: 0.051140216179192066
test_acc:  1.0
-----------------------------------
tf.Tensor(0.057083476, shape=(), dtype=float32)
tf.Tensor(0.041603442, shape=(), dtype=float32)
tf.Tensor(0.048608597, shape=(), dtype=float32)
tf.Tensor(0.056708533, shape=(), dtype=float32)
Epoch: 187,loss: 0.051001012325286865
test_acc:  1.0
-----------------------------------
tf.Tensor(0.056960035, shape=(), dtype=float32)
tf.Tensor(0.04147395, shape=(), dtype=float32)
tf.Tensor(0.04845192, shape=(), dtype=float32)
tf.Tensor(0.05656588, shape=(), dtype=float32)
Epoch: 188,loss: 0.050862946547567844
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05683772, shape=(), dtype=float32)
tf.Tensor(0.04134546, shape=(), dtype=float32)
tf.Tensor(0.04829653, shape=(), dtype=float32)
tf.Tensor(0.056424346, shape=(), dtype=float32)
Epoch: 189,loss: 0.050726013258099556
test_acc:  1.0
-----------------------------------
tf.Tensor(0.056716513, shape=(), dtype=float32)
tf.Tensor(0.041217938, shape=(), dtype=float32)
tf.Tensor(0.048142407, shape=(), dtype=float32)
tf.Tensor(0.056283936, shape=(), dtype=float32)
Epoch: 190,loss: 0.05059019848704338
test_acc:  1.0
-----------------------------------
tf.Tensor(0.0565964, shape=(), dtype=float32)
tf.Tensor(0.041091368, shape=(), dtype=float32)
tf.Tensor(0.04798956, shape=(), dtype=float32)
tf.Tensor(0.056144647, shape=(), dtype=float32)
Epoch: 191,loss: 0.05045549292117357
test_acc:  1.0
-----------------------------------
tf.Tensor(0.056477357, shape=(), dtype=float32)
tf.Tensor(0.040965762, shape=(), dtype=float32)
tf.Tensor(0.047837928, shape=(), dtype=float32)
tf.Tensor(0.05600645, shape=(), dtype=float32)
Epoch: 192,loss: 0.05032187420874834
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05635937, shape=(), dtype=float32)
tf.Tensor(0.04084112, shape=(), dtype=float32)
tf.Tensor(0.04768754, shape=(), dtype=float32)
tf.Tensor(0.05586934, shape=(), dtype=float32)
Epoch: 193,loss: 0.05018934328109026
test_acc:  1.0
-----------------------------------
tf.Tensor(0.056242447, shape=(), dtype=float32)
tf.Tensor(0.040717382, shape=(), dtype=float32)
tf.Tensor(0.04753835, shape=(), dtype=float32)
tf.Tensor(0.055733304, shape=(), dtype=float32)
Epoch: 194,loss: 0.050057871267199516
test_acc:  1.0
-----------------------------------
tf.Tensor(0.056126554, shape=(), dtype=float32)
tf.Tensor(0.040594596, shape=(), dtype=float32)
tf.Tensor(0.047390375, shape=(), dtype=float32)
tf.Tensor(0.05559832, shape=(), dtype=float32)
Epoch: 195,loss: 0.049927460961043835
test_acc:  1.0
-----------------------------------
tf.Tensor(0.056011666, shape=(), dtype=float32)
tf.Tensor(0.0404727, shape=(), dtype=float32)
tf.Tensor(0.04724358, shape=(), dtype=float32)
tf.Tensor(0.05546439, shape=(), dtype=float32)
Epoch: 196,loss: 0.049798084422945976
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05589782, shape=(), dtype=float32)
tf.Tensor(0.04035173, shape=(), dtype=float32)
tf.Tensor(0.04709794, shape=(), dtype=float32)
tf.Tensor(0.055331487, shape=(), dtype=float32)
Epoch: 197,loss: 0.049669744446873665
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05578497, shape=(), dtype=float32)
tf.Tensor(0.040231653, shape=(), dtype=float32)
tf.Tensor(0.04695347, shape=(), dtype=float32)
tf.Tensor(0.05519963, shape=(), dtype=float32)
Epoch: 198,loss: 0.04954243078827858
test_acc:  1.0
-----------------------------------
tf.Tensor(0.055673122, shape=(), dtype=float32)
tf.Tensor(0.04011245, shape=(), dtype=float32)
tf.Tensor(0.04681014, shape=(), dtype=float32)
tf.Tensor(0.05506878, shape=(), dtype=float32)
Epoch: 199,loss: 0.04941612295806408
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05556224, shape=(), dtype=float32)
tf.Tensor(0.03999414, shape=(), dtype=float32)
tf.Tensor(0.04666793, shape=(), dtype=float32)
tf.Tensor(0.054938935, shape=(), dtype=float32)
Epoch: 200,loss: 0.04929081071168184
test_acc:  1.0
-----------------------------------
tf.Tensor(0.0554523, shape=(), dtype=float32)
tf.Tensor(0.039876703, shape=(), dtype=float32)
tf.Tensor(0.046526838, shape=(), dtype=float32)
tf.Tensor(0.054810077, shape=(), dtype=float32)
Epoch: 201,loss: 0.049166479147970676
test_acc:  1.0
-----------------------------------
tf.Tensor(0.055343304, shape=(), dtype=float32)
tf.Tensor(0.03976013, shape=(), dtype=float32)
tf.Tensor(0.04638685, shape=(), dtype=float32)
tf.Tensor(0.05468222, shape=(), dtype=float32)
Epoch: 202,loss: 0.04904312640428543
test_acc:  1.0
-----------------------------------
tf.Tensor(0.055235285, shape=(), dtype=float32)
tf.Tensor(0.03964439, shape=(), dtype=float32)
tf.Tensor(0.046247944, shape=(), dtype=float32)
tf.Tensor(0.05455531, shape=(), dtype=float32)
Epoch: 203,loss: 0.04892073292285204
test_acc:  1.0
-----------------------------------
tf.Tensor(0.055128157, shape=(), dtype=float32)
tf.Tensor(0.03952952, shape=(), dtype=float32)
tf.Tensor(0.046110135, shape=(), dtype=float32)
tf.Tensor(0.05442938, shape=(), dtype=float32)
Epoch: 204,loss: 0.04879929777234793
test_acc:  1.0
-----------------------------------
tf.Tensor(0.055021968, shape=(), dtype=float32)
tf.Tensor(0.03941549, shape=(), dtype=float32)
tf.Tensor(0.04597337, shape=(), dtype=float32)
tf.Tensor(0.054304402, shape=(), dtype=float32)
Epoch: 205,loss: 0.04867880791425705
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05491667, shape=(), dtype=float32)
tf.Tensor(0.03930227, shape=(), dtype=float32)
tf.Tensor(0.04583767, shape=(), dtype=float32)
tf.Tensor(0.05418036, shape=(), dtype=float32)
Epoch: 206,loss: 0.048559242859482765
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05481227, shape=(), dtype=float32)
tf.Tensor(0.039189875, shape=(), dtype=float32)
tf.Tensor(0.045703005, shape=(), dtype=float32)
tf.Tensor(0.05405726, shape=(), dtype=float32)
Epoch: 207,loss: 0.048440602608025074
test_acc:  1.0
-----------------------------------
tf.Tensor(0.054708745, shape=(), dtype=float32)
tf.Tensor(0.0390783, shape=(), dtype=float32)
tf.Tensor(0.04556936, shape=(), dtype=float32)
tf.Tensor(0.053935073, shape=(), dtype=float32)
Epoch: 208,loss: 0.04832286946475506
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05460611, shape=(), dtype=float32)
tf.Tensor(0.03896752, shape=(), dtype=float32)
tf.Tensor(0.04543675, shape=(), dtype=float32)
tf.Tensor(0.053813823, shape=(), dtype=float32)
Epoch: 209,loss: 0.048206050880253315
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05450432, shape=(), dtype=float32)
tf.Tensor(0.038857553, shape=(), dtype=float32)
tf.Tensor(0.045305133, shape=(), dtype=float32)
tf.Tensor(0.053693455, shape=(), dtype=float32)
Epoch: 210,loss: 0.04809011518955231
test_acc:  1.0
-----------------------------------
tf.Tensor(0.054403394, shape=(), dtype=float32)
tf.Tensor(0.038748354, shape=(), dtype=float32)
tf.Tensor(0.04517452, shape=(), dtype=float32)
tf.Tensor(0.05357398, shape=(), dtype=float32)
Epoch: 211,loss: 0.047975062392652035
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05430329, shape=(), dtype=float32)
tf.Tensor(0.038639944, shape=(), dtype=float32)
tf.Tensor(0.04504488, shape=(), dtype=float32)
tf.Tensor(0.053455397, shape=(), dtype=float32)
Epoch: 212,loss: 0.047860877588391304
test_acc:  1.0
-----------------------------------
tf.Tensor(0.054204047, shape=(), dtype=float32)
tf.Tensor(0.0385323, shape=(), dtype=float32)
tf.Tensor(0.04491621, shape=(), dtype=float32)
tf.Tensor(0.05333768, shape=(), dtype=float32)
Epoch: 213,loss: 0.047747558914124966
test_acc:  1.0
-----------------------------------
tf.Tensor(0.054105595, shape=(), dtype=float32)
tf.Tensor(0.03842544, shape=(), dtype=float32)
tf.Tensor(0.0447885, shape=(), dtype=float32)
tf.Tensor(0.053220842, shape=(), dtype=float32)
Epoch: 214,loss: 0.04763509426265955
test_acc:  1.0
-----------------------------------
tf.Tensor(0.054007977, shape=(), dtype=float32)
tf.Tensor(0.03831931, shape=(), dtype=float32)
tf.Tensor(0.044661745, shape=(), dtype=float32)
tf.Tensor(0.05310485, shape=(), dtype=float32)
Epoch: 215,loss: 0.04752347059547901
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05391114, shape=(), dtype=float32)
tf.Tensor(0.038213942, shape=(), dtype=float32)
tf.Tensor(0.044535924, shape=(), dtype=float32)
tf.Tensor(0.052989736, shape=(), dtype=float32)
Epoch: 216,loss: 0.04741268511861563
test_acc:  1.0
-----------------------------------
tf.Tensor(0.053815093, shape=(), dtype=float32)
tf.Tensor(0.038109343, shape=(), dtype=float32)
tf.Tensor(0.044411037, shape=(), dtype=float32)
tf.Tensor(0.052875426, shape=(), dtype=float32)
Epoch: 217,loss: 0.04730272479355335
test_acc:  1.0
-----------------------------------
tf.Tensor(0.053719837, shape=(), dtype=float32)
tf.Tensor(0.03800546, shape=(), dtype=float32)
tf.Tensor(0.044287067, shape=(), dtype=float32)
tf.Tensor(0.052761957, shape=(), dtype=float32)
Epoch: 218,loss: 0.04719358030706644
test_acc:  1.0
-----------------------------------
tf.Tensor(0.053625356, shape=(), dtype=float32)
tf.Tensor(0.037902292, shape=(), dtype=float32)
tf.Tensor(0.044164002, shape=(), dtype=float32)
tf.Tensor(0.05264931, shape=(), dtype=float32)
Epoch: 219,loss: 0.047085240483284
test_acc:  1.0
-----------------------------------
tf.Tensor(0.053531636, shape=(), dtype=float32)
tf.Tensor(0.03779987, shape=(), dtype=float32)
tf.Tensor(0.04404184, shape=(), dtype=float32)
tf.Tensor(0.05253749, shape=(), dtype=float32)
Epoch: 220,loss: 0.046977708116173744
test_acc:  1.0
-----------------------------------
tf.Tensor(0.053438652, shape=(), dtype=float32)
tf.Tensor(0.037698176, shape=(), dtype=float32)
tf.Tensor(0.043920565, shape=(), dtype=float32)
tf.Tensor(0.05242648, shape=(), dtype=float32)
Epoch: 221,loss: 0.04687096830457449
test_acc:  1.0
-----------------------------------
tf.Tensor(0.053346436, shape=(), dtype=float32)
tf.Tensor(0.037597153, shape=(), dtype=float32)
tf.Tensor(0.04380016, shape=(), dtype=float32)
tf.Tensor(0.05231625, shape=(), dtype=float32)
Epoch: 222,loss: 0.04676499962806702
test_acc:  1.0
-----------------------------------
tf.Tensor(0.053254966, shape=(), dtype=float32)
tf.Tensor(0.037496846, shape=(), dtype=float32)
tf.Tensor(0.043680638, shape=(), dtype=float32)
tf.Tensor(0.052206818, shape=(), dtype=float32)
Epoch: 223,loss: 0.04665981698781252
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05316421, shape=(), dtype=float32)
tf.Tensor(0.03739724, shape=(), dtype=float32)
tf.Tensor(0.04356197, shape=(), dtype=float32)
tf.Tensor(0.05209817, shape=(), dtype=float32)
Epoch: 224,loss: 0.04655539710074663
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05307418, shape=(), dtype=float32)
tf.Tensor(0.03729831, shape=(), dtype=float32)
tf.Tensor(0.043444145, shape=(), dtype=float32)
tf.Tensor(0.051990286, shape=(), dtype=float32)
Epoch: 225,loss: 0.04645173065364361
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052984875, shape=(), dtype=float32)
tf.Tensor(0.037200086, shape=(), dtype=float32)
tf.Tensor(0.043327164, shape=(), dtype=float32)
tf.Tensor(0.05188318, shape=(), dtype=float32)
Epoch: 226,loss: 0.04634882602840662
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052896243, shape=(), dtype=float32)
tf.Tensor(0.03710251, shape=(), dtype=float32)
tf.Tensor(0.043211024, shape=(), dtype=float32)
tf.Tensor(0.051776834, shape=(), dtype=float32)
Epoch: 227,loss: 0.046246652491390705
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052808315, shape=(), dtype=float32)
tf.Tensor(0.037005607, shape=(), dtype=float32)
tf.Tensor(0.04309569, shape=(), dtype=float32)
tf.Tensor(0.051671233, shape=(), dtype=float32)
Epoch: 228,loss: 0.04614521097391844
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052721098, shape=(), dtype=float32)
tf.Tensor(0.03690937, shape=(), dtype=float32)
tf.Tensor(0.042981166, shape=(), dtype=float32)
tf.Tensor(0.05156638, shape=(), dtype=float32)
Epoch: 229,loss: 0.04604450426995754
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052634533, shape=(), dtype=float32)
tf.Tensor(0.036813807, shape=(), dtype=float32)
tf.Tensor(0.04286747, shape=(), dtype=float32)
tf.Tensor(0.05146225, shape=(), dtype=float32)
Epoch: 230,loss: 0.045944515615701675
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052548666, shape=(), dtype=float32)
tf.Tensor(0.03671888, shape=(), dtype=float32)
tf.Tensor(0.042754557, shape=(), dtype=float32)
tf.Tensor(0.05135887, shape=(), dtype=float32)
Epoch: 231,loss: 0.04584524314850569
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052463423, shape=(), dtype=float32)
tf.Tensor(0.036624584, shape=(), dtype=float32)
tf.Tensor(0.042642426, shape=(), dtype=float32)
tf.Tensor(0.05125621, shape=(), dtype=float32)
Epoch: 232,loss: 0.04574666079133749
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052378863, shape=(), dtype=float32)
tf.Tensor(0.03653094, shape=(), dtype=float32)
tf.Tensor(0.04253109, shape=(), dtype=float32)
tf.Tensor(0.05115425, shape=(), dtype=float32)
Epoch: 233,loss: 0.045648786239326
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052294943, shape=(), dtype=float32)
tf.Tensor(0.03643793, shape=(), dtype=float32)
tf.Tensor(0.042420525, shape=(), dtype=float32)
tf.Tensor(0.05105301, shape=(), dtype=float32)
Epoch: 234,loss: 0.0455516017973423
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052211672, shape=(), dtype=float32)
tf.Tensor(0.03634553, shape=(), dtype=float32)
tf.Tensor(0.042310704, shape=(), dtype=float32)
tf.Tensor(0.050952468, shape=(), dtype=float32)
Epoch: 235,loss: 0.04545509349554777
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05212905, shape=(), dtype=float32)
tf.Tensor(0.036253754, shape=(), dtype=float32)
tf.Tensor(0.042201653, shape=(), dtype=float32)
tf.Tensor(0.050852623, shape=(), dtype=float32)
Epoch: 236,loss: 0.045359269715845585
test_acc:  1.0
-----------------------------------
tf.Tensor(0.052047048, shape=(), dtype=float32)
tf.Tensor(0.036162596, shape=(), dtype=float32)
tf.Tensor(0.042093333, shape=(), dtype=float32)
tf.Tensor(0.050753456, shape=(), dtype=float32)
Epoch: 237,loss: 0.04526410810649395
test_acc:  1.0
-----------------------------------
tf.Tensor(0.051965643, shape=(), dtype=float32)
tf.Tensor(0.03607204, shape=(), dtype=float32)
tf.Tensor(0.04198577, shape=(), dtype=float32)
tf.Tensor(0.050654974, shape=(), dtype=float32)
Epoch: 238,loss: 0.04516960680484772
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05188488, shape=(), dtype=float32)
tf.Tensor(0.0359821, shape=(), dtype=float32)
tf.Tensor(0.041878924, shape=(), dtype=float32)
tf.Tensor(0.050557166, shape=(), dtype=float32)
Epoch: 239,loss: 0.04507576674222946
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05180469, shape=(), dtype=float32)
tf.Tensor(0.035892744, shape=(), dtype=float32)
tf.Tensor(0.041772824, shape=(), dtype=float32)
tf.Tensor(0.050460026, shape=(), dtype=float32)
Epoch: 240,loss: 0.04498257115483284
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05172512, shape=(), dtype=float32)
tf.Tensor(0.03580399, shape=(), dtype=float32)
tf.Tensor(0.04166742, shape=(), dtype=float32)
tf.Tensor(0.050363556, shape=(), dtype=float32)
Epoch: 241,loss: 0.04489002097398043
test_acc:  1.0
-----------------------------------
tf.Tensor(0.051646154, shape=(), dtype=float32)
tf.Tensor(0.03571581, shape=(), dtype=float32)
tf.Tensor(0.041562725, shape=(), dtype=float32)
tf.Tensor(0.050267734, shape=(), dtype=float32)
Epoch: 242,loss: 0.0447981059551239
test_acc:  1.0
-----------------------------------
tf.Tensor(0.051567767, shape=(), dtype=float32)
tf.Tensor(0.035628207, shape=(), dtype=float32)
tf.Tensor(0.041458737, shape=(), dtype=float32)
tf.Tensor(0.05017256, shape=(), dtype=float32)
Epoch: 243,loss: 0.04470681771636009
test_acc:  1.0
-----------------------------------
tf.Tensor(0.051489938, shape=(), dtype=float32)
tf.Tensor(0.035541188, shape=(), dtype=float32)
tf.Tensor(0.04135545, shape=(), dtype=float32)
tf.Tensor(0.05007803, shape=(), dtype=float32)
Epoch: 244,loss: 0.044616151601076126
test_acc:  1.0
-----------------------------------
tf.Tensor(0.051412728, shape=(), dtype=float32)
tf.Tensor(0.035454754, shape=(), dtype=float32)
tf.Tensor(0.041252844, shape=(), dtype=float32)
tf.Tensor(0.049984142, shape=(), dtype=float32)
Epoch: 245,loss: 0.04452611692249775
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05133604, shape=(), dtype=float32)
tf.Tensor(0.03536886, shape=(), dtype=float32)
tf.Tensor(0.041150916, shape=(), dtype=float32)
tf.Tensor(0.049890876, shape=(), dtype=float32)
Epoch: 246,loss: 0.04443667270243168
test_acc:  1.0
-----------------------------------
tf.Tensor(0.051259954, shape=(), dtype=float32)
tf.Tensor(0.035283525, shape=(), dtype=float32)
tf.Tensor(0.041049663, shape=(), dtype=float32)
tf.Tensor(0.04979823, shape=(), dtype=float32)
Epoch: 247,loss: 0.044347843155264854
test_acc:  1.0
-----------------------------------
tf.Tensor(0.051184386, shape=(), dtype=float32)
tf.Tensor(0.03519876, shape=(), dtype=float32)
tf.Tensor(0.04094908, shape=(), dtype=float32)
tf.Tensor(0.04970621, shape=(), dtype=float32)
Epoch: 248,loss: 0.04425960872322321
test_acc:  1.0
-----------------------------------
tf.Tensor(0.051109385, shape=(), dtype=float32)
tf.Tensor(0.03511453, shape=(), dtype=float32)
tf.Tensor(0.04084916, shape=(), dtype=float32)
tf.Tensor(0.049614813, shape=(), dtype=float32)
Epoch: 249,loss: 0.04417197220027447
test_acc:  1.0
-----------------------------------
tf.Tensor(0.051034898, shape=(), dtype=float32)
tf.Tensor(0.03503086, shape=(), dtype=float32)
tf.Tensor(0.04074989, shape=(), dtype=float32)
tf.Tensor(0.049524, shape=(), dtype=float32)
Epoch: 250,loss: 0.04408491216599941
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05096099, shape=(), dtype=float32)
tf.Tensor(0.03494771, shape=(), dtype=float32)
tf.Tensor(0.04065126, shape=(), dtype=float32)
tf.Tensor(0.04943381, shape=(), dtype=float32)
Epoch: 251,loss: 0.043998442590236664
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05088759, shape=(), dtype=float32)
tf.Tensor(0.034865107, shape=(), dtype=float32)
tf.Tensor(0.04055327, shape=(), dtype=float32)
tf.Tensor(0.0493442, shape=(), dtype=float32)
Epoch: 252,loss: 0.043912542052567005
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05081473, shape=(), dtype=float32)
tf.Tensor(0.034783017, shape=(), dtype=float32)
tf.Tensor(0.04045592, shape=(), dtype=float32)
tf.Tensor(0.049255185, shape=(), dtype=float32)
Epoch: 253,loss: 0.043827212415635586
test_acc:  1.0
-----------------------------------
tf.Tensor(0.050742388, shape=(), dtype=float32)
tf.Tensor(0.03470147, shape=(), dtype=float32)
tf.Tensor(0.040359184, shape=(), dtype=float32)
tf.Tensor(0.049166754, shape=(), dtype=float32)
Epoch: 254,loss: 0.04374244902282953
test_acc:  1.0
-----------------------------------
tf.Tensor(0.050670546, shape=(), dtype=float32)
tf.Tensor(0.034620438, shape=(), dtype=float32)
tf.Tensor(0.040263083, shape=(), dtype=float32)
tf.Tensor(0.049078908, shape=(), dtype=float32)
Epoch: 255,loss: 0.043658243492245674
test_acc:  1.0
-----------------------------------
tf.Tensor(0.050599217, shape=(), dtype=float32)
tf.Tensor(0.034539923, shape=(), dtype=float32)
tf.Tensor(0.0401676, shape=(), dtype=float32)
tf.Tensor(0.04899163, shape=(), dtype=float32)
Epoch: 256,loss: 0.043574593029916286
test_acc:  1.0
-----------------------------------
tf.Tensor(0.050528392, shape=(), dtype=float32)
tf.Tensor(0.034459915, shape=(), dtype=float32)
tf.Tensor(0.040072706, shape=(), dtype=float32)
tf.Tensor(0.048904914, shape=(), dtype=float32)
Epoch: 257,loss: 0.0434914818033576
test_acc:  1.0
-----------------------------------
tf.Tensor(0.050458074, shape=(), dtype=float32)
tf.Tensor(0.03438041, shape=(), dtype=float32)
tf.Tensor(0.039978437, shape=(), dtype=float32)
tf.Tensor(0.048818782, shape=(), dtype=float32)
Epoch: 258,loss: 0.04340892564505339
test_acc:  1.0
-----------------------------------
tf.Tensor(0.050388258, shape=(), dtype=float32)
tf.Tensor(0.034301396, shape=(), dtype=float32)
tf.Tensor(0.03988475, shape=(), dtype=float32)
tf.Tensor(0.04873319, shape=(), dtype=float32)
Epoch: 259,loss: 0.043326898477971554
test_acc:  1.0
-----------------------------------
tf.Tensor(0.050318915, shape=(), dtype=float32)
tf.Tensor(0.034222886, shape=(), dtype=float32)
tf.Tensor(0.039791662, shape=(), dtype=float32)
tf.Tensor(0.04864816, shape=(), dtype=float32)
Epoch: 260,loss: 0.04324540589004755
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05025005, shape=(), dtype=float32)
tf.Tensor(0.03414489, shape=(), dtype=float32)
tf.Tensor(0.039699156, shape=(), dtype=float32)
tf.Tensor(0.048563674, shape=(), dtype=float32)
Epoch: 261,loss: 0.04316444229334593
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05018167, shape=(), dtype=float32)
tf.Tensor(0.03406735, shape=(), dtype=float32)
tf.Tensor(0.039607227, shape=(), dtype=float32)
tf.Tensor(0.048479736, shape=(), dtype=float32)
Epoch: 262,loss: 0.04308399558067322
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05011378, shape=(), dtype=float32)
tf.Tensor(0.0339903, shape=(), dtype=float32)
tf.Tensor(0.039515875, shape=(), dtype=float32)
tf.Tensor(0.048396334, shape=(), dtype=float32)
Epoch: 263,loss: 0.04300407227128744
test_acc:  1.0
-----------------------------------
tf.Tensor(0.05004633, shape=(), dtype=float32)
tf.Tensor(0.03391375, shape=(), dtype=float32)
tf.Tensor(0.039425086, shape=(), dtype=float32)
tf.Tensor(0.048313454, shape=(), dtype=float32)
Epoch: 264,loss: 0.04292465467005968
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04997934, shape=(), dtype=float32)
tf.Tensor(0.033837654, shape=(), dtype=float32)
tf.Tensor(0.03933486, shape=(), dtype=float32)
tf.Tensor(0.048231117, shape=(), dtype=float32)
Epoch: 265,loss: 0.04284574277698994
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04991283, shape=(), dtype=float32)
tf.Tensor(0.033762038, shape=(), dtype=float32)
tf.Tensor(0.039245207, shape=(), dtype=float32)
tf.Tensor(0.048149295, shape=(), dtype=float32)
Epoch: 266,loss: 0.04276734218001366
test_acc:  1.0
-----------------------------------
tf.Tensor(0.049846757, shape=(), dtype=float32)
tf.Tensor(0.033686887, shape=(), dtype=float32)
tf.Tensor(0.039156094, shape=(), dtype=float32)
tf.Tensor(0.048068002, shape=(), dtype=float32)
Epoch: 267,loss: 0.04268943518400192
test_acc:  1.0
-----------------------------------
tf.Tensor(0.049781132, shape=(), dtype=float32)
tf.Tensor(0.033612195, shape=(), dtype=float32)
tf.Tensor(0.03906752, shape=(), dtype=float32)
tf.Tensor(0.047987208, shape=(), dtype=float32)
Epoch: 268,loss: 0.04261201433837414
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04971597, shape=(), dtype=float32)
tf.Tensor(0.033537954, shape=(), dtype=float32)
tf.Tensor(0.03897949, shape=(), dtype=float32)
tf.Tensor(0.047906928, shape=(), dtype=float32)
Epoch: 269,loss: 0.04253508523106575
test_acc:  1.0
-----------------------------------
tf.Tensor(0.049651217, shape=(), dtype=float32)
tf.Tensor(0.033464182, shape=(), dtype=float32)
tf.Tensor(0.038892012, shape=(), dtype=float32)
tf.Tensor(0.047827166, shape=(), dtype=float32)
Epoch: 270,loss: 0.04245864413678646
test_acc:  1.0
-----------------------------------
tf.Tensor(0.049586922, shape=(), dtype=float32)
tf.Tensor(0.03339086, shape=(), dtype=float32)
tf.Tensor(0.038805053, shape=(), dtype=float32)
tf.Tensor(0.0477479, shape=(), dtype=float32)
Epoch: 271,loss: 0.04238268360495567
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04952307, shape=(), dtype=float32)
tf.Tensor(0.033317972, shape=(), dtype=float32)
tf.Tensor(0.038718622, shape=(), dtype=float32)
tf.Tensor(0.047669124, shape=(), dtype=float32)
Epoch: 272,loss: 0.042307197116315365
test_acc:  1.0
-----------------------------------
tf.Tensor(0.049459618, shape=(), dtype=float32)
tf.Tensor(0.033245537, shape=(), dtype=float32)
tf.Tensor(0.038632706, shape=(), dtype=float32)
tf.Tensor(0.047590837, shape=(), dtype=float32)
Epoch: 273,loss: 0.042232174426317215
test_acc:  1.0
-----------------------------------
tf.Tensor(0.049396593, shape=(), dtype=float32)
tf.Tensor(0.03317353, shape=(), dtype=float32)
tf.Tensor(0.03854731, shape=(), dtype=float32)
tf.Tensor(0.04751305, shape=(), dtype=float32)
Epoch: 274,loss: 0.04215762112289667
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04933399, shape=(), dtype=float32)
tf.Tensor(0.03310198, shape=(), dtype=float32)
tf.Tensor(0.03846243, shape=(), dtype=float32)
tf.Tensor(0.047435742, shape=(), dtype=float32)
Epoch: 275,loss: 0.042083535343408585
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04927179, shape=(), dtype=float32)
tf.Tensor(0.03303084, shape=(), dtype=float32)
tf.Tensor(0.03837805, shape=(), dtype=float32)
tf.Tensor(0.047358897, shape=(), dtype=float32)
Epoch: 276,loss: 0.04200989380478859
test_acc:  1.0
-----------------------------------
tf.Tensor(0.049210012, shape=(), dtype=float32)
tf.Tensor(0.032960128, shape=(), dtype=float32)
tf.Tensor(0.038294185, shape=(), dtype=float32)
tf.Tensor(0.047282543, shape=(), dtype=float32)
Epoch: 277,loss: 0.04193671699613333
test_acc:  1.0
-----------------------------------
tf.Tensor(0.049148638, shape=(), dtype=float32)
tf.Tensor(0.03288985, shape=(), dtype=float32)
tf.Tensor(0.038210806, shape=(), dtype=float32)
tf.Tensor(0.047206655, shape=(), dtype=float32)
Epoch: 278,loss: 0.04186398722231388
test_acc:  1.0
-----------------------------------
tf.Tensor(0.049087662, shape=(), dtype=float32)
tf.Tensor(0.032819983, shape=(), dtype=float32)
tf.Tensor(0.038127918, shape=(), dtype=float32)
tf.Tensor(0.04713124, shape=(), dtype=float32)
Epoch: 279,loss: 0.04179170075803995
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04902708, shape=(), dtype=float32)
tf.Tensor(0.032750532, shape=(), dtype=float32)
tf.Tensor(0.03804552, shape=(), dtype=float32)
tf.Tensor(0.047056276, shape=(), dtype=float32)
Epoch: 280,loss: 0.041719852946698666
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04896689, shape=(), dtype=float32)
tf.Tensor(0.03268149, shape=(), dtype=float32)
tf.Tensor(0.037963603, shape=(), dtype=float32)
tf.Tensor(0.04698177, shape=(), dtype=float32)
Epoch: 281,loss: 0.041648438200354576
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048907112, shape=(), dtype=float32)
tf.Tensor(0.03261287, shape=(), dtype=float32)
tf.Tensor(0.037882183, shape=(), dtype=float32)
tf.Tensor(0.046907738, shape=(), dtype=float32)
Epoch: 282,loss: 0.04157747607678175
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048847675, shape=(), dtype=float32)
tf.Tensor(0.032544646, shape=(), dtype=float32)
tf.Tensor(0.03780122, shape=(), dtype=float32)
tf.Tensor(0.04683415, shape=(), dtype=float32)
Epoch: 283,loss: 0.04150692280381918
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048788656, shape=(), dtype=float32)
tf.Tensor(0.032476828, shape=(), dtype=float32)
tf.Tensor(0.03772073, shape=(), dtype=float32)
tf.Tensor(0.046761, shape=(), dtype=float32)
Epoch: 284,loss: 0.041436802595853806
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04872999, shape=(), dtype=float32)
tf.Tensor(0.03240942, shape=(), dtype=float32)
tf.Tensor(0.037640706, shape=(), dtype=float32)
tf.Tensor(0.046688285, shape=(), dtype=float32)
Epoch: 285,loss: 0.04136709962040186
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048671734, shape=(), dtype=float32)
tf.Tensor(0.032342378, shape=(), dtype=float32)
tf.Tensor(0.037561145, shape=(), dtype=float32)
tf.Tensor(0.046616025, shape=(), dtype=float32)
Epoch: 286,loss: 0.04129782039672136
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048613816, shape=(), dtype=float32)
tf.Tensor(0.032275755, shape=(), dtype=float32)
tf.Tensor(0.037482042, shape=(), dtype=float32)
tf.Tensor(0.0465442, shape=(), dtype=float32)
Epoch: 287,loss: 0.04122895374894142
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048556272, shape=(), dtype=float32)
tf.Tensor(0.032209504, shape=(), dtype=float32)
tf.Tensor(0.03740339, shape=(), dtype=float32)
tf.Tensor(0.0464728, shape=(), dtype=float32)
Epoch: 288,loss: 0.04116049129515886
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048499096, shape=(), dtype=float32)
tf.Tensor(0.032143656, shape=(), dtype=float32)
tf.Tensor(0.037325196, shape=(), dtype=float32)
tf.Tensor(0.04640184, shape=(), dtype=float32)
Epoch: 289,loss: 0.04109244700521231
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048442274, shape=(), dtype=float32)
tf.Tensor(0.032078177, shape=(), dtype=float32)
tf.Tensor(0.037247438, shape=(), dtype=float32)
tf.Tensor(0.046331283, shape=(), dtype=float32)
Epoch: 290,loss: 0.041024792939424515
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04838583, shape=(), dtype=float32)
tf.Tensor(0.03201308, shape=(), dtype=float32)
tf.Tensor(0.037170134, shape=(), dtype=float32)
tf.Tensor(0.046261173, shape=(), dtype=float32)
Epoch: 291,loss: 0.040957554243505
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04832973, shape=(), dtype=float32)
tf.Tensor(0.031948354, shape=(), dtype=float32)
tf.Tensor(0.037093263, shape=(), dtype=float32)
tf.Tensor(0.046191454, shape=(), dtype=float32)
Epoch: 292,loss: 0.040890700183808804
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04827395, shape=(), dtype=float32)
tf.Tensor(0.03188401, shape=(), dtype=float32)
tf.Tensor(0.037016813, shape=(), dtype=float32)
tf.Tensor(0.04612216, shape=(), dtype=float32)
Epoch: 293,loss: 0.040824233554303646
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048218545, shape=(), dtype=float32)
tf.Tensor(0.03182004, shape=(), dtype=float32)
tf.Tensor(0.036940817, shape=(), dtype=float32)
tf.Tensor(0.046053283, shape=(), dtype=float32)
Epoch: 294,loss: 0.04075817111879587
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04816349, shape=(), dtype=float32)
tf.Tensor(0.031756416, shape=(), dtype=float32)
tf.Tensor(0.03686522, shape=(), dtype=float32)
tf.Tensor(0.045984805, shape=(), dtype=float32)
Epoch: 295,loss: 0.04069248214364052
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048108753, shape=(), dtype=float32)
tf.Tensor(0.03169316, shape=(), dtype=float32)
tf.Tensor(0.036790058, shape=(), dtype=float32)
tf.Tensor(0.045916736, shape=(), dtype=float32)
Epoch: 296,loss: 0.040627176873385906
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048054352, shape=(), dtype=float32)
tf.Tensor(0.031630266, shape=(), dtype=float32)
tf.Tensor(0.03671532, shape=(), dtype=float32)
tf.Tensor(0.045849066, shape=(), dtype=float32)
Epoch: 297,loss: 0.04056225158274174
test_acc:  1.0
-----------------------------------
tf.Tensor(0.048000295, shape=(), dtype=float32)
tf.Tensor(0.031567737, shape=(), dtype=float32)
tf.Tensor(0.036640983, shape=(), dtype=float32)
tf.Tensor(0.045781776, shape=(), dtype=float32)
Epoch: 298,loss: 0.04049769788980484
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047946554, shape=(), dtype=float32)
tf.Tensor(0.031505562, shape=(), dtype=float32)
tf.Tensor(0.036567066, shape=(), dtype=float32)
tf.Tensor(0.045714904, shape=(), dtype=float32)
Epoch: 299,loss: 0.04043352138251066
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047893155, shape=(), dtype=float32)
tf.Tensor(0.031443726, shape=(), dtype=float32)
tf.Tensor(0.03649356, shape=(), dtype=float32)
tf.Tensor(0.04564841, shape=(), dtype=float32)
Epoch: 300,loss: 0.04036971274763346
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04784006, shape=(), dtype=float32)
tf.Tensor(0.031382266, shape=(), dtype=float32)
tf.Tensor(0.036420453, shape=(), dtype=float32)
tf.Tensor(0.04558231, shape=(), dtype=float32)
Epoch: 301,loss: 0.040306271985173225
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047787298, shape=(), dtype=float32)
tf.Tensor(0.031321123, shape=(), dtype=float32)
tf.Tensor(0.036347758, shape=(), dtype=float32)
tf.Tensor(0.045516584, shape=(), dtype=float32)
Epoch: 302,loss: 0.040243190713226795
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047734868, shape=(), dtype=float32)
tf.Tensor(0.03126033, shape=(), dtype=float32)
tf.Tensor(0.036275446, shape=(), dtype=float32)
tf.Tensor(0.04545124, shape=(), dtype=float32)
Epoch: 303,loss: 0.040180470794439316
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04768273, shape=(), dtype=float32)
tf.Tensor(0.031199893, shape=(), dtype=float32)
tf.Tensor(0.03620353, shape=(), dtype=float32)
tf.Tensor(0.04538629, shape=(), dtype=float32)
Epoch: 304,loss: 0.04011810990050435
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047630925, shape=(), dtype=float32)
tf.Tensor(0.031139767, shape=(), dtype=float32)
tf.Tensor(0.036132004, shape=(), dtype=float32)
tf.Tensor(0.045321688, shape=(), dtype=float32)
Epoch: 305,loss: 0.04005609592422843
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047579426, shape=(), dtype=float32)
tf.Tensor(0.031079998, shape=(), dtype=float32)
tf.Tensor(0.036060873, shape=(), dtype=float32)
tf.Tensor(0.04525747, shape=(), dtype=float32)
Epoch: 306,loss: 0.039994442369788885
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047528207, shape=(), dtype=float32)
tf.Tensor(0.031020552, shape=(), dtype=float32)
tf.Tensor(0.035990123, shape=(), dtype=float32)
tf.Tensor(0.045193627, shape=(), dtype=float32)
Epoch: 307,loss: 0.03993312735110521
test_acc:  1.0
-----------------------------------
tf.Tensor(0.0474773, shape=(), dtype=float32)
tf.Tensor(0.03096143, shape=(), dtype=float32)
tf.Tensor(0.03591975, shape=(), dtype=float32)
tf.Tensor(0.04513014, shape=(), dtype=float32)
Epoch: 308,loss: 0.039872155059129
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047426727, shape=(), dtype=float32)
tf.Tensor(0.030902633, shape=(), dtype=float32)
tf.Tensor(0.035849746, shape=(), dtype=float32)
tf.Tensor(0.04506703, shape=(), dtype=float32)
Epoch: 309,loss: 0.039811534341424704
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047376405, shape=(), dtype=float32)
tf.Tensor(0.030844187, shape=(), dtype=float32)
tf.Tensor(0.03578014, shape=(), dtype=float32)
tf.Tensor(0.04500427, shape=(), dtype=float32)
Epoch: 310,loss: 0.03975125076249242
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047326412, shape=(), dtype=float32)
tf.Tensor(0.030786032, shape=(), dtype=float32)
tf.Tensor(0.035710886, shape=(), dtype=float32)
tf.Tensor(0.044941857, shape=(), dtype=float32)
Epoch: 311,loss: 0.03969129687175155
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047276694, shape=(), dtype=float32)
tf.Tensor(0.030728206, shape=(), dtype=float32)
tf.Tensor(0.035642, shape=(), dtype=float32)
tf.Tensor(0.044879813, shape=(), dtype=float32)
Epoch: 312,loss: 0.039631678722798824
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047227252, shape=(), dtype=float32)
tf.Tensor(0.030670697, shape=(), dtype=float32)
tf.Tensor(0.035573494, shape=(), dtype=float32)
tf.Tensor(0.044818114, shape=(), dtype=float32)
Epoch: 313,loss: 0.03957238933071494
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047178138, shape=(), dtype=float32)
tf.Tensor(0.030613488, shape=(), dtype=float32)
tf.Tensor(0.035505325, shape=(), dtype=float32)
tf.Tensor(0.044756763, shape=(), dtype=float32)
Epoch: 314,loss: 0.03951342822983861
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047129273, shape=(), dtype=float32)
tf.Tensor(0.030556595, shape=(), dtype=float32)
tf.Tensor(0.03543753, shape=(), dtype=float32)
tf.Tensor(0.044695754, shape=(), dtype=float32)
Epoch: 315,loss: 0.03945478843525052
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047080714, shape=(), dtype=float32)
tf.Tensor(0.030500026, shape=(), dtype=float32)
tf.Tensor(0.03537009, shape=(), dtype=float32)
tf.Tensor(0.044635102, shape=(), dtype=float32)
Epoch: 316,loss: 0.03939648298546672
test_acc:  1.0
-----------------------------------
tf.Tensor(0.047032427, shape=(), dtype=float32)
tf.Tensor(0.030443758, shape=(), dtype=float32)
tf.Tensor(0.035303008, shape=(), dtype=float32)
tf.Tensor(0.04457478, shape=(), dtype=float32)
Epoch: 317,loss: 0.039338492788374424
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046984416, shape=(), dtype=float32)
tf.Tensor(0.03038778, shape=(), dtype=float32)
tf.Tensor(0.035236266, shape=(), dtype=float32)
tf.Tensor(0.04451479, shape=(), dtype=float32)
Epoch: 318,loss: 0.039280812721699476
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046936665, shape=(), dtype=float32)
tf.Tensor(0.03033212, shape=(), dtype=float32)
tf.Tensor(0.035169873, shape=(), dtype=float32)
tf.Tensor(0.044455133, shape=(), dtype=float32)
Epoch: 319,loss: 0.039223447907716036
test_acc:  1.0
-----------------------------------
tf.Tensor(0.0468892, shape=(), dtype=float32)
tf.Tensor(0.030276751, shape=(), dtype=float32)
tf.Tensor(0.035103828, shape=(), dtype=float32)
tf.Tensor(0.044395816, shape=(), dtype=float32)
Epoch: 320,loss: 0.03916639881208539
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04684201, shape=(), dtype=float32)
tf.Tensor(0.030221676, shape=(), dtype=float32)
tf.Tensor(0.03503812, shape=(), dtype=float32)
tf.Tensor(0.04433683, shape=(), dtype=float32)
Epoch: 321,loss: 0.03910965891554952
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046795066, shape=(), dtype=float32)
tf.Tensor(0.030166915, shape=(), dtype=float32)
tf.Tensor(0.034972753, shape=(), dtype=float32)
tf.Tensor(0.044278163, shape=(), dtype=float32)
Epoch: 322,loss: 0.03905322449281812
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04674843, shape=(), dtype=float32)
tf.Tensor(0.030112406, shape=(), dtype=float32)
tf.Tensor(0.034907717, shape=(), dtype=float32)
tf.Tensor(0.04421983, shape=(), dtype=float32)
Epoch: 323,loss: 0.03899709554389119
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046702024, shape=(), dtype=float32)
tf.Tensor(0.03005822, shape=(), dtype=float32)
tf.Tensor(0.034843024, shape=(), dtype=float32)
tf.Tensor(0.04416181, shape=(), dtype=float32)
Epoch: 324,loss: 0.0389412697404623
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046655875, shape=(), dtype=float32)
tf.Tensor(0.030004308, shape=(), dtype=float32)
tf.Tensor(0.034778655, shape=(), dtype=float32)
tf.Tensor(0.04410411, shape=(), dtype=float32)
Epoch: 325,loss: 0.03888573683798313
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046609968, shape=(), dtype=float32)
tf.Tensor(0.029950678, shape=(), dtype=float32)
tf.Tensor(0.034714617, shape=(), dtype=float32)
tf.Tensor(0.044046734, shape=(), dtype=float32)
Epoch: 326,loss: 0.03883049916476011
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046564344, shape=(), dtype=float32)
tf.Tensor(0.02989734, shape=(), dtype=float32)
tf.Tensor(0.034650896, shape=(), dtype=float32)
tf.Tensor(0.043989662, shape=(), dtype=float32)
Epoch: 327,loss: 0.038775560446083546
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046518963, shape=(), dtype=float32)
tf.Tensor(0.029844284, shape=(), dtype=float32)
tf.Tensor(0.034587488, shape=(), dtype=float32)
tf.Tensor(0.0439329, shape=(), dtype=float32)
Epoch: 328,loss: 0.03872090857475996
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046473842, shape=(), dtype=float32)
tf.Tensor(0.02979149, shape=(), dtype=float32)
tf.Tensor(0.034524437, shape=(), dtype=float32)
tf.Tensor(0.043876465, shape=(), dtype=float32)
Epoch: 329,loss: 0.03866655845195055
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04642895, shape=(), dtype=float32)
tf.Tensor(0.029738992, shape=(), dtype=float32)
tf.Tensor(0.034461673, shape=(), dtype=float32)
tf.Tensor(0.04382032, shape=(), dtype=float32)
Epoch: 330,loss: 0.038612484000623226
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046384335, shape=(), dtype=float32)
tf.Tensor(0.029686749, shape=(), dtype=float32)
tf.Tensor(0.034399223, shape=(), dtype=float32)
tf.Tensor(0.043764498, shape=(), dtype=float32)
Epoch: 331,loss: 0.03855870105326176
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046339955, shape=(), dtype=float32)
tf.Tensor(0.029634794, shape=(), dtype=float32)
tf.Tensor(0.0343371, shape=(), dtype=float32)
tf.Tensor(0.04370895, shape=(), dtype=float32)
Epoch: 332,loss: 0.03850519983097911
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04629581, shape=(), dtype=float32)
tf.Tensor(0.029583104, shape=(), dtype=float32)
tf.Tensor(0.03427528, shape=(), dtype=float32)
tf.Tensor(0.043653723, shape=(), dtype=float32)
Epoch: 333,loss: 0.03845197893679142
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046251904, shape=(), dtype=float32)
tf.Tensor(0.029531687, shape=(), dtype=float32)
tf.Tensor(0.03421377, shape=(), dtype=float32)
tf.Tensor(0.043598786, shape=(), dtype=float32)
Epoch: 334,loss: 0.03839903697371483
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046208233, shape=(), dtype=float32)
tf.Tensor(0.029480522, shape=(), dtype=float32)
tf.Tensor(0.034152556, shape=(), dtype=float32)
tf.Tensor(0.04354415, shape=(), dtype=float32)
Epoch: 335,loss: 0.03834636555984616
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04616483, shape=(), dtype=float32)
tf.Tensor(0.02942963, shape=(), dtype=float32)
tf.Tensor(0.03409165, shape=(), dtype=float32)
tf.Tensor(0.043489806, shape=(), dtype=float32)
Epoch: 336,loss: 0.03829397913068533
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046121597, shape=(), dtype=float32)
tf.Tensor(0.029379, shape=(), dtype=float32)
tf.Tensor(0.03403105, shape=(), dtype=float32)
tf.Tensor(0.04343576, shape=(), dtype=float32)
Epoch: 337,loss: 0.03824185160920024
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046078652, shape=(), dtype=float32)
tf.Tensor(0.029328644, shape=(), dtype=float32)
tf.Tensor(0.033970732, shape=(), dtype=float32)
tf.Tensor(0.04338198, shape=(), dtype=float32)
Epoch: 338,loss: 0.03819000255316496
test_acc:  1.0
-----------------------------------
tf.Tensor(0.046035916, shape=(), dtype=float32)
tf.Tensor(0.02927851, shape=(), dtype=float32)
tf.Tensor(0.03391072, shape=(), dtype=float32)
tf.Tensor(0.043328505, shape=(), dtype=float32)
Epoch: 339,loss: 0.03813841287046671
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045993432, shape=(), dtype=float32)
tf.Tensor(0.029228648, shape=(), dtype=float32)
tf.Tensor(0.033850994, shape=(), dtype=float32)
tf.Tensor(0.043275315, shape=(), dtype=float32)
Epoch: 340,loss: 0.038087097462266684
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045951158, shape=(), dtype=float32)
tf.Tensor(0.029179046, shape=(), dtype=float32)
tf.Tensor(0.033791576, shape=(), dtype=float32)
tf.Tensor(0.043222398, shape=(), dtype=float32)
Epoch: 341,loss: 0.03803604422137141
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045909096, shape=(), dtype=float32)
tf.Tensor(0.029129704, shape=(), dtype=float32)
tf.Tensor(0.033732448, shape=(), dtype=float32)
tf.Tensor(0.04316977, shape=(), dtype=float32)
Epoch: 342,loss: 0.03798525454476476
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045867275, shape=(), dtype=float32)
tf.Tensor(0.02908059, shape=(), dtype=float32)
tf.Tensor(0.03367358, shape=(), dtype=float32)
tf.Tensor(0.04311742, shape=(), dtype=float32)
Epoch: 343,loss: 0.03793471632525325
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04582567, shape=(), dtype=float32)
tf.Tensor(0.029031733, shape=(), dtype=float32)
tf.Tensor(0.03361501, shape=(), dtype=float32)
tf.Tensor(0.043065336, shape=(), dtype=float32)
Epoch: 344,loss: 0.03788443794474006
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045784283, shape=(), dtype=float32)
tf.Tensor(0.028983131, shape=(), dtype=float32)
tf.Tensor(0.033556726, shape=(), dtype=float32)
tf.Tensor(0.043013528, shape=(), dtype=float32)
Epoch: 345,loss: 0.03783441707491875
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045743097, shape=(), dtype=float32)
tf.Tensor(0.028934771, shape=(), dtype=float32)
tf.Tensor(0.03349873, shape=(), dtype=float32)
tf.Tensor(0.042962003, shape=(), dtype=float32)
Epoch: 346,loss: 0.03778465045616031
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045702145, shape=(), dtype=float32)
tf.Tensor(0.028886652, shape=(), dtype=float32)
tf.Tensor(0.033440992, shape=(), dtype=float32)
tf.Tensor(0.042910747, shape=(), dtype=float32)
Epoch: 347,loss: 0.03773513389751315
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045661394, shape=(), dtype=float32)
tf.Tensor(0.028838763, shape=(), dtype=float32)
tf.Tensor(0.033383522, shape=(), dtype=float32)
tf.Tensor(0.042859748, shape=(), dtype=float32)
Epoch: 348,loss: 0.03768585668876767
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04562086, shape=(), dtype=float32)
tf.Tensor(0.028791135, shape=(), dtype=float32)
tf.Tensor(0.033326346, shape=(), dtype=float32)
tf.Tensor(0.04280903, shape=(), dtype=float32)
Epoch: 349,loss: 0.037636842112988234
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045580536, shape=(), dtype=float32)
tf.Tensor(0.02874373, shape=(), dtype=float32)
tf.Tensor(0.033269435, shape=(), dtype=float32)
tf.Tensor(0.042758558, shape=(), dtype=float32)
Epoch: 350,loss: 0.03758806502446532
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045540422, shape=(), dtype=float32)
tf.Tensor(0.028696567, shape=(), dtype=float32)
tf.Tensor(0.0332128, shape=(), dtype=float32)
tf.Tensor(0.042708356, shape=(), dtype=float32)
Epoch: 351,loss: 0.037539536133408546
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045500517, shape=(), dtype=float32)
tf.Tensor(0.028649628, shape=(), dtype=float32)
tf.Tensor(0.033156425, shape=(), dtype=float32)
tf.Tensor(0.042658422, shape=(), dtype=float32)
Epoch: 352,loss: 0.03749124798923731
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04546083, shape=(), dtype=float32)
tf.Tensor(0.02860292, shape=(), dtype=float32)
tf.Tensor(0.03310031, shape=(), dtype=float32)
tf.Tensor(0.042608738, shape=(), dtype=float32)
Epoch: 353,loss: 0.03744320012629032
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045421332, shape=(), dtype=float32)
tf.Tensor(0.028556446, shape=(), dtype=float32)
tf.Tensor(0.03304446, shape=(), dtype=float32)
tf.Tensor(0.042559307, shape=(), dtype=float32)
Epoch: 354,loss: 0.03739538649097085
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04538204, shape=(), dtype=float32)
tf.Tensor(0.028510198, shape=(), dtype=float32)
tf.Tensor(0.03298889, shape=(), dtype=float32)
tf.Tensor(0.042510137, shape=(), dtype=float32)
Epoch: 355,loss: 0.03734781686216593
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04534294, shape=(), dtype=float32)
tf.Tensor(0.028464185, shape=(), dtype=float32)
tf.Tensor(0.032933567, shape=(), dtype=float32)
tf.Tensor(0.042461216, shape=(), dtype=float32)
Epoch: 356,loss: 0.037300477270036936
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04530403, shape=(), dtype=float32)
tf.Tensor(0.028418414, shape=(), dtype=float32)
tf.Tensor(0.0328785, shape=(), dtype=float32)
tf.Tensor(0.042412553, shape=(), dtype=float32)
Epoch: 357,loss: 0.037253374233841896
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045265336, shape=(), dtype=float32)
tf.Tensor(0.028372832, shape=(), dtype=float32)
tf.Tensor(0.03282369, shape=(), dtype=float32)
tf.Tensor(0.04236413, shape=(), dtype=float32)
Epoch: 358,loss: 0.0372064970433712
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045226816, shape=(), dtype=float32)
tf.Tensor(0.02832749, shape=(), dtype=float32)
tf.Tensor(0.032769118, shape=(), dtype=float32)
tf.Tensor(0.042315952, shape=(), dtype=float32)
Epoch: 359,loss: 0.0371598438359797
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045188516, shape=(), dtype=float32)
tf.Tensor(0.028282354, shape=(), dtype=float32)
tf.Tensor(0.032714818, shape=(), dtype=float32)
tf.Tensor(0.042268023, shape=(), dtype=float32)
Epoch: 360,loss: 0.03711342765018344
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045150395, shape=(), dtype=float32)
tf.Tensor(0.028237449, shape=(), dtype=float32)
tf.Tensor(0.032660764, shape=(), dtype=float32)
tf.Tensor(0.04222034, shape=(), dtype=float32)
Epoch: 361,loss: 0.037067236844450235
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045112457, shape=(), dtype=float32)
tf.Tensor(0.028192764, shape=(), dtype=float32)
tf.Tensor(0.03260696, shape=(), dtype=float32)
tf.Tensor(0.042172894, shape=(), dtype=float32)
Epoch: 362,loss: 0.037021268624812365
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045074727, shape=(), dtype=float32)
tf.Tensor(0.0281483, shape=(), dtype=float32)
tf.Tensor(0.032553393, shape=(), dtype=float32)
tf.Tensor(0.04212571, shape=(), dtype=float32)
Epoch: 363,loss: 0.03697553230449557
test_acc:  1.0
-----------------------------------
tf.Tensor(0.045037165, shape=(), dtype=float32)
tf.Tensor(0.028104028, shape=(), dtype=float32)
tf.Tensor(0.03250009, shape=(), dtype=float32)
tf.Tensor(0.04207874, shape=(), dtype=float32)
Epoch: 364,loss: 0.03693000553175807
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044999808, shape=(), dtype=float32)
tf.Tensor(0.02805998, shape=(), dtype=float32)
tf.Tensor(0.032446995, shape=(), dtype=float32)
tf.Tensor(0.04203202, shape=(), dtype=float32)
Epoch: 365,loss: 0.036884700413793325
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044962596, shape=(), dtype=float32)
tf.Tensor(0.028016156, shape=(), dtype=float32)
tf.Tensor(0.032394174, shape=(), dtype=float32)
tf.Tensor(0.041985527, shape=(), dtype=float32)
Epoch: 366,loss: 0.03683961322531104
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04492561, shape=(), dtype=float32)
tf.Tensor(0.027972532, shape=(), dtype=float32)
tf.Tensor(0.032341585, shape=(), dtype=float32)
tf.Tensor(0.04193926, shape=(), dtype=float32)
Epoch: 367,loss: 0.03679474676027894
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044888783, shape=(), dtype=float32)
tf.Tensor(0.027929112, shape=(), dtype=float32)
tf.Tensor(0.032289226, shape=(), dtype=float32)
tf.Tensor(0.04189325, shape=(), dtype=float32)
Epoch: 368,loss: 0.03675009310245514
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04485215, shape=(), dtype=float32)
tf.Tensor(0.027885891, shape=(), dtype=float32)
tf.Tensor(0.032237098, shape=(), dtype=float32)
tf.Tensor(0.041847453, shape=(), dtype=float32)
Epoch: 369,loss: 0.036705647595226765
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044815708, shape=(), dtype=float32)
tf.Tensor(0.027842889, shape=(), dtype=float32)
tf.Tensor(0.032185208, shape=(), dtype=float32)
tf.Tensor(0.041801874, shape=(), dtype=float32)
Epoch: 370,loss: 0.03666141955181956
test_acc:  1.0
-----------------------------------
tf.Tensor(0.0447794, shape=(), dtype=float32)
tf.Tensor(0.027800078, shape=(), dtype=float32)
tf.Tensor(0.03213356, shape=(), dtype=float32)
tf.Tensor(0.04175653, shape=(), dtype=float32)
Epoch: 371,loss: 0.03661739220842719
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044743318, shape=(), dtype=float32)
tf.Tensor(0.02775748, shape=(), dtype=float32)
tf.Tensor(0.03208213, shape=(), dtype=float32)
tf.Tensor(0.04171141, shape=(), dtype=float32)
Epoch: 372,loss: 0.03657358419150114
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04470737, shape=(), dtype=float32)
tf.Tensor(0.027715074, shape=(), dtype=float32)
tf.Tensor(0.032030936, shape=(), dtype=float32)
tf.Tensor(0.041666523, shape=(), dtype=float32)
Epoch: 373,loss: 0.03652997547760606
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04467161, shape=(), dtype=float32)
tf.Tensor(0.027672881, shape=(), dtype=float32)
tf.Tensor(0.031979974, shape=(), dtype=float32)
tf.Tensor(0.041621856, shape=(), dtype=float32)
Epoch: 374,loss: 0.03648658050224185
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044636022, shape=(), dtype=float32)
tf.Tensor(0.02763088, shape=(), dtype=float32)
tf.Tensor(0.031929236, shape=(), dtype=float32)
tf.Tensor(0.041577406, shape=(), dtype=float32)
Epoch: 375,loss: 0.03644338622689247
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044600595, shape=(), dtype=float32)
tf.Tensor(0.027589068, shape=(), dtype=float32)
tf.Tensor(0.031878706, shape=(), dtype=float32)
tf.Tensor(0.041533165, shape=(), dtype=float32)
Epoch: 376,loss: 0.036400383338332176
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04456537, shape=(), dtype=float32)
tf.Tensor(0.027547464, shape=(), dtype=float32)
tf.Tensor(0.03182842, shape=(), dtype=float32)
tf.Tensor(0.041489165, shape=(), dtype=float32)
Epoch: 377,loss: 0.03635760396718979
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044530284, shape=(), dtype=float32)
tf.Tensor(0.027506039, shape=(), dtype=float32)
tf.Tensor(0.031778347, shape=(), dtype=float32)
tf.Tensor(0.04144537, shape=(), dtype=float32)
Epoch: 378,loss: 0.03631500992923975
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044495374, shape=(), dtype=float32)
tf.Tensor(0.027464813, shape=(), dtype=float32)
tf.Tensor(0.03172849, shape=(), dtype=float32)
tf.Tensor(0.0414018, shape=(), dtype=float32)
Epoch: 379,loss: 0.036272619385272264
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044460636, shape=(), dtype=float32)
tf.Tensor(0.027423775, shape=(), dtype=float32)
tf.Tensor(0.031678867, shape=(), dtype=float32)
tf.Tensor(0.041358426, shape=(), dtype=float32)
Epoch: 380,loss: 0.03623042581602931
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044426065, shape=(), dtype=float32)
tf.Tensor(0.027382933, shape=(), dtype=float32)
tf.Tensor(0.03162944, shape=(), dtype=float32)
tf.Tensor(0.041315258, shape=(), dtype=float32)
Epoch: 381,loss: 0.03618842363357544
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04439163, shape=(), dtype=float32)
tf.Tensor(0.02734229, shape=(), dtype=float32)
tf.Tensor(0.03158023, shape=(), dtype=float32)
tf.Tensor(0.041272327, shape=(), dtype=float32)
Epoch: 382,loss: 0.0361466184258461
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04435735, shape=(), dtype=float32)
tf.Tensor(0.027301827, shape=(), dtype=float32)
tf.Tensor(0.03153126, shape=(), dtype=float32)
tf.Tensor(0.04122958, shape=(), dtype=float32)
Epoch: 383,loss: 0.03610500367358327
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044323247, shape=(), dtype=float32)
tf.Tensor(0.02726152, shape=(), dtype=float32)
tf.Tensor(0.03148246, shape=(), dtype=float32)
tf.Tensor(0.04118705, shape=(), dtype=float32)
Epoch: 384,loss: 0.0360635700635612
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04428932, shape=(), dtype=float32)
tf.Tensor(0.027221436, shape=(), dtype=float32)
tf.Tensor(0.031433906, shape=(), dtype=float32)
tf.Tensor(0.041144732, shape=(), dtype=float32)
Epoch: 385,loss: 0.036022348795086145
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044255555, shape=(), dtype=float32)
tf.Tensor(0.027181512, shape=(), dtype=float32)
tf.Tensor(0.03138554, shape=(), dtype=float32)
tf.Tensor(0.041102596, shape=(), dtype=float32)
Epoch: 386,loss: 0.03598130075260997
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04422192, shape=(), dtype=float32)
tf.Tensor(0.027141778, shape=(), dtype=float32)
tf.Tensor(0.031337384, shape=(), dtype=float32)
tf.Tensor(0.041060694, shape=(), dtype=float32)
Epoch: 387,loss: 0.03594044363126159
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04418844, shape=(), dtype=float32)
tf.Tensor(0.02710223, shape=(), dtype=float32)
tf.Tensor(0.03128944, shape=(), dtype=float32)
tf.Tensor(0.041018978, shape=(), dtype=float32)
Epoch: 388,loss: 0.035899771843105555
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044155132, shape=(), dtype=float32)
tf.Tensor(0.027062865, shape=(), dtype=float32)
tf.Tensor(0.0312417, shape=(), dtype=float32)
tf.Tensor(0.040977444, shape=(), dtype=float32)
Epoch: 389,loss: 0.03585928538814187
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04412198, shape=(), dtype=float32)
tf.Tensor(0.027023664, shape=(), dtype=float32)
tf.Tensor(0.031194158, shape=(), dtype=float32)
tf.Tensor(0.040936135, shape=(), dtype=float32)
Epoch: 390,loss: 0.035818984266370535
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044088975, shape=(), dtype=float32)
tf.Tensor(0.026984649, shape=(), dtype=float32)
tf.Tensor(0.031146824, shape=(), dtype=float32)
tf.Tensor(0.040895026, shape=(), dtype=float32)
Epoch: 391,loss: 0.03577886847779155
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044056114, shape=(), dtype=float32)
tf.Tensor(0.026945805, shape=(), dtype=float32)
tf.Tensor(0.031099698, shape=(), dtype=float32)
tf.Tensor(0.040854104, shape=(), dtype=float32)
Epoch: 392,loss: 0.035738930106163025
test_acc:  1.0
-----------------------------------
tf.Tensor(0.044023395, shape=(), dtype=float32)
tf.Tensor(0.026907146, shape=(), dtype=float32)
tf.Tensor(0.031052766, shape=(), dtype=float32)
tf.Tensor(0.04081337, shape=(), dtype=float32)
Epoch: 393,loss: 0.035699169617146254
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04399084, shape=(), dtype=float32)
tf.Tensor(0.02686865, shape=(), dtype=float32)
tf.Tensor(0.031006025, shape=(), dtype=float32)
tf.Tensor(0.040772848, shape=(), dtype=float32)
Epoch: 394,loss: 0.03565959073603153
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043958444, shape=(), dtype=float32)
tf.Tensor(0.026830316, shape=(), dtype=float32)
tf.Tensor(0.030959487, shape=(), dtype=float32)
tf.Tensor(0.040732495, shape=(), dtype=float32)
Epoch: 395,loss: 0.03562018554657698
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04392617, shape=(), dtype=float32)
tf.Tensor(0.02679219, shape=(), dtype=float32)
tf.Tensor(0.030913137, shape=(), dtype=float32)
tf.Tensor(0.040692355, shape=(), dtype=float32)
Epoch: 396,loss: 0.03558096243068576
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043894034, shape=(), dtype=float32)
tf.Tensor(0.026754206, shape=(), dtype=float32)
tf.Tensor(0.030866995, shape=(), dtype=float32)
tf.Tensor(0.040652405, shape=(), dtype=float32)
Epoch: 397,loss: 0.03554191021248698
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043862075, shape=(), dtype=float32)
tf.Tensor(0.02671639, shape=(), dtype=float32)
tf.Tensor(0.030821035, shape=(), dtype=float32)
tf.Tensor(0.04061262, shape=(), dtype=float32)
Epoch: 398,loss: 0.03550302982330322
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043830242, shape=(), dtype=float32)
tf.Tensor(0.026678747, shape=(), dtype=float32)
tf.Tensor(0.030775271, shape=(), dtype=float32)
tf.Tensor(0.040573042, shape=(), dtype=float32)
Epoch: 399,loss: 0.035464325454086065
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043798555, shape=(), dtype=float32)
tf.Tensor(0.02664127, shape=(), dtype=float32)
tf.Tensor(0.030729687, shape=(), dtype=float32)
tf.Tensor(0.040533636, shape=(), dtype=float32)
Epoch: 400,loss: 0.03542578686028719
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043767016, shape=(), dtype=float32)
tf.Tensor(0.026603967, shape=(), dtype=float32)
tf.Tensor(0.030684313, shape=(), dtype=float32)
tf.Tensor(0.040494416, shape=(), dtype=float32)
Epoch: 401,loss: 0.035387428011745214
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043735612, shape=(), dtype=float32)
tf.Tensor(0.026566813, shape=(), dtype=float32)
tf.Tensor(0.030639103, shape=(), dtype=float32)
tf.Tensor(0.040455393, shape=(), dtype=float32)
Epoch: 402,loss: 0.03534923028200865
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04370436, shape=(), dtype=float32)
tf.Tensor(0.026529828, shape=(), dtype=float32)
tf.Tensor(0.030594096, shape=(), dtype=float32)
tf.Tensor(0.04041654, shape=(), dtype=float32)
Epoch: 403,loss: 0.03531120577827096
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04367323, shape=(), dtype=float32)
tf.Tensor(0.02649299, shape=(), dtype=float32)
tf.Tensor(0.030549252, shape=(), dtype=float32)
tf.Tensor(0.040377878, shape=(), dtype=float32)
Epoch: 404,loss: 0.03527333727106452
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043642234, shape=(), dtype=float32)
tf.Tensor(0.026456354, shape=(), dtype=float32)
tf.Tensor(0.03050462, shape=(), dtype=float32)
tf.Tensor(0.04033938, shape=(), dtype=float32)
Epoch: 405,loss: 0.03523564711213112
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043611366, shape=(), dtype=float32)
tf.Tensor(0.02641985, shape=(), dtype=float32)
tf.Tensor(0.030460164, shape=(), dtype=float32)
tf.Tensor(0.040301085, shape=(), dtype=float32)
Epoch: 406,loss: 0.03519811620935798
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043580655, shape=(), dtype=float32)
tf.Tensor(0.026383502, shape=(), dtype=float32)
tf.Tensor(0.030415868, shape=(), dtype=float32)
tf.Tensor(0.04026295, shape=(), dtype=float32)
Epoch: 407,loss: 0.03516074363142252
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043550078, shape=(), dtype=float32)
tf.Tensor(0.026347322, shape=(), dtype=float32)
tf.Tensor(0.03037177, shape=(), dtype=float32)
tf.Tensor(0.040224995, shape=(), dtype=float32)
Epoch: 408,loss: 0.03512354148551822
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043519605, shape=(), dtype=float32)
tf.Tensor(0.02631131, shape=(), dtype=float32)
tf.Tensor(0.030327857, shape=(), dtype=float32)
tf.Tensor(0.040187214, shape=(), dtype=float32)
Epoch: 409,loss: 0.03508649626746774
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043489292, shape=(), dtype=float32)
tf.Tensor(0.026275434, shape=(), dtype=float32)
tf.Tensor(0.030284122, shape=(), dtype=float32)
tf.Tensor(0.04014961, shape=(), dtype=float32)
Epoch: 410,loss: 0.0350496144965291
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043459106, shape=(), dtype=float32)
tf.Tensor(0.026239706, shape=(), dtype=float32)
tf.Tensor(0.030240543, shape=(), dtype=float32)
tf.Tensor(0.040112182, shape=(), dtype=float32)
Epoch: 411,loss: 0.03501288453117013
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043429058, shape=(), dtype=float32)
tf.Tensor(0.026204145, shape=(), dtype=float32)
tf.Tensor(0.030197158, shape=(), dtype=float32)
tf.Tensor(0.040074926, shape=(), dtype=float32)
Epoch: 412,loss: 0.0349763217382133
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043399114, shape=(), dtype=float32)
tf.Tensor(0.026168743, shape=(), dtype=float32)
tf.Tensor(0.03015395, shape=(), dtype=float32)
tf.Tensor(0.040037837, shape=(), dtype=float32)
Epoch: 413,loss: 0.03493991121649742
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043369334, shape=(), dtype=float32)
tf.Tensor(0.02613349, shape=(), dtype=float32)
tf.Tensor(0.030110897, shape=(), dtype=float32)
tf.Tensor(0.040000923, shape=(), dtype=float32)
Epoch: 414,loss: 0.03490366134792566
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04333968, shape=(), dtype=float32)
tf.Tensor(0.02609837, shape=(), dtype=float32)
tf.Tensor(0.03006803, shape=(), dtype=float32)
tf.Tensor(0.039964154, shape=(), dtype=float32)
Epoch: 415,loss: 0.03486755909398198
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043310095, shape=(), dtype=float32)
tf.Tensor(0.026063433, shape=(), dtype=float32)
tf.Tensor(0.030025331, shape=(), dtype=float32)
tf.Tensor(0.03992758, shape=(), dtype=float32)
Epoch: 416,loss: 0.034831609576940536
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043280695, shape=(), dtype=float32)
tf.Tensor(0.026028618, shape=(), dtype=float32)
tf.Tensor(0.029982803, shape=(), dtype=float32)
tf.Tensor(0.039891165, shape=(), dtype=float32)
Epoch: 417,loss: 0.034795820247381926
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043251395, shape=(), dtype=float32)
tf.Tensor(0.025993964, shape=(), dtype=float32)
tf.Tensor(0.029940443, shape=(), dtype=float32)
tf.Tensor(0.03985491, shape=(), dtype=float32)
Epoch: 418,loss: 0.034760178066790104
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043222237, shape=(), dtype=float32)
tf.Tensor(0.025959441, shape=(), dtype=float32)
tf.Tensor(0.029898249, shape=(), dtype=float32)
tf.Tensor(0.03981882, shape=(), dtype=float32)
Epoch: 419,loss: 0.03472468676045537
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04319321, shape=(), dtype=float32)
tf.Tensor(0.02592508, shape=(), dtype=float32)
tf.Tensor(0.029856235, shape=(), dtype=float32)
tf.Tensor(0.0397829, shape=(), dtype=float32)
Epoch: 420,loss: 0.03468935610726476
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043164257, shape=(), dtype=float32)
tf.Tensor(0.025890872, shape=(), dtype=float32)
tf.Tensor(0.029814376, shape=(), dtype=float32)
tf.Tensor(0.039747145, shape=(), dtype=float32)
Epoch: 421,loss: 0.03465416235849261
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043135475, shape=(), dtype=float32)
tf.Tensor(0.025856787, shape=(), dtype=float32)
tf.Tensor(0.029772684, shape=(), dtype=float32)
tf.Tensor(0.039711535, shape=(), dtype=float32)
Epoch: 422,loss: 0.03461912041530013
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043106798, shape=(), dtype=float32)
tf.Tensor(0.025822854, shape=(), dtype=float32)
tf.Tensor(0.029731134, shape=(), dtype=float32)
tf.Tensor(0.0396761, shape=(), dtype=float32)
Epoch: 423,loss: 0.03458422143012285
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043078233, shape=(), dtype=float32)
tf.Tensor(0.025789062, shape=(), dtype=float32)
tf.Tensor(0.02968978, shape=(), dtype=float32)
tf.Tensor(0.03964081, shape=(), dtype=float32)
Epoch: 424,loss: 0.034549470990896225
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043049783, shape=(), dtype=float32)
tf.Tensor(0.02575542, shape=(), dtype=float32)
tf.Tensor(0.029648578, shape=(), dtype=float32)
tf.Tensor(0.039605696, shape=(), dtype=float32)
Epoch: 425,loss: 0.03451486909762025
test_acc:  1.0
-----------------------------------
tf.Tensor(0.043021455, shape=(), dtype=float32)
tf.Tensor(0.025721902, shape=(), dtype=float32)
tf.Tensor(0.029607529, shape=(), dtype=float32)
tf.Tensor(0.039570734, shape=(), dtype=float32)
Epoch: 426,loss: 0.034480405040085316
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04299328, shape=(), dtype=float32)
tf.Tensor(0.025688544, shape=(), dtype=float32)
tf.Tensor(0.029566636, shape=(), dtype=float32)
tf.Tensor(0.039535925, shape=(), dtype=float32)
Epoch: 427,loss: 0.03444609651342034
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04296519, shape=(), dtype=float32)
tf.Tensor(0.025655307, shape=(), dtype=float32)
tf.Tensor(0.029525915, shape=(), dtype=float32)
tf.Tensor(0.039501257, shape=(), dtype=float32)
Epoch: 428,loss: 0.034411916974931955
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042937215, shape=(), dtype=float32)
tf.Tensor(0.025622226, shape=(), dtype=float32)
tf.Tensor(0.029485345, shape=(), dtype=float32)
tf.Tensor(0.039466757, shape=(), dtype=float32)
Epoch: 429,loss: 0.03437788598239422
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04290937, shape=(), dtype=float32)
tf.Tensor(0.025589263, shape=(), dtype=float32)
tf.Tensor(0.029444939, shape=(), dtype=float32)
tf.Tensor(0.03943242, shape=(), dtype=float32)
Epoch: 430,loss: 0.034343997947871685
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042881634, shape=(), dtype=float32)
tf.Tensor(0.02555644, shape=(), dtype=float32)
tf.Tensor(0.02940467, shape=(), dtype=float32)
tf.Tensor(0.039398234, shape=(), dtype=float32)
Epoch: 431,loss: 0.034310244489461184
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042854, shape=(), dtype=float32)
tf.Tensor(0.025523761, shape=(), dtype=float32)
tf.Tensor(0.029364571, shape=(), dtype=float32)
tf.Tensor(0.039364178, shape=(), dtype=float32)
Epoch: 432,loss: 0.03427662746980786
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04282647, shape=(), dtype=float32)
tf.Tensor(0.025491208, shape=(), dtype=float32)
tf.Tensor(0.029324621, shape=(), dtype=float32)
tf.Tensor(0.03933029, shape=(), dtype=float32)
Epoch: 433,loss: 0.034243146888911724
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04279908, shape=(), dtype=float32)
tf.Tensor(0.025458792, shape=(), dtype=float32)
tf.Tensor(0.029284835, shape=(), dtype=float32)
tf.Tensor(0.03929654, shape=(), dtype=float32)
Epoch: 434,loss: 0.0342098125256598
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042771783, shape=(), dtype=float32)
tf.Tensor(0.025426516, shape=(), dtype=float32)
tf.Tensor(0.029245181, shape=(), dtype=float32)
tf.Tensor(0.039262954, shape=(), dtype=float32)
Epoch: 435,loss: 0.03417660854756832
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042744596, shape=(), dtype=float32)
tf.Tensor(0.025394365, shape=(), dtype=float32)
tf.Tensor(0.029205695, shape=(), dtype=float32)
tf.Tensor(0.039229497, shape=(), dtype=float32)
Epoch: 436,loss: 0.0341435382142663
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042717535, shape=(), dtype=float32)
tf.Tensor(0.025362343, shape=(), dtype=float32)
tf.Tensor(0.029166361, shape=(), dtype=float32)
tf.Tensor(0.039196204, shape=(), dtype=float32)
Epoch: 437,loss: 0.03411061083897948
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042690586, shape=(), dtype=float32)
tf.Tensor(0.025330449, shape=(), dtype=float32)
tf.Tensor(0.029127166, shape=(), dtype=float32)
tf.Tensor(0.039163038, shape=(), dtype=float32)
Epoch: 438,loss: 0.034077809657901525
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042663734, shape=(), dtype=float32)
tf.Tensor(0.02529869, shape=(), dtype=float32)
tf.Tensor(0.029088117, shape=(), dtype=float32)
tf.Tensor(0.03913004, shape=(), dtype=float32)
Epoch: 439,loss: 0.03404514538124204
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042636987, shape=(), dtype=float32)
tf.Tensor(0.025267074, shape=(), dtype=float32)
tf.Tensor(0.029049233, shape=(), dtype=float32)
tf.Tensor(0.03909717, shape=(), dtype=float32)
Epoch: 440,loss: 0.03401261614635587
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042610347, shape=(), dtype=float32)
tf.Tensor(0.02523557, shape=(), dtype=float32)
tf.Tensor(0.029010475, shape=(), dtype=float32)
tf.Tensor(0.03906445, shape=(), dtype=float32)
Epoch: 441,loss: 0.03398020984604955
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042583805, shape=(), dtype=float32)
tf.Tensor(0.025204197, shape=(), dtype=float32)
tf.Tensor(0.028971866, shape=(), dtype=float32)
tf.Tensor(0.039031863, shape=(), dtype=float32)
Epoch: 442,loss: 0.03394793253391981
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04255739, shape=(), dtype=float32)
tf.Tensor(0.025172947, shape=(), dtype=float32)
tf.Tensor(0.028933406, shape=(), dtype=float32)
tf.Tensor(0.03899943, shape=(), dtype=float32)
Epoch: 443,loss: 0.03391579305753112
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042531062, shape=(), dtype=float32)
tf.Tensor(0.025141822, shape=(), dtype=float32)
tf.Tensor(0.02889508, shape=(), dtype=float32)
tf.Tensor(0.03896713, shape=(), dtype=float32)
Epoch: 444,loss: 0.033883773256093264
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042504847, shape=(), dtype=float32)
tf.Tensor(0.02511082, shape=(), dtype=float32)
tf.Tensor(0.028856924, shape=(), dtype=float32)
tf.Tensor(0.038934965, shape=(), dtype=float32)
Epoch: 445,loss: 0.033851888962090015
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042478755, shape=(), dtype=float32)
tf.Tensor(0.02507995, shape=(), dtype=float32)
tf.Tensor(0.028818877, shape=(), dtype=float32)
tf.Tensor(0.038902946, shape=(), dtype=float32)
Epoch: 446,loss: 0.03382013225927949
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04245274, shape=(), dtype=float32)
tf.Tensor(0.025049195, shape=(), dtype=float32)
tf.Tensor(0.028780997, shape=(), dtype=float32)
tf.Tensor(0.038871065, shape=(), dtype=float32)
Epoch: 447,loss: 0.03378849942237139
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04242683, shape=(), dtype=float32)
tf.Tensor(0.025018563, shape=(), dtype=float32)
tf.Tensor(0.028743232, shape=(), dtype=float32)
tf.Tensor(0.03883932, shape=(), dtype=float32)
Epoch: 448,loss: 0.033756986260414124
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042401027, shape=(), dtype=float32)
tf.Tensor(0.024988055, shape=(), dtype=float32)
tf.Tensor(0.028705642, shape=(), dtype=float32)
tf.Tensor(0.03880771, shape=(), dtype=float32)
Epoch: 449,loss: 0.03372560814023018
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042375308, shape=(), dtype=float32)
tf.Tensor(0.024957685, shape=(), dtype=float32)
tf.Tensor(0.02866817, shape=(), dtype=float32)
tf.Tensor(0.038776234, shape=(), dtype=float32)
Epoch: 450,loss: 0.033694349229335785
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042349707, shape=(), dtype=float32)
tf.Tensor(0.024927415, shape=(), dtype=float32)
tf.Tensor(0.028630832, shape=(), dtype=float32)
tf.Tensor(0.038744893, shape=(), dtype=float32)
Epoch: 451,loss: 0.03366321185603738
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042324197, shape=(), dtype=float32)
tf.Tensor(0.024897272, shape=(), dtype=float32)
tf.Tensor(0.028593644, shape=(), dtype=float32)
tf.Tensor(0.03871369, shape=(), dtype=float32)
Epoch: 452,loss: 0.03363220067694783
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042298783, shape=(), dtype=float32)
tf.Tensor(0.024867246, shape=(), dtype=float32)
tf.Tensor(0.028556578, shape=(), dtype=float32)
tf.Tensor(0.038682625, shape=(), dtype=float32)
Epoch: 453,loss: 0.03360130777582526
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042273503, shape=(), dtype=float32)
tf.Tensor(0.02483734, shape=(), dtype=float32)
tf.Tensor(0.028519666, shape=(), dtype=float32)
tf.Tensor(0.03865168, shape=(), dtype=float32)
Epoch: 454,loss: 0.033570546656847
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04224828, shape=(), dtype=float32)
tf.Tensor(0.024807544, shape=(), dtype=float32)
tf.Tensor(0.028482864, shape=(), dtype=float32)
tf.Tensor(0.038620874, shape=(), dtype=float32)
Epoch: 455,loss: 0.03353989031165838
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042223167, shape=(), dtype=float32)
tf.Tensor(0.024777867, shape=(), dtype=float32)
tf.Tensor(0.028446203, shape=(), dtype=float32)
tf.Tensor(0.038590193, shape=(), dtype=float32)
Epoch: 456,loss: 0.0335093573667109
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042198163, shape=(), dtype=float32)
tf.Tensor(0.024748301, shape=(), dtype=float32)
tf.Tensor(0.02840969, shape=(), dtype=float32)
tf.Tensor(0.03855965, shape=(), dtype=float32)
Epoch: 457,loss: 0.03347895061597228
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04217322, shape=(), dtype=float32)
tf.Tensor(0.02471888, shape=(), dtype=float32)
tf.Tensor(0.028373307, shape=(), dtype=float32)
tf.Tensor(0.038529232, shape=(), dtype=float32)
Epoch: 458,loss: 0.03344866028055549
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042148385, shape=(), dtype=float32)
tf.Tensor(0.024689535, shape=(), dtype=float32)
tf.Tensor(0.02833704, shape=(), dtype=float32)
tf.Tensor(0.038498938, shape=(), dtype=float32)
Epoch: 459,loss: 0.03341847471892834
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042123675, shape=(), dtype=float32)
tf.Tensor(0.024660328, shape=(), dtype=float32)
tf.Tensor(0.028300898, shape=(), dtype=float32)
tf.Tensor(0.03846878, shape=(), dtype=float32)
Epoch: 460,loss: 0.033388420939445496
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04209903, shape=(), dtype=float32)
tf.Tensor(0.02463123, shape=(), dtype=float32)
tf.Tensor(0.028264917, shape=(), dtype=float32)
tf.Tensor(0.038438745, shape=(), dtype=float32)
Epoch: 461,loss: 0.03335848031565547
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04207449, shape=(), dtype=float32)
tf.Tensor(0.02460224, shape=(), dtype=float32)
tf.Tensor(0.028229056, shape=(), dtype=float32)
tf.Tensor(0.038408834, shape=(), dtype=float32)
Epoch: 462,loss: 0.033328655175864697
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042050045, shape=(), dtype=float32)
tf.Tensor(0.024573369, shape=(), dtype=float32)
tf.Tensor(0.028193308, shape=(), dtype=float32)
tf.Tensor(0.038379043, shape=(), dtype=float32)
Epoch: 463,loss: 0.03329894132912159
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042025685, shape=(), dtype=float32)
tf.Tensor(0.024544591, shape=(), dtype=float32)
tf.Tensor(0.02815769, shape=(), dtype=float32)
tf.Tensor(0.03834938, shape=(), dtype=float32)
Epoch: 464,loss: 0.03326933644711971
test_acc:  1.0
-----------------------------------
tf.Tensor(0.042001396, shape=(), dtype=float32)
tf.Tensor(0.024515947, shape=(), dtype=float32)
tf.Tensor(0.028122216, shape=(), dtype=float32)
tf.Tensor(0.038319852, shape=(), dtype=float32)
Epoch: 465,loss: 0.03323985310271382
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041977227, shape=(), dtype=float32)
tf.Tensor(0.024487404, shape=(), dtype=float32)
tf.Tensor(0.028086865, shape=(), dtype=float32)
tf.Tensor(0.038290426, shape=(), dtype=float32)
Epoch: 466,loss: 0.03321048058569431
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041953146, shape=(), dtype=float32)
tf.Tensor(0.02445898, shape=(), dtype=float32)
tf.Tensor(0.02805163, shape=(), dtype=float32)
tf.Tensor(0.03826114, shape=(), dtype=float32)
Epoch: 467,loss: 0.03318122448399663
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04192917, shape=(), dtype=float32)
tf.Tensor(0.024430647, shape=(), dtype=float32)
tf.Tensor(0.028016517, shape=(), dtype=float32)
tf.Tensor(0.038231976, shape=(), dtype=float32)
Epoch: 468,loss: 0.033152077812701464
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041905254, shape=(), dtype=float32)
tf.Tensor(0.02440242, shape=(), dtype=float32)
tf.Tensor(0.027981529, shape=(), dtype=float32)
tf.Tensor(0.038202915, shape=(), dtype=float32)
Epoch: 469,loss: 0.03312302939593792
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04188143, shape=(), dtype=float32)
tf.Tensor(0.024374312, shape=(), dtype=float32)
tf.Tensor(0.02794668, shape=(), dtype=float32)
tf.Tensor(0.038173992, shape=(), dtype=float32)
Epoch: 470,loss: 0.033094103913754225
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04185771, shape=(), dtype=float32)
tf.Tensor(0.024346305, shape=(), dtype=float32)
tf.Tensor(0.027911939, shape=(), dtype=float32)
tf.Tensor(0.038145185, shape=(), dtype=float32)
Epoch: 471,loss: 0.03306528413668275
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041834068, shape=(), dtype=float32)
tf.Tensor(0.024318412, shape=(), dtype=float32)
tf.Tensor(0.027877329, shape=(), dtype=float32)
tf.Tensor(0.038116496, shape=(), dtype=float32)
Epoch: 472,loss: 0.03303657611832023
test_acc:  1.0
-----------------------------------
tf.Tensor(0.0418105, shape=(), dtype=float32)
tf.Tensor(0.02429063, shape=(), dtype=float32)
tf.Tensor(0.02784284, shape=(), dtype=float32)
tf.Tensor(0.038087923, shape=(), dtype=float32)
Epoch: 473,loss: 0.03300797380506992
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04178704, shape=(), dtype=float32)
tf.Tensor(0.02426294, shape=(), dtype=float32)
tf.Tensor(0.027808463, shape=(), dtype=float32)
tf.Tensor(0.038059466, shape=(), dtype=float32)
Epoch: 474,loss: 0.03297947719693184
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041763663, shape=(), dtype=float32)
tf.Tensor(0.024235358, shape=(), dtype=float32)
tf.Tensor(0.027774205, shape=(), dtype=float32)
tf.Tensor(0.038031124, shape=(), dtype=float32)
Epoch: 475,loss: 0.032951087690889835
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041740358, shape=(), dtype=float32)
tf.Tensor(0.024207875, shape=(), dtype=float32)
tf.Tensor(0.027740082, shape=(), dtype=float32)
tf.Tensor(0.038002916, shape=(), dtype=float32)
Epoch: 476,loss: 0.03292280761525035
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041717153, shape=(), dtype=float32)
tf.Tensor(0.024180507, shape=(), dtype=float32)
tf.Tensor(0.027706066, shape=(), dtype=float32)
tf.Tensor(0.03797481, shape=(), dtype=float32)
Epoch: 477,loss: 0.03289463371038437
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041694026, shape=(), dtype=float32)
tf.Tensor(0.024153223, shape=(), dtype=float32)
tf.Tensor(0.027672162, shape=(), dtype=float32)
tf.Tensor(0.037946813, shape=(), dtype=float32)
Epoch: 478,loss: 0.03286655619740486
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041670993, shape=(), dtype=float32)
tf.Tensor(0.024126066, shape=(), dtype=float32)
tf.Tensor(0.027638389, shape=(), dtype=float32)
tf.Tensor(0.037918933, shape=(), dtype=float32)
Epoch: 479,loss: 0.03283859509974718
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04164801, shape=(), dtype=float32)
tf.Tensor(0.024098994, shape=(), dtype=float32)
tf.Tensor(0.027604738, shape=(), dtype=float32)
tf.Tensor(0.037891176, shape=(), dtype=float32)
Epoch: 480,loss: 0.032810729928314686
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04162513, shape=(), dtype=float32)
tf.Tensor(0.024072029, shape=(), dtype=float32)
tf.Tensor(0.027571186, shape=(), dtype=float32)
tf.Tensor(0.03786352, shape=(), dtype=float32)
Epoch: 481,loss: 0.032782966271042824
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041602362, shape=(), dtype=float32)
tf.Tensor(0.024045149, shape=(), dtype=float32)
tf.Tensor(0.027537754, shape=(), dtype=float32)
tf.Tensor(0.037835985, shape=(), dtype=float32)
Epoch: 482,loss: 0.032755312509834766
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041579645, shape=(), dtype=float32)
tf.Tensor(0.024018383, shape=(), dtype=float32)
tf.Tensor(0.027504444, shape=(), dtype=float32)
tf.Tensor(0.037808552, shape=(), dtype=float32)
Epoch: 483,loss: 0.032727756071835756
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04155699, shape=(), dtype=float32)
tf.Tensor(0.023991706, shape=(), dtype=float32)
tf.Tensor(0.027471239, shape=(), dtype=float32)
tf.Tensor(0.037781224, shape=(), dtype=float32)
Epoch: 484,loss: 0.032700289972126484
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041534454, shape=(), dtype=float32)
tf.Tensor(0.023965143, shape=(), dtype=float32)
tf.Tensor(0.027438149, shape=(), dtype=float32)
tf.Tensor(0.037754036, shape=(), dtype=float32)
Epoch: 485,loss: 0.0326729454100132
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041511986, shape=(), dtype=float32)
tf.Tensor(0.023938663, shape=(), dtype=float32)
tf.Tensor(0.02740517, shape=(), dtype=float32)
tf.Tensor(0.037726924, shape=(), dtype=float32)
Epoch: 486,loss: 0.03264568606391549
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041489586, shape=(), dtype=float32)
tf.Tensor(0.023912296, shape=(), dtype=float32)
tf.Tensor(0.027372308, shape=(), dtype=float32)
tf.Tensor(0.03769994, shape=(), dtype=float32)
Epoch: 487,loss: 0.03261853288859129
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041467294, shape=(), dtype=float32)
tf.Tensor(0.023886016, shape=(), dtype=float32)
tf.Tensor(0.027339553, shape=(), dtype=float32)
tf.Tensor(0.037673064, shape=(), dtype=float32)
Epoch: 488,loss: 0.03259148169308901
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041445065, shape=(), dtype=float32)
tf.Tensor(0.023859838, shape=(), dtype=float32)
tf.Tensor(0.027306924, shape=(), dtype=float32)
tf.Tensor(0.037646286, shape=(), dtype=float32)
Epoch: 489,loss: 0.03256452828645706
test_acc:  1.0
-----------------------------------
tf.Tensor(0.0414229, shape=(), dtype=float32)
tf.Tensor(0.023833757, shape=(), dtype=float32)
tf.Tensor(0.02727439, shape=(), dtype=float32)
tf.Tensor(0.037619635, shape=(), dtype=float32)
Epoch: 490,loss: 0.0325376708060503
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041400835, shape=(), dtype=float32)
tf.Tensor(0.023807764, shape=(), dtype=float32)
tf.Tensor(0.027241984, shape=(), dtype=float32)
tf.Tensor(0.037593074, shape=(), dtype=float32)
Epoch: 491,loss: 0.032510914374142885
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04137883, shape=(), dtype=float32)
tf.Tensor(0.023781871, shape=(), dtype=float32)
tf.Tensor(0.02720967, shape=(), dtype=float32)
tf.Tensor(0.037566625, shape=(), dtype=float32)
Epoch: 492,loss: 0.032484248746186495
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041356906, shape=(), dtype=float32)
tf.Tensor(0.023756072, shape=(), dtype=float32)
tf.Tensor(0.027177466, shape=(), dtype=float32)
tf.Tensor(0.037540276, shape=(), dtype=float32)
Epoch: 493,loss: 0.032457679975777864
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041335084, shape=(), dtype=float32)
tf.Tensor(0.023730358, shape=(), dtype=float32)
tf.Tensor(0.027145362, shape=(), dtype=float32)
tf.Tensor(0.037514035, shape=(), dtype=float32)
Epoch: 494,loss: 0.032431209459900856
test_acc:  1.0
-----------------------------------
tf.Tensor(0.04131331, shape=(), dtype=float32)
tf.Tensor(0.023704747, shape=(), dtype=float32)
tf.Tensor(0.027113393, shape=(), dtype=float32)
tf.Tensor(0.037487894, shape=(), dtype=float32)
Epoch: 495,loss: 0.03240483580157161
test_acc:  1.0
-----------------------------------
tf.Tensor(0.0412916, shape=(), dtype=float32)
tf.Tensor(0.023679232, shape=(), dtype=float32)
tf.Tensor(0.027081514, shape=(), dtype=float32)
tf.Tensor(0.03746187, shape=(), dtype=float32)
Epoch: 496,loss: 0.03237855341285467
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041269995, shape=(), dtype=float32)
tf.Tensor(0.023653788, shape=(), dtype=float32)
tf.Tensor(0.027049735, shape=(), dtype=float32)
tf.Tensor(0.037435926, shape=(), dtype=float32)
Epoch: 497,loss: 0.03235236136242747
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041248456, shape=(), dtype=float32)
tf.Tensor(0.02362845, shape=(), dtype=float32)
tf.Tensor(0.027018068, shape=(), dtype=float32)
tf.Tensor(0.0374101, shape=(), dtype=float32)
Epoch: 498,loss: 0.03232626849785447
test_acc:  1.0
-----------------------------------
tf.Tensor(0.041226998, shape=(), dtype=float32)
tf.Tensor(0.023603203, shape=(), dtype=float32)
tf.Tensor(0.026986517, shape=(), dtype=float32)
tf.Tensor(0.037384376, shape=(), dtype=float32)
Epoch: 499,loss: 0.032300273422151804
test_acc:  1.0
-----------------------------------
print(train_db)
<BatchDataset shapes: ((None, 4), (None,)), types: (tf.float64, tf.int32)>
from matplotlib import pyplot as plt
# 绘制loss曲线
plt.title('loss function curve ')  #图标
plt.xlabel('epoch')  #x轴变量名称
plt.ylabel('loss')  #y轴名称
plt.plot(train_loss_results,label = '$loss$')  #逐点画出,并连线
plt.legend()   #画出曲线图标
plt.show()  # 画出图像


# 绘制acc曲线
plt.title('acc curve')
plt.xlabel('epoch')
plt.ylabel('acc')
plt.plot(test_acc,label = '$accuracy$')
plt.legend()
plt.show()
  

在这里插入图片描述
在这里插入图片描述

神经网路优化过程,使用正则化减少过拟合,使用优化器来更新网络参数

预备知识:

神经网络复杂度
指数衰减学习率
激活函数
损失函数
欠拟合和过拟合
正则化减少过拟合
优化器更新网络参数

相关函数介绍

# 相关函数
# tf.where(条件语句,真返回a,假返回b)
# tf.greater(a,b) 判断a是否大于b
a = tf.constant([1,2,3,1,1])
b = tf.constant([0,1,2,4,6])
c = tf.where(tf.greater(a,b),a,b)
print('c:',c)
c: tf.Tensor([1 2 3 4 6], shape=(5,), dtype=int32)
# 返回[0,1)的随机数
# np.random.RandomState.rand(维度)
import numpy as np
rdm = np.random.RandomState(seed=1)
a = rdm.rand()   # 返回标量
b = rdm.rand(2,3)   #返回2*3的随机矩阵
print('a:',a)
print('b:',b)
a: 0.417022004702574
b: [[7.20324493e-01 1.14374817e-04 3.02332573e-01]
 [1.46755891e-01 9.23385948e-02 1.86260211e-01]]
# 将两个数组按照垂直方向进行叠加
# np.vstack((a,b))  注意两个括号
a = np.array([1,2,3])
b = np.array([2,3,4])
c = np.vstack((a,b))
print('c:',c)
c: [[1 2 3]
 [2 3 4]]
# 网格函数
# x,y = np.mgrid[初始值:结束值:步长,初始值:结束值:步长,。。。]
# x.ravel()   将x变成一维数组,也就是把x拉长
# c = np.c_[x.ravel(),y.ravel()]  # 广播式配对

x,y = np.mgrid[1:3:1,2:4:0.5]
# 本来x是[1,2],y是[2,2.5,3,3.5],但是为了让维度匹配,就需要对维度进行广播,都变成2行4列
print('x:\n',x)
print('y:\n',y)

c = np.c_[x.ravel(),y.ravel()]
print('c:\n',c)
x:
 [[1. 1. 1. 1.]
 [2. 2. 2. 2.]]
y:
 [[2.  2.5 3.  3.5]
 [2.  2.5 3.  3.5]]
c:
 [[1.  2. ]
 [1.  2.5]
 [1.  3. ]
 [1.  3.5]
 [2.  2. ]
 [2.  2.5]
 [2.  3. ]
 [2.  3.5]]

复杂度和学习率

# 神经网络复杂度:多用层数和参数表示:
# 空间复杂度:层数= 隐藏层层数 + 输出层层数
#             总参数=总W + 总b
# 时间复杂度:乘加运算次数 
# 指数衰减学习率:
# 可以先用较大的学习率,快速得到较优解,然后逐步减小学习率,使得模型在训练后期稳定
# 指数衰减学习率 = 初始学习率* 学习率衰减率(当前轮数/多少轮衰减一次)
lr_base = 0.2
lr_decay = 0.99
lr_step = 1
for epoch in range(epoch):
    lr = lr_base *lr_decay**(epoch/lr_step)
    ...

激活函数

# # 激活函数:

# tf.nn.sigmoid(x)
# f(x) = 1/(1+e^x)   倒S型
# 特点:容易造成梯度消失
#     输出非零均值,收敛较慢
#     幂运算复杂,训练时间较长
 
 
# tf.math.tanh(x)
# f(x) = (1-e^(-2x))/(1+e^(-2x))   倒z型,
# 特点:输出是0均值
#     容易造成梯度消失
#     幂运算复杂,训练时间长
    

# tf.nn.relu(x)
# f(x) = max(x,0)
# 优点:在正区间解决了梯度消失
#     只需要判断输入是否大于0,计算快
#     收敛速度远快于前两个
# 缺点:输出非0均值,收敛慢
#     deadrelu问题:某些神经元可能永远不会被激活,导致相应的参数永远不可能被更新
    
    
# tf.nn.leaky_relu(x)
# f(x) = max(x,ax)
# 理论上讲leaky_relu有relu的所有优点,外加不会有dead_relu的问题,
# 但是实际中,并没有完全证明优于relu


# 初学者建议:
# 首选relu激活函数,
# 学习率设置较小值
# 输入特征标准化,也就是满足以0为均值,1为标准差的正太分布
# 初始参数中心化,即,让随机生成的参数满足0为均值,根号下(2/当前层输入特征个数)为标准差的正太分布

损失函数

# 损失函数最小:预测值y和真实值y_的距离
# 损失函数一般有mse,自定义,ce,

# mse:mse = (sum(yi-y_i)^2)/n
#     tf.reduce_mean(tf.square(y-y_))

# ce:交叉熵损失函数(cross entropy),表示两个概率分布之间的距离,分类的
#     h(y_,y) = -sum(y_*lny)
#     tf.losses.categorical_crossentropy(y_,y)
loss1 = tf.losses.categorical_crossentropy([1,0],[0.6,0.4])
loss2 = tf.losses.categorical_crossentropy([1,0],[0.8,0.2])
print(loss1)
print(loss2)
    
# softmax和交叉熵结合:输出先通过softmax再计算交叉熵损失函数
# tf.nn.softmax_cross_enptropy_with_logits(y_,y)
y_ = np.array([[1,0,0],[0,1,0],[0,0,1],[1,0,0],[0,1,0]])
y = np.array([[12,3,2],[3,10,1],[1,2,5],[4,6.5,1.2],[3,6,1]])
y_pro = tf.nn.softmax(y)
loss_ce1 = tf.losses.categorical_crossentropy(y_,y_pro)
loss_ce2 = tf.nn.softmax_cross_entropy_with_logits(y_,y)
print('分布计算结果:\n',loss_ce1)
print('结合计算结果:\n',loss_ce2)
tf.Tensor(0.5108256, shape=(), dtype=float32)
tf.Tensor(0.22314353, shape=(), dtype=float32)
分布计算结果:
 tf.Tensor(
[1.68795487e-04 1.03475622e-03 6.58839038e-02 2.58349207e+00
 5.49852354e-02], shape=(5,), dtype=float64)
结合计算结果:
 tf.Tensor(
[1.68795487e-04 1.03475622e-03 6.58839038e-02 2.58349207e+00
 5.49852354e-02], shape=(5,), dtype=float64)

过拟合和欠拟合

# 欠拟合和过拟合
# 欠拟合解决办法:
#     增加输入特征,增加网络参数,减少正则化参数
# 过拟合解决方法:
#     数据清洗,增大训练集,采用正则化,增大正则化参数

    
# 正则化:在损失函数中引入模型复杂度指标,利用给w加权值,弱化了训练数据的噪声,
# loss = loss(y,y_) + regularizer*loss(w)
# lossL1 = sum(|wi|)   #L1正则化
# lossL2 = sum(|wi^2|)   #L2正则化
# 正则化的选择:
# L1大概率会使得很多参数变为0,因此可以用来稀疏参数,减少参数数量,降低复杂度
# L2会使参数接近0但不是0,因此可以用来减小值的大小来降低复杂度

# 大概代码结构
with tf.GradientTape() as tape:
    h1 = tf.matmul(x_train,w1)+b1
    h1 = tf.nn.relu(h1)
    y = tf.matmul(h1,w2)+b2
    #均方误差计算损失函数
    loss_mse = tf.reduce_mean(tf.square(y-y_train))
    #添加L2正则化
    loss_regularization = []
    loss_regularization.append(tf.nn.l2_loss(w1))
    loss_regularization.append(tf.nn.l2_loss(w2))
    loss_regularization = tf.reduce_mean(loss_regularization)
    
    loss = loss_mse + 0.03*loss_regularization
#计算梯度
variables = [w1,b1,w2,b2]
grads = tape.gradient(loss,variables)

tf.Tensor(0.5108256, shape=(), dtype=float32)
tf.Tensor(0.22314353, shape=(), dtype=float32)

优化器

5种神经网络优化器


符号申明:待优化参数w,损失函数loss,学习率lr,每次迭代一个batch,t表示当前迭代的总次数
1、计算t时刻梯度:gt = dlt(loss) = loss对w求导
2、计算t时刻一阶动量mt和二阶动量vt
3、计算t时刻下降的梯度:nt=lr*mt/sqrt(vt)
4、计算t+1时刻参数:w(t+1) = wt-nt = wt-(lr*mt/sqrt(vt))
一阶动量:与梯度相关的函数
二阶动量:和梯度平方相关函数
动量相当于惯性,梯度相当于下降速度
5种优化器的本质就是不同的一阶动量和二阶动量


SGD,(不含momentum)随机梯度下降,
mt = gt,   vt = 1
nt = lr*mt/sqrt(vt)=lr*gt
w(t+1) = wt-nt = wt-lr*gt
代码:
w1.assign_sub(lr*grads[0])
b1.assign_sub(lr*grads[1])


SGDM(含momentum的SGD):在sgd基础上一阶动量发生变化
mt = beta*m(t-1) + (1-beta)*gt,   vt=1  #
nt = lr*mt/sqrt(vt) = lr*(beta*m(t-1)+(1-beta)*gt)
w(t+1) = wt-nt = wt-lr*(beta*m(t-1)+(1-beta)*gt)
代码:
m_w,m_b=0,0
beta=0.9   #beta经验来看是接近于1的数
m_w = beta*m_w + (1-beta)*grads[0]
m_b = beta*m_b + (1-beta)*grads[1]
w1.assign_sub(lr*m_w)
b1.assign_sub(lr*m_b)


Adagrad,在sgd基础上引入二阶动量
mt = gt,   vt = sum(g1^2,g1^2,...gt^2)
nt = lr*mt/sqrt(vt)
w(t+1) = wt-nt = wt - lr*gt/sqrt(sum(g1^2,g1^2,...gt^2))
代码:
v_w,v_b=0,0
v_w += tf.square(grads[0])
v_b += tf.square(grads[1])
w1.assign_sub(lr*grads[0]/tf.sqrt(v_w))
b1.assign_sub(lr*grads[1]/tf.sqrt(v_b))


RMSProp,sgd基础上变动二阶动量
mt = gt,   vt = bate*v(t-1)+(1-beta)*gt^2   #表征过去一段时间的平均值
#各时刻梯度平方的指数滑动平均
nt = lr*mt/sqrt(vt)
w(t+1) = wt-nt = wt-lr*gt/sqrt(beta*v(t-1)+(1-beta)*gt^2)
代码:
v_w,v_b=0,0
beta=0.9
v_w = beta*v_w + (1-beta)*tf.square(grads[0])
v_b = beta*v_b + (1-beta)*tf.square(grads[1])
w1.assign_sub(lr*grads[0]/tf.sqrt(v_w))
b1.assign_sub(lr*grads[1]/tf.sqrt(v_b))


Adam,同时结合SGDM一阶动量和RMSProp二阶动量
mt = beta1*m(t-1) + (1-beta1)*gt,   
修正一阶动量的偏差:mt_hat = mt/(1-beta1^t)
vt = bate2*v(t-1) + (1-beta2)*gt^2   
修正二阶动量的偏差:vt_hat = vt/(1-beta2^t)
nt = lr*mt_hat/sqrt(vt_hat) = lr * (mt/(1-beta1^t)) / sqrt(vt/(1-beta2^t))
w(t+1) = wt-nt = wt - lr * (mt/(1-beta1^t)) / sqrt(vt/(1-beta2^t))
代码:
m_w,m_b,v_w,v_b = 0,0,0,0
beta1,beta2=0.9,0.999
delta -w,delta_b=0,0
global_step=0


m_w = beta1*m_w+(1-beta1)*grads[0]
m_b = beta1*m_b+(1-beta1)*grads[1]
v_w = beta2*v_w+(1-beta2)*tf.square(grads[0])
v_b = beta2*v_b+(1-beta2)*tf.square(grads[1])
m_w_correction = m_w/(1-tf.pow(beta1,int(globel_step)))
m_b_correction = m_b/(1-tf.pow(beta1,int(globel_step)))
v_w_correction = v_w/(1-tf.pow(beta2,int(globel_step)))
v_b_correction = v_b/(1-tf.pow(beta2,int(globel_step)))

w1.assign_sub(lr*m_w_correction/tf.sqrt(v_w_correction))
b1.assign_sub(lr*m_b_correction/tf.sqrt(v_b_correction))



举报

相关推荐

0 条评论