-1
我用tflearn.DNN建立一個深層神經網絡:降低總損失在深層神經網絡
# Build neural network
net = tflearn.input_data(shape=[None, 5], name='input')
net = tflearn.fully_connected(net, 64, activation='sigmoid')
tflearn.batch_normalization(net)
net = tflearn.fully_connected(net, 32, activation='sigmoid')
tflearn.batch_normalization(net)
net = tflearn.fully_connected(net, 16, activation='sigmoid')
tflearn.batch_normalization(net)
net = tflearn.fully_connected(net, 8, activation='sigmoid')
tflearn.batch_normalization(net)
# activation needs to be softmax for classification.
# default loss is cross-entropy and the default metric is accuracy
# cross-entropy + accuracy = categorical network
net = tflearn.fully_connected(net, 2, activation='softmax')
sgd = tflearn.optimizers.SGD(learning_rate=0.01, lr_decay=0.96, decay_step=100)
net = tflearn.regression(net, optimizer=sgd, loss='categorical_crossentropy')
model = tflearn.DNN(net, tensorboard_verbose=0)
我試過很多東西,但所有的時間總損耗爲解決此值:
Training Step: 95 | total loss: 0.68445 | time: 1.436s
| SGD | epoch: 001 | loss: 0.68445 - acc: 0.5670 | val_loss: 0.68363 - val_acc: 0.5714 -- iter: 9415/9415
我該怎麼做才能減少總損失並使精度更高?
您已經嘗試了什麼? –