Neural Networks
feedforward, fully-connected neural networks
composition of a neural network
input node (s) : put the data into the neural network
hidden node:
linearizes the data with (weight • x + bias) = z
warps that linearized data with a nonlinear factor known as sigma with (z • sigma)
returns an activation output a that is then passed to the next hidden node as its input
hidden node weights are written atop the lines connecting one node to another
the last node is the output node whose activation is churned out as the y-hat prediction
because each input is the output of the last node, we could theoretically plug them all in by hand
general flow of the neural network
forward propagation – feeding activations into the next node »»»»
loss function – the error that is generated with the output of the forward propagation
back propagation – the minimization of the loss function via altering the nodal weights/biases
where do networks get deep and wide?
depth is layered growth and width is growth along the same layer
depth = parent + many child nodes and width = many sibling nodes
a fully-connected neural network is a network in which every node is connected to all of the nodes in the layers above and below
(but not between sibling nodes because info flows layer-by-layer)
express all of these weights associated with the connections in matrices and linear algebra in order to visualize it efficiently
training assigns useful or non-useful weights to each of the connections in a fully-connected neural network
the process of using a neural network
input node(s) can take on many different dimensions of data to run through the hidden nodes. the general form of your input shape is the number of dimensions/traits you have in your X-matrix
forward propagation training: first start with randomized weights and run the data through the neural network
back propagation training: for a single layer, take the derivative of the loss function with respect to each of the nodal weights (gradient descent!) in order to minimize loss and find its sensitivity to the given random weights. So with 12 nodal weights, the gradient descent would be calculated across a 12-element vector
back propagation training: all leftover error from a single layer back propagates to the layer preceding it and then new estimates are generated forward, so that error back propagates and estimates forward propagate
the determination of the output node's dimensions is super critical to the proper interpretation of the NN
the output shape of an NN is often composed of a probability distribution of all possible labels (i.e., the % likelihood that the datapoint belongs to each label)
often a little output layer is created to generate (6)
the loss function is a measure of error – but actually there are many different loss functions that can be utilized
the optimizer is that which is utilized to minimize the given loss function (i.e., gradient descent)
for large networks and neural networks
normal gradient descent is too computationally heavy to run on all of these nodes and datapoints
so, the dataset is split into groups called batches of data for ease of updating weights iteratively, and an epoch is one round of training with the entire dataset
and stochastic (random) gradient descent is utilized to train the neural network instead
you can also add different algorithms to your SGD to further improve its efficacy (there are many)








