# Path: shorttext/utils/classification_exceptions.py
# class UnequalArrayLengthsException(Exception):
#     def __init__(self, arr1, arr2):
#         self.message = 'Unequal lengths: '+str(len(arr1))+" and "+str(len(arr2))


from keras.layers import Dense, Activation
from keras.models import Sequential
from keras.regularizers import l2
from shorttext.utils.classification_exceptions import UnequalArrayLengthsException

def DenseWordEmbed(nb_labels,
                   dense_nb_nodes=[],
                   dense_actfcn=[],
                   vecsize=300,
                   reg_coef=0.1,
                   final_activiation='softmax',
                   optimizer='adam'):
    """ Return layers of dense neural network.

    Return layers of dense neural network. This assumes the input to be a rank-1 vector.

    :param nb_labels: number of class labels
    :param dense_nb_nodes: number of nodes in each later (Default: [])
    :param dense_actfcn: activation functions for each layer (Default: [])
    :param vecsize: length of the embedded vectors in the model (Default: 300)
    :param reg_coef: regularization coefficient (Default: 0.1)
    :param final_activiation: activation function of the final layer (Default: softmax)
    :param optimizer: optimizer for gradient descent. Options: sgd, rmsprop, adagrad, adadelta, adam, adamax, nadam. (Default: adam)
    :return: keras sequential model for dense neural network
    :type nb_labels: int
    :type dense_nb_nodes: list
    :type dense_actfcn: list
    :type vecsize: int
    :type reg_coef: float
    :type final_activiation: str
    :type optimizer: str
    :rtype: keras.models.Model
    """
    if len(dense_nb_nodes)!=len(dense_actfcn):

# Path: shorttext/utils/classification_exceptions.py
# class UnequalArrayLengthsException(Exception):
#     def __init__(self, arr1, arr2):
#         self.message = 'Unequal lengths: '+str(len(arr1))+" and "+str(len(arr2))


# Path: shorttext/classifiers/embed/sumvec/frameworks.py
from keras.layers import Dense, Activation
from keras.models import Sequential
from keras.regularizers import l2
from shorttext.utils.classification_exceptions import UnequalArrayLengthsException


def DenseWordEmbed(nb_labels,
                   dense_nb_nodes=[],
                   dense_actfcn=[],
                   vecsize=300,
                   reg_coef=0.1,
                   final_activiation='softmax',
                   optimizer='adam'):
    """ Return layers of dense neural network.

    Return layers of dense neural network. This assumes the input to be a rank-1 vector.

    :param nb_labels: number of class labels
    :param dense_nb_nodes: number of nodes in each later (Default: [])
    :param dense_actfcn: activation functions for each layer (Default: [])
    :param vecsize: length of the embedded vectors in the model (Default: 300)
    :param reg_coef: regularization coefficient (Default: 0.1)
    :param final_activiation: activation function of the final layer (Default: softmax)
    :param optimizer: optimizer for gradient descent. Options: sgd, rmsprop, adagrad, adadelta, adam, adamax, nadam. (Default: adam)
    :return: keras sequential model for dense neural network
    :type nb_labels: int
    :type dense_nb_nodes: list
    :type dense_actfcn: list
    :type vecsize: int
    :type reg_coef: float
    :type final_activiation: str
    :type optimizer: str
    :rtype: keras.models.Model
    """
    if len(dense_nb_nodes)!=len(dense_actfcn):

        raise UnequalArrayLengthsException(dense_nb_nodes, dense_actfcn)