我使用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
我可以做些什么来减少总损失并提高准确度?
答案 0 :(得分:1)
可以考虑许多方面来改善网络性能,包括数据集和网络。 仅仅通过您粘贴的网络结构,如果没有关于数据集和您想要获得的目标的更多信息,很难提供一种明确的方法来提高其准确性。但以下是一些有用的实践可能有助于您调试/改进网络:
<强> 1。关于数据集
<强> 2。关于网络
为了更深入地分析,以下文章可能对您有所帮助: