DengQN·一个普通程序员;
【调包侠的机器学习】Kaggle手写数字识别2
2022-08-31 08:57 74
#kaggle#minst

就嗯叠层数

def Net():
    return tf.keras.models.Sequential([
        tf.keras.layers.Conv2D(filters=32, kernel_size=3, activation=tf.keras.activations.relu),
        tf.keras.layers.Conv2D(filters=32, kernel_size=3, activation=tf.keras.activations.relu),
        tf.keras.layers.Conv2D(filters=32, kernel_size=3, activation=tf.keras.activations.relu),
        tf.keras.layers.Conv2D(filters=32, kernel_size=3, activation=tf.keras.activations.relu),
        tf.keras.layers.MaxPool2D(pool_size=2, strides=2),
        tf.keras.layers.Dropout(0.2),
        tf.keras.layers.Conv2D(filters=64, kernel_size=3, activation=tf.keras.activations.relu),
        tf.keras.layers.Conv2D(filters=64, kernel_size=3, activation=tf.keras.activations.relu),
        tf.keras.layers.Conv2D(filters=64, kernel_size=3, activation=tf.keras.activations.relu),
        tf.keras.layers.MaxPool2D(pool_size=2, strides=2),
        tf.keras.layers.Dropout(0.2),
        tf.keras.layers.Flatten(),
        tf.keras.layers.Dense(128, activation=tf.keras.activations.relu),
        tf.keras.layers.Dense(128, activation=tf.keras.activations.relu),
        tf.keras.layers.Dropout(0.1),
        tf.keras.layers.Dense(10, activation=tf.keras.activations.softmax)
    ])

kaggle (276/1000)