November 2019
Intermediate to advanced
296 pages
7h 52m
English
We have already seen how we can generate the dataset from a normal distribution. To reduce the dimensionality of the original dataset, we will need to use the shape (Batch, 3):
const N = 30;const D = 3;// tf.randomNormal generates the tensor with the given shape from the normal distribution.const c1 = tf.randomNormal([N, D]).add([1.0, 0.0, 0.0]);const c2 = tf.randomNormal([N, D]).add([-1.0, 0.0, 0.0]);const c3 = tf.randomNormal([N, D]).add([0.0, 1.0, 1.0]);const xs = c1.concat(c2).concat(c3);
Each cluster contains 30 points. Concatenation packs them into the original dataset with a shape of (90, 3). To visualize the points in two-dimensional coordinates, we need to project each piece of data onto the plane space. ...
Read now
Unlock full access