{
const net = tf.sequential();
net.add(tf.layers.dense({
units: 2,
inputShape: [3],
activation: 'sigmoid'
}));
net.compile({
loss: 'meanSquaredError',
optimizer: 'sgd'
});
const xs = tf.tensor2d([
[0.03, 0.7, 0.5],
[0.16, 0.09, 0.2],
[0.5, 0.5, 1.0]
]);
const ys = tf.tensor2d([
[1, 0],
[0, 1],
[0, 1]
]);
await net.fit(xs, ys);
const xPredict = tf.tensor2d([
[1.0, 0.4, 0.0]
]);
const prediction = net.predict(xPredict);
prediction.print();
}