<commit_before>import tensorflow as tf
import numpy as np
from scipy.spatial.distance import cdist
import sonnet as snt

def get_bsuite_median(dataset, n_action):
    data = next(iter(dataset)).data
    obs, action = data[:2]
    action_aug = tf.one_hot(action, depth=n_action)
    flat = snt.Flatten()
    inputs = tf.concat([flat(obs), action_aug], axis=1)
    arr = inputs.numpy()
    dists = cdist(arr, arr)
    return 1.0 / np.median(dists)
<commit_msg>change distance function (bug fix)<commit_after>import tensorflow as tf
import numpy as np
from scipy.spatial.distance import cdist
import sonnet as snt

def get_bsuite_median(dataset, n_action):
    data = next(iter(dataset)).data
    obs, action = data[:2]
    action_aug = tf.one_hot(action, depth=n_action)
    flat = snt.Flatten()
    inputs = tf.concat([flat(obs), action_aug], axis=1)
    arr = inputs.numpy()
    dists = cdist(arr, arr, "sqeuclidean")
    return 1.0 / np.median(dists)

{'fraction_non_alphanumeric': 0.11869747899159663, 'fraction_numerical': 0.008403361344537815, 'mean_word_length': 4.015789473684211, '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': '5607652', 'n_tokens_mistral': 346, 'n_tokens_neox': 334, 'n_words': 87}