函数、坐标与参数Functions, Coordinates & Parameters
同一条规则里的参数改变时,输入与输出的关系怎样变化?How does changing a parameter change the relationship between input and output?
前置知识:Prerequisites: 高中代数与平面坐标;熟悉的读者可先做文末小检查。High-school algebra and Cartesian coordinates. If these are familiar, try the check at the end first.
学完后你能:After this lesson you can: 读出坐标,区分输入和参数,并预测斜率或截距变化的效果。Read coordinates, distinguish inputs from parameters, and predict the effect of slope or intercept changes.
动手观察Explore
先预测:让截距增加,直线会如何移动?再调节两个参数,核对图与表。Predict: what happens when the intercept increases? Adjust both parameters and compare the graph with the table.
从观察到解释From observation to explanation
先观察一个输入Observe one input
横轴表示输入 x,纵轴表示输出 y。点 (2, 5) 的意思是:输入 2,规则给出输出 5。改变输入是在同一条图线上寻找另一个点。The horizontal axis is input x and the vertical axis is output y. The point (2, 5) means the rule outputs 5 for input 2. Changing the input selects a different point on the same graph.
再观察整条规则Now change the rule
先固定 a = 2、b = 1:x = −1、0、1 对应 y = −1、1、3。把 b 增加 1,所有输出都增加 1,直线平行上移;把 a 增加,则每向右走一步时 y 的增量改变。First fix a = 2 and b = 1: inputs −1, 0, 1 give outputs −1, 1, 3. Increasing b by 1 adds 1 to every output and shifts the line upward. Increasing a changes the rise for each step to the right.
用在机器学习里Connection to machine learning
一个简单模型也可以写成 y = ax + b:输入是特征,参数控制预测规则。训练会调整参数;这里先只关注参数变化如何影响图像。A simple model can also be written y = ax + b: the input is a feature and the parameters control the prediction rule. Training adjusts these parameters; here we focus only on how they affect the graph.
公式与符号Formula and symbols
x 是输入,y 或 f(x) 是输出;a 是斜率,b 是纵轴截距。a、b 是可以固定或调整的参数。x is the input and y or f(x) is the output; a is the slope and b the vertical intercept. The parameters a and b can be held fixed or adjusted.
留意这个区别Watch for this
区分改变一个输入与改变参数:前者沿同一图线移动,后者改变整条规则。斜率为负时,x 增大反而使 y 减小。Distinguish changing an input from changing a parameter: the former moves along one graph, while the latter changes the rule. A negative slope means y decreases as x increases.
继续探索Explore further
课后练习
检验你的理解