DeepLLM Quiz
Deep Learning

Mixture density networks: predicting several possible answers

10 questions on inverse problems, why averaging fails, networks that output mixture parameters, softmax and exponential outputs and heteroscedastic noise.

  • 10 questions
  • Stopwatch
  • Instant feedback

Shown publicly with your score. Don’t use your full real name.

Sample questions

Play now ↑

Answers stay hidden. Start the quiz to play them.

  1. Sample 1

    A ball is thrown at a fixed speed and must land on a given spot. Compared with the forward problem of finding where a throw lands, what is true of the inverse problem of finding the launch angle?

    • It always has exactly one solution
    • It can have two solutions, a flat, low throw and a steep, high lob
    • It has no solutions
  2. Sample 2

    From one pick-up point, taxi trips go either to the airport or to the city centre, in opposite directions. A model trained with squared error predicts the destination. What does it tend to predict?

    • A point roughly halfway between the two, where hardly anyone goes
    • Both destinations at the same time
    • Always the airport

How it works

  • One question per screen. An answer is final once sent.
  • You see right away whether you were right, with a short explanation.
  • The stopwatch runs: on equal scores, the faster player ranks first.
  • Only your best attempt counts, so replaying is never risky.

About this quiz

Some questions have more than one correct answer. To hit a target with a thrown ball, you can use a low, fast throw or a high, lobbed one. From a set of symptoms, several different diseases may be possible. From a photograph of a room's furniture, there may be many plausible floor plans. A standard network trained to predict one number per input does something strange in such cases: it learns to output the average of the valid answers, which may be an answer that is not valid at all. The remedy is to let the network predict a whole distribution with several peaks, one at each plausible answer, and that is what a mixture density network does.

This quiz introduces the problem and the solution. It begins with the distinction between forward problems, which follow cause to effect and usually have a unique answer, and inverse problems, which run from effect back to cause and can have several. You will see why a network trained with the ordinary squared error fits the first kind well and the second kind badly, and what exactly it ends up predicting. A key phrase in that discussion is the shape of the conditional distribution of the target given the input, which must have more than one peak for the usual approach to fail.

Then the quiz opens up the mixture density network itself. Its outputs are not the answers but the parameters of a mixture: weights, centres and spreads for each component, all changing with the input. You will see how the output units are designed so that the weights are positive and add up to one, and the spreads are positive, how many outputs the network needs in a small example, and how the model is trained. You will also see what the predicted distribution can tell you that a single number cannot, and how to pick a single answer from it when one is needed.

Frequent errors include assuming that the average of valid answers is itself a good answer, that a network's output must be the prediction itself, and that the noise level has to be the same for every input. The quiz explains each point with a concrete example. More recent generative models handle ambiguous targets in other ways, but the lesson stays the same: if a question has several valid answers, a model that outputs a single number will mislead, and one that outputs a distribution will not.

It suits students and practitioners who work with ambiguous targets. It needs no calculus. There are 10 questions, each with an explanation shown after you answer, and the quiz takes about four minutes.

Questions and answers

›How long does the quiz take?

About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation appears after every answer.

›Do I need to know about mixture models?

It helps, and the quiz on Gaussian mixtures covers the basics. The idea is simply that a distribution with several peaks can be built by adding several bell-shaped components, each with its own weight. The questions here explain the rest as they go.

›What are forward and inverse problems?

A forward problem goes from cause to effect, for example from the launch angle of a thrown ball to the spot where it lands, and usually has a single answer. An inverse problem goes the other way, from the desired effect to the causes that could produce it, and often has several. Much of machine learning is inverse in this sense.

›Why does ordinary regression fail on inverse problems?

Training with squared error amounts to assuming that the target is Gaussian around a single value for each input, and the best prediction under that assumption is the average of the targets. When the valid answers form separate groups, the average lies between them, where there may be no valid answer at all. A good test for whether you need such a model is to plot the targets against an input and see whether, for some inputs, the points form several separate groups. If they do, predicting the average will not work.

›What does a mixture density network output?

For each input it outputs the weights, centres and spreads of a mixture of distributions, usually Gaussians. The network does not output the answer directly. It outputs a description of how likely every possible answer is, which can have one peak for some inputs and several for others.

›How are the outputs kept valid?

The weights of the mixture are passed through a softmax so that they are positive and add up to one. The spreads are obtained by taking the exponential of the corresponding network outputs, which guarantees they are positive. The centres are unconstrained real numbers, so they can be taken straight from the network.

›What does heteroscedastic mean?

It means that the amount of noise depends on the input. In a mixture density network, the spread of each component is a function of the input, so the model can be confident for some inputs and uncertain for others. The simple regression model assumes a single noise level everywhere.

›How do you get a single answer from a mixture density network?

You can use the average of the predicted distribution, which reproduces the usual regression answer but is poor when there are several peaks. A better choice is the most probable value, the mode. A practical approximation is the centre of the component with the largest weight.

More quizzes