def get_y_pred(model_file_name, test_set_x): hidden_W, hidden_b, sgd_W, sgd_b = np.load(model_file_name) hidden_output = np.tanh(np.dot(test_set_x, hidden_W) + hidden_b) _p_y_given_x = p_y_given_x(hidden_output, sgd_W, sgd_b) return np.argmax(_p_y_given_x, axis=1)
def get_y_pred(model_file_name, test_set_x): W, b = np.load(model_file_name) _p_y_given_x = p_y_given_x(test_set_x, W, b) return np.argmax(_p_y_given_x, axis=1)