Posted on Categories:Optimization Theory, 优化理论, 优化理论代写, 数学代写, 机器学习代写, 机器学习代考

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代考|Steepest Descent Direction

The Taylor expansion (7) computes an affine approximation of the function $f$ near $x$, since it can be written as
$$f(z)=T_x(z)+o(|x-z|) \quad \text { where } \quad T_x(z) \stackrel{\text { def. }}{=} f(x)+\langle\nabla f(x), z-x\rangle,$$
see Fig. 8. First order methods operate by locally replacing $f$ by $T_x$.
The gradient $\nabla f(x)$ should be understood as a direction along which the function increases. This means that to improve the value of the function, one should move in the direction $-\nabla f(x)$. Given some fixed $x$, let us look as the function $f$ along the 1-D half line
$$\tau \in \mathbb{R}^{+}=[0,+\infty[\longmapsto f(x-\tau \nabla f(x)) \in \mathbb{R}$$

If $f$ is differentiable at $x$, one has
$$f(x-\tau \nabla f(x))=f(x)-\tau\langle\nabla f(x), \nabla f(x)\rangle+o(\tau)=f(x)-\tau|\nabla f(x)|^2+o(\tau) .$$
So there are two possibility: either $\nabla f(x)=0$, in which case we are already at a minimum (possibly a local minimizer if the function is non-convex) or if $\tau$ is chosen small enough,
$$f(x-\tau \nabla f(x))<f(x)$$
which means that moving from $x$ to $x-\tau \nabla f(x)$ has improved the objective function.
Remark 2 (Orthogonality to level sets). The level sets of $f$ are the sets of point sharing the same value of $f$, i.e. for any $s \in \mathbb{R}$
$$\mathcal{L}_s \stackrel{\text { def. }}{=}{x ; f(x)=s} .$$

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代考|Gradient Descent

The gradient descent algorithm reads, starting with some $x_0 \in \mathbb{R}^p$
$$x_{k+1} \stackrel{\text { def. }}{=} x_k-\tau_k \nabla f\left(x_k\right)$$
where $\tau_k>0$ is the step size (also called learning rate). For a small enough $\tau_k$, the previous discussion shows that the function $f$ is decaying through the iteration. So intuitively, to ensure convergence, $\tau_k$ should be chosen small enough, but not too small so that the algorithm is as fast as possible. In general, one use a fix step size $\tau_k=\tau$, or try to adapt $\tau_k$ at each iteration (see Fig. 9).

Remark 4 (Greedy choice). Although this is in general too costly to perform exactly, one can use a “greedy” choice, where the step size is optimal at each iteration, i.e.
$$\tau_k \stackrel{\text { def. }}{=} \underset{\tau}{\operatorname{argmin}} h(\tau) \stackrel{\text { def. }}{=} f\left(x_k-\tau \nabla f\left(x_k\right)\right) .$$
Here $h(\tau)$ is a function of a single variable. One can compute the derivative of $h$ as
$$h(\tau+\delta)=f\left(x_k-\tau \nabla f\left(x_k\right)-\delta \nabla f\left(x_k\right)\right)=f\left(x_k-\tau \nabla f\left(x_k\right)\right)-\left\langle\nabla f\left(x_k-\tau \nabla f\left(x_k\right)\right), \nabla f\left(x_k\right)\right\rangle+o(\delta) .$$
One note that at $\tau=\tau_k, \nabla f\left(x_k-\tau \nabla f\left(x_k\right)\right)=\nabla f\left(x_{k+1}\right)$ by definition of $x_{k+1}$ in (13). Such an optimal $\tau=\tau_k$ is thus characterized by
$$h^{\prime}\left(\tau_k\right)=-\left\langle\nabla f\left(x_k\right), \nabla f\left(x_{k+1}\right)\right\rangle=0 .$$

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代 考|Steepest Descent Direction

$$f(z)=T_x(z)+o(|x-z|) \quad \text { where } \quad T_x(z) \stackrel{\text { def. }}{=} f(x)+\langle\nabla f(x), z-x\rangle,$$

$$\tau \in \mathbb{R}^{+}=[0,+\infty[\longmapsto f(x-\tau \nabla f(x)) \in \mathbb{R}$$

$$f(x-\tau \nabla f(x))=f(x)-\tau\langle\nabla f(x), \nabla f(x)\rangle+o(\tau)=f(x)-\tau|\nabla f(x)|^2+o(\tau) .$$

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代考|Gradient Descent

$$f(x-\tau \nabla f(x))s \stackrel{\text { def. }}{=} x ; f(x)=s .$$ # to |Gradient Descent 梯度下降算法读取，从一些开始 $x_0 \in \mathbb{R}^p$ $$x{k+1} \stackrel{\text { def. }}{=} x_k-\tau_k \nabla f\left(x_k\right)$$ 在哪里 $\tau_k>0$ 是步长 (也称为学习率) 。对于足够小的 $\tau_k$ ，前面的讨论表明函数 $f$ 通过迭代詚减。所以直觉上，为了确保收敛， $\tau_k$ 应该选择足够小，但又不能太小，以便算法层可能仜。一般来说，一个人使用固定的步长 $\tau_k=\tau$ ，或尝试适应 $\tau_k$ 在每次迭代中 (见图 9)。

$$\tau_k \stackrel{\text { def. }}{=} \underset{\tau}{\operatorname{argmin}} h(\tau) \stackrel{\text { def. }}{=} f\left(x_k-\tau \nabla f\left(x_k\right)\right) \text {. }$$

$$h(\tau+\delta)=f\left(x_k-\tau \nabla f\left(x_k\right)-\delta \nabla f\left(x_k\right)\right)=f\left(x_k-\tau \nabla f\left(x_k\right)\right)-\left\langle\nabla f\left(x_k-\tau \nabla f\left(x_k\right)\right), \nabla f\left(x_k\right)\right\rangle+o(\delta) .$$

$$h^{\prime}\left(\tau_k\right)=-\left\langle\nabla f\left(x_k\right), \nabla f\left(x_{k+1}\right)\right\rangle=0 .$$

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。

Posted on Categories:Optimization Theory, 优化理论, 优化理论代写, 数学代写, 机器学习代写, 机器学习代考

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代考|Convexity

Convex functions define the main class of functions which are somehow “simple” to optimize, in the sense that all minimizers are global minimizers, and that there are often efficient methods to find these minimizers (at least for smooth convex functions). A convex function is such that for any pair of point $(x, y) \in\left(\mathbb{R}^p\right)^2$,
$$\forall t \in[0,1], \quad f((1-t) x+t y) \leqslant(1-t) f(x)+t f(y)$$
which means that the function is below its secant (and actually also above its tangent when this is well defined), see Fig. 4. If $x^{\star}$ is a local minimizer of a convex $f$, then $x^{\star}$ is a global minimizer, i.e. $x^{\star} \in$ argmin $f$. Convex function are very convenient because they are stable under lots of transformation. In particular, if $f, g$ are convex and $a, b$ are positive, $a f+b g$ is convex (the set of convex function is itself an infinite dimensional convex cone!) and so is $\max (f, g)$. If $g: \mathbb{R}^q \rightarrow \mathbb{R}$ is convex and $B \in \mathbb{R}^{q \times p}, b \in \mathbb{R}^q$ then $f(x)=g(B x+b)$ is convex. This shows immediately that the square loss appearing in (3) is convex, since $|\cdot|^2 / 2$ is convex (as a sum of squares). Also, similarly, if $\ell$ and hence $L$ is convex, then the classification loss function (4) is itself convex.

Strict convexity. When $f$ is convex, one can strengthen the condition (5) and impose that the inequality is strict for $t \in] 0,1[$ (see Fig. 4, right), i.e.
$$\forall t \in] 0,1[, \quad f((1-t) x+t y)<(1-t) f(x)+t f(y) .$$
In this case, if a minimum $x^{\star}$ exists, then it is unique. Indeed, if $x_1^{\star} \neq x_2^{\star}$ were two different minimizer, one would have by strict convexity $f\left(\frac{x_1^{\star}+x_2^{\star}}{2}\right)<f\left(x_1^{\star}\right)$ which is impossible.
Example 2 (Least squares). For the quadratic loss function $f(x)=\frac{1}{2}|A x-y|^2$, strict convexity is equivalent to $\operatorname{ker}(A)={0}$. Indeed, we see later that its second derivative is $\partial^2 f(x)=A^{\top} A$ and that strict convexity is implied by the eigenvalues of $A^{\top} A$ being strictly positive. The eigenvalues of $A^{\top} A$ being positive, it is equivalent to $\operatorname{ker}\left(A^{\top} A\right)={0}$ (no vanishing eigenvalue), and $A^{\top} A z=0$ implies $\left\langle A^{\top} A z, z\right\rangle=|A z|^2=0$ i.e. $z \in \operatorname{ker}(A)$

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代考|Convex Sets

A set $\Omega \subset \mathbb{R}^p$ is said to be convex if for any $(x, y) \in \Omega^2,(1-t) x+t y \in \Omega$ for $t \in[0,1]$. The connexion between convex function and convex sets is that a function $f$ is convex if and only if its epigraph $\operatorname{epi}(f) \stackrel{\text { def. }}{=}\left{(x, t) \in \mathbb{R}^{p+1} ; t \geqslant f(x)\right}$ is a convex set.
Remark 1 (Convexity of the set of minimizers). In general, minimizers $x^{\star}$ might be non-unique, as shown on Figure 3. When $f$ is convex, the set argmin $(f)$ of minimizers is itself a convex set. Indeed, if $x_1^{\star}$ and $x_2^{\star}$ are minimizers, so that in particular $f\left(x_1^{\star}\right)=f\left(x_2^{\star}\right)=\min (f)$, then $f\left((1-t) x_1^{\star}+t x_2^{\star}\right) \leqslant(1-t) f\left(x_1^{\star}\right)+t f\left(x_2^{\star}\right)=$ $f\left(x_1^{\star}\right)=\min (f)$, so that $(1-t) x_1^{\star}+t x_2^{\star}$ is itself a minimizer. Figure 5 shows convex and non-convex sets.

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代 考|Convexity

$$\forall t \in[0,1], \quad f((1-t) x+t y) \leqslant(1-t) f(x)+t f(y)$$

$$\forall t \in] 0,1[, \quad f((1-t) x+t y)<(1-t) f(x)+t f(y) .$$

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代写|Convex Sets

$f\left((1-t) x_1^{\star}+t x_2^{\star}\right) \leqslant(1-t) f\left(x_1^{\star}\right)+t f\left(x_2^{\star}\right)=f\left(x_1^{\star}\right)=\min (f)$ ，以便 $(1-t) x_1^{\star}+t x_2^{\star}$ 本身就是一个最小化器。图 5

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。

Posted on Categories:Optimization Theory, 优化理论, 优化理论代写, 数学代写, 机器学习代写, 机器学习代考

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代考|Adaptive Stepsize

No general prescriptions for selecting appropriate learning rate; typically no fixed learning rate appropriate for entire learning period

“Bold driver” heuristic: monitor error after each epoch (sweep through entire training set)

1. If error decreases, increase learning rate: $\epsilon=\epsilon * \rho$
2. If error increases, decrease rate, reset parameters:
$$\epsilon=\epsilon * \sigma ; \quad \mathbf{w}^t=\mathbf{w}^{t-1}$$

Sensible choices for parameters: $\rho=1.1, \quad \sigma=0.5$

This is batch gradient descent

Momentum

If the error surface is a long and narrow valley, gradient descent goes quickly down the valley walls, but very slowly along the valley floor

We can alleviate this problem by updating parameters using a combination of the previous update and the gradient update:
$$\Delta w_j^t=\beta \Delta w^{t-1}+(1-\beta)\left(-\epsilon \partial E / \partial w_j\left(\mathbf{w}^t\right)\right)$$

Usually $\beta$ is set quite high, about $0.95$.

This is like giving momentum to the weights

## 数学代写|机器学习中的优化理论代写Optimization for Machine Learning代考|Mini-Batch and Online Optimization

When the dataset is large, computing the exact gradient is expensive

This seems wasteful since the only thing we use the gradient for is to compute a small change in the weights, then throw this out and recompute the gradient all over again

An approximate gradient is useful as long as it points in roughly the same direction as the true gradient

One easy way to do this is to divide the dataset into small batches of examples, compute the gradient using a single batch, make an update, then move to the next batch of examples: mini-batch optimization

In the limit, if each batch contains just one example, then this is the ‘online’ learning, or stochastic gradient descent mentioned in Lecture 2.

These methods are much faster than exact gradient descent, and are very effective when combined with momentum, but care must be taken to ensure convergence

Rather than take a fixed step in the direction of the negative gradient or the momentum-smoothed negative gradient, it is possible to do a search along that direction to find the minimum of the function

Usually the search is a bisection, which bounds the nearest local minimum along the line between any two points such that there is a third point $\mathbf{w}_3$ with $E\left(\mathbf{w}_3\right)<E\left(\mathbf{w}_1\right)$ and $E\left(\mathbf{w}_3\right)<E\left(\mathbf{w}_2\right)$

## 数学代写机器学习中的优化理论代写Optimization for Machine Learning代 考|Adaptive Stepsize

“Bold driver”启发式: 在每个 epoch 之后监控错误（扫描整个训线集）

$$\epsilon=\epsilon * \sigma ; \quad \mathbf{w}^t=\mathbf{w}^{t-1}$$

$$\Delta w_j^t=\beta \Delta w^{t-1}+(1-\beta)\left(-\epsilon \partial E / \partial w_j\left(\mathbf{w}^t\right)\right)$$

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。