[英]Training Multiclass input output in keras
I am trying to train 16-bit binary input and 16-bit binary output for ANN using Keras.我正在尝试使用 Keras 为 ANN 训练 16 位二进制输入和 16 位二进制 output。 the problem is traing accuracy merely reaches 15%.问题是训练准确率仅达到 15%。 What could be the best way to train datatypes like什么可能是训练数据类型的最佳方法,例如
Xtrain Ytrain
1,0,1,0,1,1,1,0,0,0,0,0=1,0,1,0,1,0,1,1,1,1
1,1,1,0,0,0,0,1,1,1,1,1=0,0,0,0,1,1,1,1,1,1
Xtest
1,1,1,1,0,1,0,1,0,1,0,1
X = dataset[:,0:16]
Y = dataset[:,16:32]
x_train,x_test,y_train,y_test = train_test_split(X,Y,test_size = 0.15, random_state = 0)
clf_ann_ad = Sequential()
clf_ann_ad.add(Dense(32, activation = 'relu', input_dim = 16))
clf_ann_ad.add(Dense(16,activation='relu'))
clf_ann_ad.add(Dense(16,activation='sigmoid'))
clf_ann_ad.compile(optimizer = 'adam', loss = 'mean_squared_error', metrics = ['accuracy'])
history = clf_ann_ad.fit(x_train,y_train,batch_size = 100, nb_epoch = 200, validation_split = 0.1)
print(history.history.keys())
First One:第一:
I'm thinking that your problem is a Sequence to a Sequence problem so i Think you need Recurrent Neural Network with uni Directional RNN to get the pattern how we encoding number and convert it:我认为您的问题是序列到序列的问题,所以我认为您需要具有单向 RNN 的递归神经网络来获取我们如何编码数字并对其进行转换的模式:
Binaray Classification Using Recurrent 使用循环的二进制分类
Second point: you use mean_square_error error function in classification problem that's not right that function used for telling you how close a regression line is to a set of points.第二点:您在分类问题中使用 mean_square_error 错误 function 是不对的,function 用于告诉您回归线与一组点的接近程度。 so i you would use binary cross entropy which loss function used on problems involving yes/no (binary) decisions.所以我会使用二进制交叉熵,它会损失 function 用于涉及是/否(二进制)决策的问题。
I apologize for the lack of an explicit and clear answer about your problem, I can not identify because you did not give us enough information对于您的问题没有明确而明确的答案,我深表歉意,我无法确定,因为您没有给我们足够的信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.