Two ways of optimize the same function?
The argmax is to get the class label prediction y_pred given a sample x. 

# symbolic description of how to compute prediction as class whose 
 # probability is maximal
 self.y_pred = T.argmax(self.p_y_given_x, axis=1)

The Loss function is used as optimization objective function to solve the coefficients W and b based on training data. On the tutorial, the loss function is the reverse the likelihood.