<commit_before>
import numpy as np
from numpy.lib.stride_tricks import as_strided
from GPy.core.parameterization.transformations import Transformation, _lim_val, epsilon

def get_conv_1D(arr, win):
    assert win>0
    arr = arr.copy()
    if win==1:
        return arr
    else:
        return as_strided(arr, shape=(arr.shape[0]-win+1,win)+arr.shape[1:], strides=(arr.strides[0],)+arr.strides)
    
class LogexpInv(Transformation):
    def f(self, x):
        return np.where(x>_lim_val, x, np.log(np.exp(x+1e-20) - 1.))
    def finv(self, f):
        return np.where(f>_lim_val, f, np.log1p(np.exp(np.clip(f, -_lim_val, _lim_val)))) + epsilon        
    def gradfactor(self, f, df):<commit_msg>Update util.py for new version of GPy<commit_after>
import numpy as np
from numpy.lib.stride_tricks import as_strided
from paramz.transformations import Transformation, _lim_val, epsilon

def get_conv_1D(arr, win):
    assert win>0
    arr = arr.copy()
    if win==1:
        return arr
    else:
        return as_strided(arr, shape=(arr.shape[0]-win+1,win)+arr.shape[1:], strides=(arr.strides[0],)+arr.strides)
    
class LogexpInv(Transformation):
    def f(self, x):
        return np.where(x>_lim_val, x, np.log(np.exp(x+1e-20) - 1.))
    def finv(self, f):
        return np.where(f>_lim_val, f, np.log1p(np.exp(np.clip(f, -_lim_val, _lim_val)))) + epsilon        
    def gradfactor(self, f, df):
{'fraction_non_alphanumeric': 0.14346895074946467, 'fraction_numerical': 0.017130620985010708, 'mean_word_length': 3.4935897435897436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4843634', 'n_tokens_mistral': 541, 'n_tokens_neox': 532, 'n_words': 115}