before we beginthe mathematical building blocks of neural networks the gears of neural networkstensor operations much as any computer program can be ultimately reduced to small set of binary operations on binary inputs (andornorand so on)all transformations learned by deep neural networks can be reduced to handful of tensor operations applied to tensors of numeric data for instanceit' possible to add tensorsmultiply tensorsand so on in our initial examplewe were building our network by stacking dense layers on top of each other keras layer instance looks like thiskeras layers dense( activation='relu'this layer can be interpreted as functionwhich takes as input tensor and returns another tensor-- new representation for the input tensor specificallythe function is as follows (where is tensor and is vectorboth attributes of the layer)output relu(dot(winputblet' unpack this we have three tensor operations herea dot product (dotbetween the input tensor and tensor named wan addition (+between the resulting tensor and vector bandfinallya relu operation relu(xis max( note although this section deals entirely with linear algebra expressionsyou won' find any mathematical notation here 've found that mathematical concepts can be more readily mastered by programmers with no mathematical background if they're expressed as short python snippets instead of mathematical equations so we'll use numpy code throughout element-wise operations the relu operation and addition are element-wise operationsoperations that are applied independently to each entry in the tensors being considered this means these operations are highly amenable to massively parallel implementations (vectorized implementationsa term that comes from the vector processor supercomputer architecture from the - periodif you want to write naive python implementation of an element-wise operationyou use for loopas in this naive implementation of an element-wise relu operationdef naive_relu( )assert len( shape= is numpy tensor copy(avoid overwriting the input tensor for in range( shape[ ])for in range( shape[ ]) [ijmax( [ij] return licensed to