model = {
const model = tf.sequential({layers: [
tf.layers.dense({units: 1, inputShape: [1]})
]})
model.compile({optimizer: 'adam', loss: 'meanSquaredError'})
await model.fit(xTrain, yTrain, {epochs: 1000, callbacks: {onEpochEnd: (epoch, {loss}) => {
mutable history = {epoch, loss}
}}})
return model;
}