7.1. Neural Network Graph

fhez.nn.nn.NN

alias of fhez.nn.nn.NeuralNetwork

class fhez.nn.nn.NeuralNetwork(graph=None)

Multi-Directed Neural Network Graph Handler.

This class handles traversing computational graphs toward some end-state, while computing forward(s), backward(s), and update(s) of the respective components described within.

backward(gradient, current_node, end_node)

Traverse backwards until all nodes processed.

backwards(gradients, current_node, end_node)

Calculate backward pass for multiple examples simultaneously.

forward(x, current_node, end_node)

Traverse and activate nodes until all nodes processed.

forwards(xs, current_node, end_node)

Calculate forward pass for multiple examples simultaneously.

property g

Get computational graph.

probe_shape(lst: list)

Get the shape of a list, assuming each sublist is the same length.

This function is recursive, sending the sublists down and terminating once a type error is thrown by the final point being a non-list

update(current_node, end_node)

Update weights of all nodes using oldest single example gradient.

updates(current_node, end_node)

Update the weights of all nodes by taking the average gradient.