original_docstring: 
      Trains softmax, classifies test data, computes test error, and plots cost function
  
      Runs softmax_regression on the MNIST training set and computes the test error using
      the test set. It uses the following values for parameters:
      alpha = 0.3
      lambda = 1e-4
      num_iterations = 150
  
      Saves the final theta to ./theta.pkl.gz
  
      Returns:
          Final test error
      
docstring: Trains softmax, classifies test data, computes test error, and plots cost function
  Runs softmax_regression on the MNIST training set and computes the test error using
  the test set. It uses the following values for parameters:
  alpha = 0.3
  lambda = 1e-4
  num_iterations = 150
  
  Saves the final theta to ./theta.pkl.gz
docstring_tokens: Trains softmax classifies test data computes test error and plots cost function Runs softmax_regression on the MNIST training set and computes the test error using the test set . It uses the following values for parameters : alpha = 0 . 3 lambda = 1e - 4 num_iterations = 150 Saves the final theta to . / theta . pkl . gz
code: def run_softmax_on_MNIST(temp_parameter=1):
      """
      Trains softmax, classifies test data, computes test error, and plots cost function
  
      Runs softmax_regression on the MNIST training set and computes the test error using
      the test set. It uses the following values for parameters:
      alpha = 0.3
      lambda = 1e-4
      num_iterations = 150
  
      Saves the final theta to ./theta.pkl.gz
  
      Returns:
          Final test error
      """
      train_x, train_y, test_x, test_y = get_MNIST_data()
  
      theta, cost_function_history = softmax_regression(
          train_x, train_y, temp_parameter, alpha=0.3, lambda_factor=1.0e-4, k=10, num_iterations=150)
  
      plot_cost_function_over_time(cost_function_history)
  
      test_error = compute_test_error(test_x, test_y, theta, temp_parameter)
  
      # Save the model parameters theta obtained from calling softmax_regression to disk.
      write_pickle_data(theta, "./theta.pkl.gz")
  
      # TODO: add your code here for the "Using the Current Model" question in tab 4.
      #      and print the test_error_mod3
      _, test_y_mod3 = update_y(train_y, test_y)
      test_error_mod3 = compute_test_error_mod3(
          test_x, test_y_mod3, theta, temp_parameter)
      print(
          '\n', 'Softmax Regression [Predictions Mod 3] Test Error (T = 1):', test_error_mod3)
  
      return test_error
code_tokens: def run_softmax_on_MNIST ( temp_parameter = 1 ) : train_x , train_y , test_x , test_y = get_MNIST_data ( ) theta , cost_function_history = softmax_regression ( train_x , train_y , temp_parameter , alpha = 0.3 , lambda_factor = 1.0e-4 , k = 10 , num_iterations = 150 ) plot_cost_function_over_time ( cost_function_history ) test_error = compute_test_error ( test_x , test_y , theta , temp_parameter ) write_pickle_data ( theta , "./theta.pkl.gz" ) _ , test_y_mod3 = update_y ( train_y , test_y ) test_error_mod3 = compute_test_error_mod3 ( test_x , test_y_mod3 , theta , temp_parameter ) print ( '\n' , 'Softmax Regression [Predictions Mod 3] Test Error (T = 1):' , test_error_mod3 ) return test_error
short_docstring: Trains softmax, classifies test data, computes test error, and plots cost function
  Runs softmax_regression on the MNIST training set and computes the test error using
  the test set.
short_docstring_tokens: Trains softmax classifies test data computes test error and plots cost function Runs softmax_regression on the MNIST training set and computes the test error using the test set .
comment: """
      Trains softmax, classifies test data, computes test error, and plots cost function
  
      Runs softmax_regression on the MNIST training set and computes the test error using
      the test set. It uses the following values for parameters:
      alpha = 0.3
      lambda = 1e-4
      num_iterations = 150
  
      Saves the final theta to ./theta.pkl.gz
  
      Returns:
          Final test error
      """$SEP$# Save the model parameters theta obtained from calling softmax_regression to disk.$SEP$# TODO: add your code here for the "Using the Current Model" question in tab 4.$SEP$#      and print the test_error_mod3