# Path: lxmls/deep_learning/utils.py
# class Model(object):
#     def __init__(self, **config):
#         self.initialized = False
# 
#     def initialize_features(self, *args):
#         self.initialized = True
#         raise NotImplementedError(
#             "Need to implement initialize_features method"
#         )
# 
#     def get_features(self, input=None, output=None):
#         """
#         Default feature extraction is do nothing
#         """
#         return {'input': input, 'output': output}
# 
#     def predict(self, *args):
#         raise NotImplementedError("Need to implement predict method")
# 
#     def update(self, *args):
#         # This needs to return at least {'cost' : 0}
#         raise NotImplementedError("Need to implement update method")
#         return {'cost': None}
# 
#     def set(self, **kwargs):
#         raise NotImplementedError("Need to implement set method")
# 
#     def get(self, name):
#         raise NotImplementedError("Need to implement get method")
# 
#     def save(self):
#         raise NotImplementedError("Need to implement save method")
# 
#     def load(self, model_folder):
#         raise NotImplementedError("Need to implement load method")


import os
import yaml
import numpy as np
        import matplotlib.pyplot as plt
from six.moves import cPickle as pickle
from copy import deepcopy
from lxmls.deep_learning.utils import Model
    # perturbation of  weight values
    perturbations = np.linspace(-span, span, 200)

    # Compute the loss when varying the study weight
    parameters = deepcopy(model.parameters)
    current_weight = float(get_parameter(parameters))
    loss_range = []
    old_parameters = list(model.parameters)
    for perturbation in perturbations:

        # Chage parameters
        model.parameters = set_parameter(
            parameters,
            current_weight + perturbation
        )

        # Compute loss
        perturbated_loss = model.cross_entropy_loss(
            batch['input'],
            batch['output']
        )
        loss_range.append(perturbated_loss)

    # Return to old parameters
    model.parameters = old_parameters

    weight_range = current_weight + perturbations
    return weight_range, loss_range



# Path: lxmls/deep_learning/utils.py
# class Model(object):
#     def __init__(self, **config):
#         self.initialized = False
# 
#     def initialize_features(self, *args):
#         self.initialized = True
#         raise NotImplementedError(
#             "Need to implement initialize_features method"
#         )
# 
#     def get_features(self, input=None, output=None):
#         """
#         Default feature extraction is do nothing
#         """
#         return {'input': input, 'output': output}
# 
#     def predict(self, *args):
#         raise NotImplementedError("Need to implement predict method")
# 
#     def update(self, *args):
#         # This needs to return at least {'cost' : 0}
#         raise NotImplementedError("Need to implement update method")
#         return {'cost': None}
# 
#     def set(self, **kwargs):
#         raise NotImplementedError("Need to implement set method")
# 
#     def get(self, name):
#         raise NotImplementedError("Need to implement get method")
# 
#     def save(self):
#         raise NotImplementedError("Need to implement save method")
# 
#     def load(self, model_folder):
#         raise NotImplementedError("Need to implement load method")


# Path: lxmls/deep_learning/rnn.py
import os
import yaml
import numpy as np
        import matplotlib.pyplot as plt
from six.moves import cPickle as pickle
from copy import deepcopy
from lxmls.deep_learning.utils import Model

    # perturbation of  weight values
    perturbations = np.linspace(-span, span, 200)

    # Compute the loss when varying the study weight
    parameters = deepcopy(model.parameters)
    current_weight = float(get_parameter(parameters))
    loss_range = []
    old_parameters = list(model.parameters)
    for perturbation in perturbations:

        # Chage parameters
        model.parameters = set_parameter(
            parameters,
            current_weight + perturbation
        )

        # Compute loss
        perturbated_loss = model.cross_entropy_loss(
            batch['input'],
            batch['output']
        )
        loss_range.append(perturbated_loss)

    # Return to old parameters
    model.parameters = old_parameters

    weight_range = current_weight + perturbations
    return weight_range, loss_range



class RNN(Model):