improve the  performance of softmax

The original implementation is using column vector times row vector, which is inefficient.
@karlnapf 
take a loot at this.