<commit_before># -*- coding: utf-8 -*-

import numpy as np

import climin
from climin.util import optimizer


def test_optimizer():
    pairs = [('asgd', climin.Asgd), 
             ('ksd', climin.KrylovSubspaceDescent),
             ('gd', climin.GradientDescent),
             ('lbfgs', climin.Lbfgs),
             ('ncg', climin.NonlinearConjugateGradient),
             ('rprop', climin.Rprop),
             ('smd', climin.Smd)]

    for ident, klass in pairs:
        wrt = np.zeros(10)
        opt = optimizer(ident, wrt, f=None, fprime=None, f_Hp=None)
        assert isinstance(opt, klass), 'wrong class for %s: %s' % (ident, type(opt))<commit_msg>removed one more trace of ksd<commit_after># -*- coding: utf-8 -*-

import numpy as np

import climin
from climin.util import optimizer


def test_optimizer():
    pairs = [('asgd', climin.Asgd),
             ('gd', climin.GradientDescent),
             ('lbfgs', climin.Lbfgs),
             ('ncg', climin.NonlinearConjugateGradient),
             ('rprop', climin.Rprop),
             ('smd', climin.Smd)]

    for ident, klass in pairs:
        wrt = np.zeros(10)
        opt = optimizer(ident, wrt, f=None, fprime=None, f_Hp=None)
        assert isinstance(opt, klass), 'wrong class for %s: %s' % (ident, type(opt))
{'fraction_non_alphanumeric': 0.14823529411764705, 'fraction_numerical': 0.004705882352941176, 'mean_word_length': 2.495890410958904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6155128', 'n_tokens_mistral': 441, 'n_tokens_neox': 430, 'n_words': 108}