967e77866ca63db25f5b688db4be5d55480a1102,mlxtend/classifier/softmax_regression.py,SoftmaxRegression,_softmax,#SoftmaxRegression#,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: 3

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: havakv/pycox
Commit Name: 2adbc42ae538a30bb310c575867bb9622bf9c4b3
Time: 2019-02-21
Author: haavard.kvamme@gmail..com
File Name: pycox/models/cox.py
Class Name:
Method Name: loss_cox_ph