# Path: scripts/keras/keras/utils/generic_utils.py
# def get_from_module(identifier, module_params, module_name, instantiate=False):
#     if type(identifier) is str:
#         res = module_params.get(identifier)
#         if not res:
#             raise Exception('Invalid ' + str(module_name) + ': ' + str(identifier))
#         if instantiate:
#             return res()
#         else:
#             return res
#     return identifier


import theano
import theano.tensor as T
import types
from .utils.generic_utils import get_from_module
from __future__ import absolute_import

def softmax(x):
    return T.nnet.softmax(x)

def time_distributed_softmax(x):
    xshape = x.shape
    X = x.reshape((xshape[0] * xshape[1], xshape[2]))
    return T.nnet.softmax(X).reshape(xshape)

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)


# Path: scripts/keras/keras/utils/generic_utils.py
# def get_from_module(identifier, module_params, module_name, instantiate=False):
#     if type(identifier) is str:
#         res = module_params.get(identifier)
#         if not res:
#             raise Exception('Invalid ' + str(module_name) + ': ' + str(identifier))
#         if instantiate:
#             return res()
#         else:
#             return res
#     return identifier


# Path: scripts/keras/keras/activations.py
import theano
import theano.tensor as T
import types
from .utils.generic_utils import get_from_module

from __future__ import absolute_import

def softmax(x):
    return T.nnet.softmax(x)

def time_distributed_softmax(x):
    xshape = x.shape
    X = x.reshape((xshape[0] * xshape[1], xshape[2]))
    return T.nnet.softmax(X).reshape(xshape)

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):