<jupyter_start><jupyter_text><jupyter_code>import numpy as np
import time

a=np.random.rand(1000000)
b=np.random.rand(1000000)

tic =time.time()
c=np.dot(a,b)
toc =time.time()
print(c)
print(toc)
print(tic)
print(f"Vector = {toc-tic} ms")

c=0
tic =time.time()
for i in range(1000000):
  c+=a[i]*b[i]
toc =time.time()
print(f"Loop = {toc-tic} ms")
print(c)
ab=np.array([1,2])
cd=np.array([6,7])

df=np.dot(ab,cd)
df
list1=[1,2,4]
list2=[2,3,4]

re=0
for i in range(0,3):
  re+=list1[i]*list2[i]
  print(re)
print(re)
A=np.array([[56,0,4.4,8],
           [1.2, 104, 52,8],
           [1.8,135, 99, 0.9]])
A
cal=A.sum(axis=0)
cal.shape
per=100*A/cal.reshape(1,4)
per
a=np.random.rand(5)
a
a.T
a.reshape(1,5).T
a=np.random.rand(5,1)
a
np.dot(a,a.T)
a = np.random.randn(2, 3) # a.shape = (2, 3)
b = np.random.randn(2, 1) # b.shape = (2, 1)
c = a + b
print(a)
print(b)
print(c)
c.shape
a = np.random.randn(12288, 150) # a.shape = (12288, 150)
b = np.random.randn(150, 45) # b.shape = (150, 45)
c = np.dot(a,b)
c.shape
a = np.random.randn(3, 4) # a.shape = (2, 3)
b = np.random.randn(4, 1) # b.shape = (2, 1)
c = a + b.T
for i in range(3):
  for j in range(4):
    c[i][j] = a[i][j] + b[j]
c.shape
a = np.random.randn(3, 4) # a.shape = (2, 3)
b = np.random.randn(4, 1) # b.shape = (2, 1)

c = a + b.T
c.shape
a = np.random.randn(3, 3)
b = np.random.randn(3, 1)
c = a*b
c<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.23959827833572453, 'fraction_numerical': 0.09253945480631277, 'mean_word_length': 3.696969696969697, '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': '217991', 'license': 'MIT', 'n_tokens_mistral': 816, 'n_tokens_neox': 744, 'n_words': 152, 'path': 'Neural_Networks_and_Deep_Learning_Course_1.ipynb', 'repo_name': 'zaur-guliyev/deep_learning', 'size': '1394'}