liveBook · Manning

Data representation

As explained in Deep Learning with R, Third Edition

A data representation is a particular encoding or view of data that can make a task easier to solve.

A data representation is a particular way to encode or view data. The same information can become easier or harder to use depending on the representation chosen for the task. section 1.4

One image, two useful representations

A color image can use RGB or HSV values. Selecting red pixels is simpler in RGB, while reducing saturation is simpler in HSV. The data stays the same; its encoding changes to suit the task. section 1.4

Machine learning learns representations that transform inputs into outputs useful for a goal. In deep networks, early visual representations retain much of the image and detect edges; deeper representations become more abstract, encoding concepts such as cat ears and cat eyes while discarding irrelevant visual detail. section 1.4 section 10.1

Representations can be examined at several levels:

  • Input representation: raw values such as image pixels or point coordinates. section 1.4
  • Intermediate representation: layer activations that expose features detected by a neural network. section 10.1
  • Higher representation: increasingly abstract features carrying more information about the target and less about the exact input. section 10.1
Listing 10.6 Visualizing every channel in every intermediate activation
for (layer_name in names(activations)) {  #1
  layer_activation <- activations[[layer_name]] 

  .[.., n_features] <- dim(layer_activation)  #2

  par(mfrow = n2mfrow(n_features, asp = 1.75),  #3
      mar = rep(.1, 4), oma = c(0, 0, 1.5, 0))  #3

  for (j in 1:n_features)  #4
    plot_activations(layer_activation[, , , j])  #4
  title(main = layer_name, outer = TRUE)  #5
}

Visualize every channel in each intermediate activation to compare how a convolutional network changes its representation across layers. section 10.1

How Deep Learning with R, Third Edition covers it

How deep it goes
Defines representations with RGB, HSV, coordinates, and convolutional activations, then traces abstraction across network depth.
Examples
Uses RGB versus HSV images, classified coordinate points, cat-image activations, edge detectors, and higher-level visual features.
What it assumes
Assumes basic input-output and classification ideas while introducing representations from first principles through images and coordinates.
What you can do after
Evaluate/understand how alternative encodings and network layers preserve, discard, or emphasize information for a target.
How it connects
Connects data representation to machine learning, deep learning, feature extraction, convolutional neural networks, and image classification.

Also explained in

Compare how 4 books explain data representation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.