Added expand gradient function for maxout indexes.