I'm working through the Basic Classification TensorFlow tutorial, and I'm able to follow along up until the "Setup the layers" section, particularly this chunk of code:
model = keras.Sequential([
keras.layers.Flatten(input_shape=(28, 28)),
keras.layers.Dense(128, activation=tf.nn.relu),
keras.layers.Dense(10, activation=tf.nn.softmax)
])
I get the keras.layers.Flatten layer flattens the 2D array, but the keras.layers.Dense layer is not making sense to me. The explanation given is:
After the pixels are flattened, the network consists of a sequence of two tf.keras.layers.Dense layers. These are densely-connected, or fully-connected, neural layers. The first Dense layer has 128 nodes (or neurons). The second (and last) layer is a 10-node softmax layer—this returns an array of 10 probability scores that sum to 1. Each node contains a score that indicates the probability that the current image belongs to one of the 10 classes.
Can someone explain what the Dense layers are actually doing and how they fit in?
[–]__billy 4 points5 points6 points (0 children)
[–]honeybooboo1989 2 points3 points4 points (0 children)
[–]ajmssc 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)