2021年4月7日星期三

prediction Multidimensional to Keras

I am new to keras and I am having a problem running a model with more than one dimension. So, I have been trying a few samples. This is one of them.

from keras.models import Sequential  from keras.layers.core import Dense, Activation  x = [[[1,2,3],[2,3,4]],       [[5,5,5],[1,1,1]],       [[4,4,4],[1,8,1]]]    y=[[9,6,15],     [3,15,18],     [10,12,22]]      model = Sequential()     model.add(Dense(input_shape=(2,3),units =12))  model.add(Activation('relu'))  model.add(Dense(units = 1))    model.compile(loss='mean_squared_error', optimizer='adam',metrics=['accuracy'])  model.fit(x, y, batch_size = 32,epochs = 500)  

But the predicted result is not in line with expectations

https://stackoverflow.com/questions/66996989/prediction-multidimensional-to-keras April 08, 2021 at 11:34AM

没有评论:

发表评论