3aa807a0c89279b065818a3db95e3755cdf614e1,keras/activations.py,,softmax,#Any#,5

Before Change


        last_output, outputs, states = K.rnn(step, x,
                                             [],
                                             mask=None)
        return outputs
    else:
        raise Exception("Cannot apply softmax to a tensor that is not 2D or 3D. " +
                        "Here, ndim=" + str(ndim))

After Change


    if ndim == 2:
        return K.softmax(x)
    elif ndim == 3:
        e = K.exp(x)
        s = K.sum(e, axis=-1, keepdims=True)
        return e / s
    else:
        raise Exception("Cannot apply softmax to a tensor that is not 2D or 3D. " +
                        "Here, ndim=" + str(ndim))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: keras-team/keras
Commit Name: 3aa807a0c89279b065818a3db95e3755cdf614e1
Time: 2016-02-24
Author: farizrahman4u@gmail.com
File Name: keras/activations.py
Class Name:
Method Name: softmax


Project Name: GPflow/GPflow
Commit Name: d1ac7b831ad36cd0e4bdd7980819f83208345148
Time: 2018-02-07
Author: alex.ialongo@gmail.com
File Name: gpflow/expectations.py
Class Name:
Method Name: _expectation


Project Name: keras-team/keras
Commit Name: 98d49754edd5b5757fb7c37c8a3cdc9a65d6f238
Time: 2015-07-20
Author: michael.d.oliver@gmail.com
File Name: examples/lstm_text_generation.py
Class Name:
Method Name: sample