Preprocessing

What we are going to do next is to "whiten" our data using a Zero Phase Component Analysis (ZCA). The definitions of ZCA is beyond the scope of this chapter, but briefly, ZCA is very much like Principal Component Analysis (PCA). In our 784-pixel slice, there is a high probability that the pixels are correlated with one another. What PCA does is it finds the set of pixels that are uncorrelated with one another. It does this by looking at all the images at once and figuring out how each column correlates with one another:

func zca(data tensor.Tensor) (retVal tensor.Tensor, err error) {  var dataᵀ, data2, sigma tensor.Tensor  data2 = data.Clone().(tensor.Tensor)  if err := minusMean(data2); err != nil {    return nil, err  } if dataᵀ, ...

Get Go Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.