 Learning is supervised.The network is trained by minimizing the euclidean distance between the image and the output of a CNN that reconstructs the input from the output of the terminal capsules.The network is discriminatively trained, using iterative routing-by-agreement.