<jupyter_start><jupyter_text>NumPy broadcast<jupyter_code>t = np.arange(9).astype(float)

t += 1.0 # broadcasted
print(t)

print(1.0 / t)  # broadcasted
def sigmoid(x):
    return 1 / (1 + np.exp(-x))    

X = np.arange(-5.0, 5.0, 0.1)
Y = sigmoid(X)
plt.plot(X, Y)
plt.ylim(-0.1, 1.1)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20245398773006135, 'fraction_numerical': 0.05214723926380368, 'mean_word_length': 3.8805970149253732, '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': '133252', 'license': 'MIT', 'n_tokens_mistral': 171, 'n_tokens_neox': 162, 'n_words': 27, 'path': 'ch03/sigmoid.ipynb', 'repo_name': 'doyu/dlfs1', 'size': '326'}