add "initializeWeights" and "finalizeWeights" to GradientOptimizer

Since many optimizers like averaging, RDA, l2 sgd do some special sleight of hand to swap the weights out for something more efficient, we should make this part of the regular API so we can handle it uniformly.