cifer数据集提供的是6万张32*32大小的三通道彩色图像,共有10类分别为:飞机,汽车,鸟,猫,鹿,狗,青蛙,马,船,卡车
结构: 一层卷积,两层全连接
6个5×5的卷积核,步长为1
2×2的最大值池化,步长为2
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.keras import Model
import pandas as pd
(x_train,y_train),(x_test,y_test)=tf.keras.datasets.cifar10.load_data()
x_train,x_test=x_train/255.0,x_test/255.0
class Baseline(Model):#继承父类Model
def __init__(self):
super(Baseline,self).__init__() #继承Model的方法属性
self.c1=tf.keras.layers.Conv2D(filters=6,kernel_size=(5,5),padding="same",input_shape=(32,32,3))
self