Start by building a very simple network: import numpy as np class NeuralNetwork: def __init__(self, x,y): self.input = x self.y = y self.Weights1 = np.random.randn(self.input.shape[1],5) self.Weights2 = np.random.randn(5,1) self.output = np.zeros(self.y.shape) def sigmoid_z(self,x): #create a sigmoid function z = 1/(1 + np.exp(-x)) return z def sigmoid_z_derivative(self,x): return self.sigmoid_z(x)*(1-self.sigmoid_z(x)) def forwardpropogation(self):Continue Reading

Tensorflow

After training we can optimize a frozen graph or even a dynamic graph by removes training-specific and debug-specific nodes, fusing common operations, and removes code that isn’t used/reached. Code Example from tensorflow.python.tools import optimize_for_inference_lib inputGraph = tf.GraphDef() #read in a frozen model with tf.gfile.Open(‘frozentensorflowModel.pb’, “rb”) as f: data2read = f.read() inputGraph.ParseFromString(data2read) outputGraph = optimize_for_inference_lib.optimize_for_inference(inputGraph, [“inputTensor”],        Continue Reading