Each connection from one unit to another unit will have its own assigned weights which you can think a number b/w zero and one.Unit here is represent a single circle.Weights represents the strength of the connection b/w the units.So, when you first receive an input in the input layer that input is being passed to the next unit via a connection and the input will be multiplied by the weight assigned to this particular connection, a weighted sum is then computed with each of the connection that are pointing to this neuron the sum is then passed to the activation function which transforms the result to a number b/w zero and one.
Now once we get the result from the activation function then it is passed as the input to next layer units.In these the weights of the connection may change continuously and effort is made to reach optimized weights for each connection as the models continues to learn from the data.
If we want to categorize between lion and tiger then our output layer have 2 units one will be representing lion and another will be representing tiger .
Only the first hidden layer in sequential model requires an input shape because our model needs to understand the shape of the data that its initially going to deal with.
Types of Keras Models
Keras has divided models in basic two types
2)Function API's Model
Core data structures of Keras is a model, a way to organize layers.One of the simplest type of model we use in Keras is Sequential Model i.e a linear stack of layers.
For Complex architecture we have to use Keras Functional API's which allows us to build arbitrary graph of layers.
By using Keras Functional API's we define models which are having multiple output or models with shared layers.