forked from keras-team/keras
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
706 additions
and
650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,44 @@ | ||
from __future__ import absolute_import | ||
import theano.tensor as T | ||
|
||
|
||
def softmax(x): | ||
return T.nnet.softmax(x.reshape((-1, x.shape[-1]))).reshape(x.shape) | ||
|
||
|
||
def time_distributed_softmax(x): | ||
import warnings | ||
warnings.warn("time_distributed_softmax is deprecated. Just use softmax!", DeprecationWarning) | ||
return softmax(x) | ||
|
||
|
||
def softplus(x): | ||
return T.nnet.softplus(x) | ||
|
||
|
||
def relu(x): | ||
return (x + abs(x)) / 2.0 | ||
|
||
|
||
def tanh(x): | ||
return T.tanh(x) | ||
|
||
|
||
def sigmoid(x): | ||
return T.nnet.sigmoid(x) | ||
|
||
|
||
def hard_sigmoid(x): | ||
return T.nnet.hard_sigmoid(x) | ||
|
||
|
||
def linear(x): | ||
''' | ||
The function returns the variable that is passed in, so all types work | ||
''' | ||
return x | ||
|
||
|
||
from .utils.generic_utils import get_from_module | ||
def get(identifier): | ||
return get_from_module(identifier, globals(), 'activation function') |
Oops, something went wrong.