Can I only optimize certain parameter for every sample

I am trying to implement word2vec hierarchical softmax. By sgd, for every sample, model is supposed to only optimize those parameter of the path to the its label in huffman tree.
So I guess to implement hierarchical softmax, I have to freeze other parameters.