I'm a bit confused about the activation function in the output layer of a neural network trained for regression. In most tutorials, the output layer uses "sigmoid" to bring the results back to a nice number between 0 and 1.
But in this beginner example on the TensorFlow website, the output layer has no activation function at all? Is this allowed? Wouldn't the result be a crazy number that's all over the place? Or maybe TensorFlow has a hidden default activation?
This code is from the example where you predict miles per gallon based on horsepower of a car.
// input layer
model.add(tf.layers.dense({inputShape: [1], units: 1}));
// hidden layer
model.add(tf.layers.dense({units: 50, activation: 'sigmoid'}));
// output layer - no activation needed ???
model.add(tf.layers.dense({units: 1}));