from .quadratic import Quadratic
from .rosenbrock import Rosenbrock
from .beale import Beale
from .booth import Booth
from .matyas import Matyas
from .logistic_regression import LogisticRegression
from .stochastic_logistic_regression import StochasticLogisticRegression
from .stochastic_linear_regression import StochasticLinearRegression

from .correct_stoch_logreg import CorrectStochLogreg
from .correct_stoch_linreg import CorrectStochLinreg

from .digits_classifier import DIGITSClassifier
from .conv_classifier import ConvClassifier
from .lstm_ptb import LSTM_PTB

from . import transformers

from . import from_rnnprop
from .rnnprop_adapt import RNNPropAdapter

problems = [
    'quadratic', 'rosenbrock', 'logreg',
    'stoch_logreg', 'stoch_linear',
    'noisy_stoch_logreg', 'noisy_stoch_linear',
    'correct_stoch_logreg', 'correct_stoch_linear',
    'small_correct_stoch_logreg', 'small_correct_stoch_linear',

    'stoch_logreg_10', 
    'mixed', 'mixed_stoch', 'mixed_nonstoch',
    'correct_mixed_stoch',

    '_digits_classifier',

    'conv_digits_classifier', 'conv_digits_classifier_2',
    'beale', 'booth', 'matyas', 'stoch_only',
    'vgg-cifar-10',
    'lstm_ptb',

    'digits_classifier',
    'digits_classifier_2',
    'digits_classifier_3',
    'digits_classifier_6',
    'digits_classifier_12',
    'digits_classifier_18',

    'digits_classifier_relu',
    'digits_classifier_relu_2',
    'digits_classifier_relu_3',
    'digits_classifier_relu_6',
    'digits_classifier_relu_12',
    'digits_classifier_relu_18',
    
    '_mnist_classifier',
    'mnist_classifier',
    'mnist_classifier_3',
    'mnist_classifier_6',
    'mnist_classifier_12',
    'mnist_classifier_18',
    
    'mnist_classifier_relu',
    'mnist_classifier_relu_3',
    'mnist_classifier_relu_6',
    'mnist_classifier_relu_12',
    'mnist_classifier_relu_18',
]


rnnprop_problems = [
    'mnist-nn-l2-sigmoid-100',
    'mnist-nn-l2-relu-100',
    'mnist-nn-l2-elu-100',
    'mnist-nn-l2-tanh-100',

    'mnist-nn-sigmoid-100',
    'mnist-nn-relu-100',
    'mnist-nn-elu-100',
    'mnist-nn-tanh-100',
    'mnist-nn-l2-sigmoid-100',
    'mnist-nn-l3-sigmoid-100',
    'mnist-nn-l4-sigmoid-100',
    'mnist-nn-l5-sigmoid-100',
    'mnist-nn-l6-sigmoid-100',
    'mnist-nn-l7-sigmoid-100',
    'mnist-nn-l8-sigmoid-100',
    'mnist-nn-l9-sigmoid-100',
    'mnist-nn-l10-sigmoid-100',
    'vgg-mnist-fc1-conv2-pool1-100',
    'vgg-cifar-fc1-conv2-pool1-100',
    'vgg-mnist-fc2-conv4-pool2-100',
    'vgg-cifar-fc2-conv4-pool2-100',
    'sin_lstm',
    'sin_lstm-x2',
    'sin_lstm-no001',
    
    '_mnist-nn-sigmoid-100',
    '_mnist-nn-relu-100',
    '_mnist-nn-elu-100',

    'digits_classifier_0',
    '_digits_classifier_0',
    'digits_classifier_0_random',
    '_digits_classifier_0_random'
]

problems.extend(rnnprop_problems)


def get_optimizees(problems_list, clip_by_value=False, random_scale=False, noisy_grad=False):
    optimizees = {
        'quadratic'   : Quadratic(low=50, high=100),
        'rosenbrock'  : Rosenbrock(low=2, high=10),
        'beale'       : Beale(low=2, high=10),
        'booth'       : Booth(low=2, high=10),
        'matyas'      : transformers.UniformRandomScaling(Matyas(low=2, high=10), r=3.0),
        'logreg'      : LogisticRegression(max_data_size=1000, max_features=100),
        'stoch_logreg': StochasticLogisticRegression(max_data_size=1000, max_features=100),
        'stoch_linear': StochasticLinearRegression(max_data_size=1000, max_features=100),
        
        'correct_stoch_logreg': CorrectStochLogreg(max_data_size=1000, max_features=100),
        'correct_stoch_linear': CorrectStochLinreg(max_data_size=1000, max_features=100),

        'small_correct_stoch_logreg': CorrectStochLogreg(max_data_size=100, max_features=10, min_data_size=10),
        'small_correct_stoch_linear': CorrectStochLinreg(max_data_size=100, max_features=10, min_data_size=10),

        'noisy_1_correct_stoch_logreg': transformers.NormalNoisyGrad(CorrectStochLogreg(max_data_size=1000, max_features=100), stddev=1e-1),
        'noisy_1_correct_stoch_linear': transformers.NormalNoisyGrad(CorrectStochLinreg(max_data_size=1000, max_features=100), stddev=1e-1),
        'noisy_2_correct_stoch_logreg': transformers.NormalNoisyGrad(CorrectStochLogreg(max_data_size=1000, max_features=100), stddev=1e-2),
        'noisy_2_correct_stoch_linear': transformers.NormalNoisyGrad(CorrectStochLinreg(max_data_size=1000, max_features=100), stddev=1e-2),
        'noisy_3_correct_stoch_logreg': transformers.NormalNoisyGrad(CorrectStochLogreg(max_data_size=1000, max_features=100), stddev=1e-3),
        'noisy_3_correct_stoch_linear': transformers.NormalNoisyGrad(CorrectStochLinreg(max_data_size=1000, max_features=100), stddev=1e-3),