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)
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)
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)