# TurnTrout comments on Price’s equation for neural networks

• I really like this post. Can you expand your intuitions on

For instance, if is the expectation of a binary variable with a probability for being 1, then I bet there is probably going to be a Bernoulli distribution aspect to it, such that is approximately proportional to , but likely with a scale factor that depends on the network architecture or parameters, rather than being entirely equal to it.

• Sure!

So let’s start with a basic example, an agent that has two actions, “don’t” and “do”. Suppose it has an output neuron that contains the logits for what action to take, and for simplicity’s sake (will address this in the end of the post) let’s assume that this output neuron is controlled by a single weight which represents its bias. So this means that the variable described in the OP expands into: .

We can then compute . And, hmm, this actually implies that , rather than the that my intuition suggested, I think? The difference is basically that is flatter than , especially in the tails where the former quadratically goes to 0 while the latter linearly goes to 0.

One thing I would wonder is what happens during training, if we e.g. use policy gradients and give a reward of 1 for do and a reward of −1 for don’t. The update rule for policy gradients is basically , which according to Wolfram Alpha expands into , and which we can further simplify to . But we would have to square it to get , so I guess the same point applies here as to before. 🤷

Anyway, obviously this is massively simplified because we are assuming a trivial neural network. In a nontrivial one, I think the principle would be the same, due to the chain rule which gives you a factor of onto whatever gradients exist before the final output neuron.