967e77866ca63db25f5b688db4be5d55480a1102,mlxtend/classifier/softmax_regression.py,SoftmaxRegression,_softmax,#SoftmaxRegression#Any#,81

Before Change


        return (X.dot(W) + b)

    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 (X.dot(W) + b)

    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):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


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


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: IBM/adversarial-robustness-toolbox
Commit Name: 9e49dce4a0b35b7daba7fa5d4ed529e36979a19a
Time: 2018-04-16
Author: Maria-Irina.Nicolae@ibm.com
File Name: src/classifiers/keras.py
Class Name: KerasClassifier
Method Name: predict