November 2019
Intermediate to advanced
296 pages
7h 52m
English
The space of the input vector is a two-dimensional space, the weight parameter is defined as the two-element variable, the variable is initialized with the random values from the Gaussian distribution, and the range is [-0.5, 0.5]. By marking these as variables, the optimizer can recognize them as trainable parameters. Since the input vector has three elements, including the bias term, the weight parameter should have three elements as well:
// Initialize the weight parametersconst w = tf.randomNormal([3, 1]).sub(-0.5).variable();// f(x) = sigmoid(w*x)const f_x = x => { return tf.sigmoid(x.matMul(w));}
The model's output is the sigmoid function of the multiplication between the input vector and ...
Read now
Unlock full access