September 2017
Beginner to intermediate
304 pages
7h 2m
English
To make predictions with the trained neural network, we will create a predict() method for the neuralNet type. This predict method will take in new inputs and complete and feed the new inputs forward through the network to produce predicted outputs, as shown here:
// predict makes a prediction based on a trained// neural network.func (nn *neuralNet) predict(x *mat.Dense) (*mat.Dense, error) { // Check to make sure that our neuralNet value // represents a trained model. if nn.wHidden == nil || nn.wOut == nil || nn.bHidden == nil || nn.bOut == nil { return nil, errors.New("the supplied neural net weights and biases are empty") } // Define the output of the neural network. output := mat.NewDense(0, 0, nil)github.com/tensorflow/tensorflow/tensorflow/go ...Read now
Unlock full access