<jupyter_start><jupyter_text>Vectorization for speed<jupyter_code>import numpy as np
import time
import math
#Lets define two array with size 100000
n=100000
a=np.ones(n)
b=np.ones(n)
#One way to add them is to iterate through every one of them
start=time.time()
c=np.zeros(n)
for i in range(n):
    c[i]=a[i]+b[i]
'%.5f sec' % (time.time() - start)
#Another way is to add vectors directly
# As we can see vectorization offers magnitude speedups
start = time.time()
d = a + b
'%.5f sec' % (time.time() - start)<jupyter_output><empty_output><jupyter_text>The Normal Distribution and Squared Loss<jupyter_code>import matplotlib.pyplot as plt
#The normal distribution with various means and variances can be viewed as follows
%matplotlib inline
#Mean and variance pairs
parameters=[(0,1), (0,2), (3, 1)]
x=np.arange(-7, 7, 0.01)
for (mu, sigma) in parameters:
    p=1/math.sqrt(2*math.pi*sigma**2)
    p=p*np.exp(-0.5/sigma**2*(x-mu)**2)
    plt.plot(x, p, label='mean %d, variance %d' %(mu, sigma))
plt.legend()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14629451395572665, 'fraction_numerical': 0.030798845043310877, 'mean_word_length': 5.227544910179641, 'pattern_counts': {'":': 0, '<': 9, '<?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}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '439408', 'license': 'MIT', 'n_tokens_mistral': 415, 'n_tokens_neox': 390, 'n_words': 118, 'path': 'Linear_NN/test1.ipynb', 'repo_name': 'vishal-burman/MXNet_Architectures', 'size': '1039'}