How do you calculate the training error and validation error of a linear regression model? I have a linear regression model that I've implemented using Gradient Descent and my cost function is a Sum of Squares Error function. I've split my full dataset into three datasets, a training set, a validation set, and a testing set. I am not sure how to calculate the training error and validation error (and the difference between the two).

Is the training error the Residual Sum of Squares error calculated using the training dataset?
Is the validation error the Residual Sum of Squares error calculated using the validation dataset?
What is the test set for exactly (I've learned the model using the training set, from the textbooks I've read I think this is the set to use to learn the model)?

Any help in clearing up these points is much appreciated.
Yes. Yes. The test set is used to get an unbiased measure of the performance of your model. This is explained in many sources, better than I can explain here; I won't try to repeat them. See, e.g., https://en.wikipedia.org/wiki/Training,_validation,_and_test_sets, https://stats.stackexchange.com/a/104750/2921, or standard textbooks.