967e77866ca63db25f5b688db4be5d55480a1102,mlxtend/classifier/multilayerperceptron.py,MultiLayerPerceptron,_softmax,#MultiLayerPerceptron#,237
Before Change
return y_pred
def _softmax(self, z):
return (np.exp(z.T) / np.sum(np.exp(z), axis=1)).T
def _cross_entropy(self, output, y_target):
return - np.sum(np.log(output) * (y_target), axis=1)
After Change
return y_pred
def _softmax(self, z):
e_x = np.exp(z - z.max(axis=1, keepdims=True))
out = e_x / e_x.sum(axis=1, keepdims=True)
return out
// return (np.exp(z.T) / np.sum(np.exp(z), axis=1)).T
def _cross_entropy(self, output, y_target):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: rasbt/mlxtend
Commit Name: 967e77866ca63db25f5b688db4be5d55480a1102
Time: 2016-07-13
Author: mail@sebastianraschka.com
File Name: mlxtend/classifier/multilayerperceptron.py
Class Name: MultiLayerPerceptron
Method Name: _softmax
Project Name: suavecode/SUAVE
Commit Name: 7f9976d67c9b413b3a7211bad921b29eac7be179
Time: 2016-02-01
Author: jmvegh@stanford.edu
File Name: trunk/SUAVE/Methods/Power/Battery/Sizing/initialize_from_energy_and_power.py
Class Name:
Method Name: initialize_from_energy_and_power
Project Name: rasbt/mlxtend
Commit Name: 967e77866ca63db25f5b688db4be5d55480a1102
Time: 2016-07-13
Author: mail@sebastianraschka.com
File Name: mlxtend/classifier/softmax_regression.py
Class Name: SoftmaxRegression
Method Name: _softmax