Each input for a perceptron has a weight associated with it. The input is multiplied by its weight, resulting in the weighted input [2]. The weighted inputs are then summed, and this value determines the output of the perceptron [2]. The weight on each input is the source of a neural network's versatility. By tweaking the weights just right, a neural network can approximate any given function [3]. Then, the issue becomes picking the right weights. Considering how difficult it is to not only pick the right weight, but also to know whether or not it is the right weight this isn't the most feasible solution. If only there were a way for a neural network to learn what the weights should be.

### Neural Network Learning

Neural network learning is simple- in theory. We feed the network an input, and tell it what the expected output should be. With a complex calculus method called "gradient descent," the network can figure out how to adjust its weights by an infinitesimal value to minimize error [2]. For every input, the neural network compares its output with the expected output. The neural network then uses gradient descent to fine tune and shift the weights to minimize error. Once the network receives the correct output, the weights remain unchanged. When training a neural network, scientists typically use two-thirds of the inputs as a "training set." The remaining third of the inputs is the "test set," which essentially tests the neural network by providing it with an incorrect answer. To review, the training set is the network's study guide, which is used to prepare for the final exam: the test set. These two sets are separated to prevent the network from “cheating,” similar to the way a professor will not provide students with answers to an exam before it is administered. Consequently, the neural network learns how to solve complex problems and can adapt to work with unknown inputs.

This algorithmic approach to learning leads to a troubling conclusion: the precise methods that allow these networks to function remains unclear. While we know how to create them, the internal mechanisms are virtually impossible to understand. For example, in the 1980s, the Pentagon attempted to build a neural network that would determine whether or not a photograph contained a tank [4]. After the neural network was trained with 200 example photographs, it reached perfect accuracy [4]. However, when given new inputs outside of the example set, the outputs were completely random [4]. Despite the fact that it learned from such a large training set, on its own the neural network was no better than flipping a coin. It was only after many years that someone realized the problem: all of the example photos with tanks were taken on cloudy days, and all the photos without were taken on sunny days [4]. With some of the brightest minds in computer science, the Pentagon had created "a multi-million dollar mainframe computer that could tell you whether [a photo] was sunny or not" [4].

In addition to the neural network error caused by unforeseen similarities in training sets, other errors can be caused by overfitting [2]. If a network has too many perceptrons, it could simply memorize all the examples, avoiding learning altogether. Luckily, networks can be retrained with different sets, only saving the results if it increases performance - much like when you save your progress in a videogame and reload every time you fail until you finally beat the level. Making sure a neural network not only learns, but also learns the right thing, is incredibly difficult. Luckily, computer scientists have been working since the 1940s to optimize these complex structures. All this work has come to fruition in today's age, when computers are finally able to recognize images - which brings us back to DeepDream.

### Google's DeepDream

DeepDream is Google's codename for their neural network trained to recognize specific types of images - think of an improved and functioning version of the Pentagon's fancy neural network. The neural network is trained to recognize a specific type of image - whether it's as general as "places," or as specific as "tanks" [1]. So, these neural networks are trained to "see" (as best as a computer can) a specific class. Fig. 3 gives different examples of what DeepDream exactly sees. It's not exactly what we, as humans, see, but the resemblance is evident.

A. Mordvintsev/Research Blog