Wpis z mikrobloga

TensorFlow.js

Czy kto tu wie jak włączyć do modelu warstwę LSTM??

input: 31
hidden: 93
output: 3

Error: Input 0 is incompatible with layer lstmLSTM1: expected ndim=3, found ndim=2


const model = tf.sequential();

const hidden = tf.layers.dense({
units: this.hiddennodes, // 93
inputShape: [this.inputnodes], // [31]
activation: 'sigmoid'
});

const lstmHidden = tf.layers.lstm({
units: 93,
inputShape: 93,
recurrentInitializer: 'glorotNormal',
});

const hidden2 = tf.layers.dense({
units: this.hidden
nodes, // 93
activation: 'sigmoid'
});

const dropout = tf.layers.dropout(0.1);
const output = tf.layers.dense({
units: this.output_nodes, // 3
activation: 'softmax'
});

model.add(hidden);

model.add(lstmHidden);

model.add(hidden2);

model.add(dropout);

model.add(output);

return model;

#tensorflow