<jupyter_start><jupyter_text>timings<jupyter_code>N_test = np.logspace(0, 3, 10)
event = events[333]

timings = []
timings_tf = []

for n in N_test:
    params = np.repeat(event['params'][np.newaxis, :], n, axis=0)
    params += np.random.randn(*params.shape)
    t = %timeit -o llh = my_llh(event, params)
    
    tft =  %timeit -o nllh = freedom_nllh(event['hits'], params, len(event['hits']) - 1 , models)
    
    timings.append(t)
mean = np.array([t.average for t in timings])/N_test * 1e6
std = np.array([t.stdev for t in timings])/N_test * 1e6

plt.errorbar(N_test, mean, yerr=std)
plt.gca().set_xscale('log')
plt.gca().set_yscale('log')
plt.gca().set_xlabel('N likelihood points requested')
plt.gca().set_ylabel(r'$\mu$s / point')
plt.grid()
plt.savefig('timings_cpu_single_vs_tf.png')
len(event['hits'])
%lprun -f my_llh.__call__ my_llh(event, np.repeat(event['params'][np.newaxis, :], 10000, axis=0))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18703506907545164, 'fraction_numerical': 0.020191285866099893, 'mean_word_length': 4.962025316455696, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '576111', 'license': 'Apache-2.0', 'n_tokens_mistral': 420, 'n_tokens_neox': 400, 'n_words': 69, 'path': 'notebooks/peller/timing.ipynb', 'repo_name': 'gmwendel/freeDOM', 'size': '941'}