<jupyter_start><jupyter_text>Multinomial (Softmax) Regression and Gradient Descent---  Setup<jupyter_code>import os, sys
from pathlib import Path

# Notebook Library
url = "https://github.com/Data-Science-and-Data-Analytics-Courses/Notebook-Library"
repo = Path("/nblib")
!git clone "{url}" "{repo}"
if repo.parent.as_posix() not in sys.path:
  sys.path.append(repo.parent.as_posix())
%run "{repo}/.Importable.ipynb"

from nblib import Git
# Remote
URL = "https://github.com/Data-Science-and-Data-Analytics-Courses/MITx---Machine-Learning-with-Python-From-Linear-Models-to-Deep-Learning-Jun-11-2019"
REPO = Git.clone(URL, dest="/content")
if REPO.as_posix() not in sys.path:
  sys.path.append(REPO.as_posix())

# Working directory, for running modules in part1
part1dir = REPO / "Project 2: Digit recognition (Part 1)/mnist/part1"
os.chdir(part1dir)

from setup.Setup import *
import main, test<jupyter_output>Cloning into '/nblib'...
remote: Enumerating objects: 32, done.[K
remote: Counting objects: 100% (32/32), done.[K
remote: Compressing objects: 100% (29/29), done.[K
remote: Total 32 (delta 15), reused 7 (delta 2), pack-reused 0[K
Unpacking objects: 100% (32/32), done.<jupyter_text>Test Error on Softmax Regression<jupyter_code>main.run_softmax_on_MNIST(temp_parameter=1)<jupyter_output><empty_output><jupyter_text>Temperature<jupyter_code>print(f"Error (temp_parameter=0.5): {main.run_softmax_on_MNIST(temp_parameter=0.5)}")
print(f"Error (temp_parameter=2): {main.run_softmax_on_MNIST(temp_parameter=2)}")<jupyter_output><empty_output><jupyter_text>6. Changing Labels<jupyter_code>main.run_softmax_on_MNIST(temp_parameter=1)<jupyter_output><empty_output><jupyter_text>Retrain with New Labels<jupyter_code>main.run_softmax_on_MNIST_mod3(temp_parameter=1)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14396887159533073, 'fraction_numerical': 0.029460811561978877, 'mean_word_length': 7.219178082191781, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 2, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '286420', 'license': 'MIT', 'n_tokens_mistral': 735, 'n_tokens_neox': 678, 'n_words': 118, 'path': 'project2_digit_recognition/Multinomial_Regression.ipynb', 'repo_name': 'marielfaedo/MITx---Machine-Learning-with-Python-From-Linear-Models-to-Deep-Learning-Jun-11-2019', 'size': '1799'}