Im really new to tensorflow.js and im trying to do simple model that tell you on what side of the canvas you cliked
const model = tf.sequential();
model.add(
tf.layers.dense({
units: 200,
activation: "sigmoid",
inputShape: [0, 1],
})
);
model.add(
tf.layers.dense({
units: 2,
activation: "softmax",
})
);
model.compile({
optimizer: optimizer,
loss: "categoricalCrossentropy",
metrics: ["accuracy"],
});
my training and testing data
const yTrain = tf.tensor2d(
[10, 130, 60, 20, 150, 110, 3, 160, 99],
[1, 9]
);
const xTrain = tf.tensor2d([0, 1, 0, 0, 1, 1, 0, 1, 0], [1, 9]);
const yTest = tf.tensor2d(
[5, 106, 33, 88, 104, 140, 7, 60, 154],
[1, 9]
);
const xTest = tf.tensor2d([0, 1, 0, 0, 1, 1, 0, 0, 1], [1, 9]);