The Loss function in your example code does not exist anymore:
You should change this line:
// Finally compile the model, we also exactly use tfjs's optimizers and loss functions
// (So feel free to choose one among tfjs's)
model.compile({loss: 'crossEntropy', optimizer: 'sgd'})
to something like
model.compile({loss: 'meanSquaredError', optimizer: 'sgd'})
The Loss function in your example code does not exist anymore:
You should change this line:
to something like
model.compile({loss: 'meanSquaredError', optimizer: 'sgd'})