anatomy of neural network you can think of layers as the lego bricks of deep learninga metaphor that is made explicit by frameworks like keras building deep-learning models in keras is done by clipping together compatible layers to form useful data-transformation pipelines the notion of layer compatibility here refers specifically to the fact that every layer will only accept input tensors of certain shape and will return output tensors of certain shape consider the following examplefrom keras import layers layer layers dense( input_shape=( ,) dense layer with output units we're creating layer that will only accept as input tensors where the first dimension is (axis the batch dimensionis unspecifiedand thus any value would be acceptedthis layer will return tensor where the first dimension has been transformed to be thus this layer can only be connected to downstream layer that expects dimensional vectors as its input when using kerasyou don' have to worry about compatibilitybecause the layers you add to your models are dynamically built to match the shape of the incoming layer for instancesuppose you write the followingfrom keras import models from keras import layers model models sequential(model add(layers dense( input_shape=( ,))model add(layers dense( )the second layer didn' receive an input shape argument--insteadit automatically inferred its input shape as being the output shape of the layer that came before modelsnetworks of layers deep-learning model is directedacyclic graph of layers the most common instance is linear stack of layersmapping single input to single output but as you move forwardyou'll be exposed to much broader variety of network topologies some common ones include the followingtwo-branch networks multihead networks inception blocks the topology of network defines hypothesis space you may remember that in we defined machine learning as "searching for useful representations of some input datawithin predefined space of possibilitiesusing guidance from feedback signal by choosing network topologyyou constrain your space of possibilities (hypothesis spaceto specific series of tensor operationsmapping input data to output data what you'll then be searching for is good set of values for the weight tensors involved in these tensor operations licensed to