Tensorflow JS About Basic tensorflowjs example script src https cdn jsdelivr net npm tensorflow tfjs 0 11 2 script script const model tf sequential model add tf layers dense units 2 inputShape 2 model add tf layers dense units 1 activation selu model compile optimizer tf train sgd 0 1 loss meanSquaredError const inputs tf tensor2d 0 0 0 1 1 0 1 1 const outputs tf tensor2d 0 1 1 0 const train async for let i 0 i 10 i const response await model fit inputs outputs shuffle true epochs 10 console log response history loss 0 const predict async await train console log training complete const prediction model predict inputs prediction print predict console log ready script
tensor2d 0 1 1 0 const train async for let i 0 i 10 i const response await model fit inputs outputs shuffle true epochs 10 console log response history loss 0 const predict async await train console log training complete const prediction model predict inputs prediction print predict console log ready script