<jupyter_start><jupyter_text>Lesson 1---<jupyter_code># import the modules
import numpy as np
import matplotlib.pyplot as plt

%matplotlib inline<jupyter_output><empty_output><jupyter_text>Problem 1---Implement the softmax function<jupyter_code>x = np.asmatrix([scores,scores])

print x, np.exp(x)/np.sum(np.exp(x),axis=1)
def softmax(x):
    """Compute softmax values for each sets of scores in x."""
    x = np.asarray(x)
    return np.exp(x)/np.sum(np.exp(x),axis=0) 
# analysis 1
scores = [3.0, 1.0, 0.2]
print(softmax(scores))
# Plot softmax curves
x = np.arange(-2.0, 6.0, 0.1)
scores = np.vstack([x, np.ones_like(x), 0.2 * np.ones_like(x)])

plt.plot(x, softmax(scores).T, linewidth=2)
plt.legend(['x','1','0.2'])
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18265440210249673, 'fraction_numerical': 0.030223390275952694, 'mean_word_length': 5.245901639344262, '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': '570304', 'license': 'MIT', 'n_tokens_mistral': 336, 'n_tokens_neox': 319, 'n_words': 63, 'path': 'Udacity/Lesson1.ipynb', 'repo_name': 'buntyke/DeepLearningMOOC', 'size': '761'}