# Why do DQNs use linear activations on cartpole?

I've been reading a lot of tutorials on DQNs for cartpole. In many of them, they have the funnel layer of the neural net be a linear activation. Why is this? Is it just a choice made by the implementer? Is this Choice specific to cartpole, or do most control task dqns use it? Thanks.

Q learning predicts the action value, $$q(s, a)$$ for taking action $$a$$ in state $$s$$. The action value is usually the discounted sum of all future rewards. In general it can take any scalar value.
DQN uses a neural network to approximate $$q(s, a)$$. Although you might use this to select an action (thus think of the problem as a classification), the NN has to perform regression to predict the action values.