Beispiel #1
0
def test_keys_dictionary():
    ogdlr_keys = ogdlr_after.keys()
    ftrl_keys = ftrl_after.keys()
    assert ogdlr_keys == ftrl_keys
    known_keys = set(['BIAS', 'weather__rainy', 'weather__sunny',
                      'temperature__cold', 'temperature__warm'])
    assert known_keys <= set(ftrl_keys)
Beispiel #2
0
def test_weights():
    ogdlr_weights = ogdlr_after.weights()
    ftrl_weights = ftrl_after.weights()
    hash_keys = [mmh(key, seed=SEED) % NDIMS for key in ftrl_after.keys()]
    hash_weights = hash_after._get_w(hash_keys)

    assert np.allclose(ogdlr_weights, ftrl_weights)
    assert np.allclose(hash_weights, ftrl_weights)
Beispiel #3
0
def test_weights():
    ogdlr_weights = ogdlr_after.weights()
    ftrl_weights = ftrl_after.weights()
    hash_keys = [mmh(key, seed=SEED) % NDIMS for key in ftrl_after.keys()]
    hash_weights = hash_after._get_w(hash_keys)

    assert np.allclose(ogdlr_weights, ftrl_weights)
    assert np.allclose(hash_weights, ftrl_weights)
Beispiel #4
0
def test_keys_dictionary():
    ogdlr_keys = ogdlr_after.keys()
    ftrl_keys = ftrl_after.keys()
    assert ogdlr_keys == ftrl_keys
    known_keys = set([
        'BIAS', 'weather__rainy', 'weather__sunny', 'temperature__cold',
        'temperature__warm'
    ])
    assert known_keys <= set(ftrl_keys)