<jupyter_start><jupyter_text>COURSE: A deep understanding of deep learning SECTION: Math prerequisites LECTURE: Logarithms TEACHER: <NAME>, sincxpress.com COURSE URL: udemy.com/course/dudl/?couponCode=202201<jupyter_code># import libraries
import numpy as np
import matplotlib.pyplot as plt
# define a set of points to evaluate
x = np.linspace(.0001,1,200)

# compute their log
logx = np.log(x)



# plot!
fig = plt.figure(figsize=(10,4))

# increase font size. FYI
plt.rcParams.update({'font.size':15})

plt.plot(x,logx,'ks-',markerfacecolor='w')
plt.xlabel('x')
plt.ylabel('log(x)')
plt.show()
# demonstration that log and exp are inverses

# redefine with fewer points
x = np.linspace(.0001,1,20)

# log and exp
logx = np.log(x)
expx = np.exp(x)

# the plot
plt.plot(x,x,color=[.8,.8,.8])
plt.plot(x,np.exp(logx),'o',markersize=8)
plt.plot(x,np.log(expx),'x',markersize=8)
plt.xlabel('x')
plt.ylabel('f(g(x))')
plt.legend(['unity','exp(log(x))','log(exp(x))'])
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18227091633466136, 'fraction_numerical': 0.030876494023904383, 'mean_word_length': 6.127659574468085, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '98351', 'license': 'MIT', 'n_tokens_mistral': 449, 'n_tokens_neox': 418, 'n_words': 83, 'path': '01_math/DUDL_math_log.ipynb', 'repo_name': 'amitmeel/DUDL', 'size': '1010'}