机器学习课程作业,其中第一个作业是梯度下降求cos函数在 0 ∼ π 0 \sim \pi 0∼π的最低值 直接上代码,简单易懂 import random import numpy as np from matplotlib import pyplot as plt results = map(np.cos, [angle * np.pi / 180 for angle in range(0, 181)])