# 计算机代写|机器学习代写Machine Learning代考|Free Energy

my-assignmentexpert™提供最专业的一站式服务：Essay代写，Dissertation代写，Assignment代写，Paper代写，Proposal代写，Proposal代写，Literature Review代写，Online Course，Exam代考等等。my-assignmentexpert™专注为留学生提供Essay代写服务，拥有各个专业的博硕教师团队帮您代写，免费修改及辅导，保证成果完成的效率和质量。同时有多家检测平台帐号，包括Turnitin高级账户，检测论文不会留痕，写好后检测修改，放心可靠，经得起任何考验！

## 计算机代写|机器学习代写Machine Learning代考|Free Energy

EM can be viewed as optimizing the model parameters $\theta$ together with the distribution $\xi$. The Free Energy for a Hidden Markov Model is:
\begin{aligned} F(\theta, \xi)= & -\sum_i \gamma_1(i) \ln a_i-\sum_{i, j} \sum_{t=1}^{T-1} \xi_t(i, j) \ln A_{i j}-\sum_i \sum_{t=1}^T \gamma_t(i) \ln p\left(\mathbf{y}t \mid s_t=i\right) \ & +\sum{i, j} \sum_{t=1}^{T-1} \xi_t(i, j) \ln \xi_t(i, j)-\sum_i \sum_{t=2}^{T-2} \gamma_t(i) \ln \gamma_t(i) \end{aligned}
where $\gamma$ is defined as a function of $\xi$ as:
$$\gamma_t(i)=\sum_k \xi_t(i, k)=\sum_k \xi_{t-1}(k, i)$$
Warning! Since we weren’t able to find any formula for the free energy, we derived it from scratch (see below). In our tests, it didn’t precisely match the negative log-likelihood. So there might be a mistake here, although the free energy did decrease as expected.

Derivation. This material is very advanced and not required for the course. It is mainly here because we couldn’t find it elsewhere.

As a short-hand, we define $\mathbf{s}=s_{1: T}$ to be a variable representing an entire state sequence. The likelihood of a data sequence is:
$$p\left(\mathbf{y}{1: T}\right)=\sum{\mathbf{s}} p\left(\mathbf{y}_{1: T}, \mathbf{s}\right)$$
where the summation is over all possible state sequences.

## 计算机代写|机器学习代写Machine Learning代考|Most likely state sequences

Suppose we wanted to computed the most likely states $s_t$ for each time in a sequence. There are two ways that we might do it: we could take the most likely state sequence:
$$s_{1: T}^=\arg \max {s{1: T}} p\left(s_{1: T} \mid \mathbf{y}{1: T}\right)$$ or we could take the sequence of most-likely states: $$s_t^=\arg \max {s_t} p\left(s_t \mid \mathbf{y}{1: T}\right)$$ While these sequences may often be similar, they can be different as well. For example, it is possible that the most likely states for two consecutive time-steps do not have a valid transition between them, i.e., if $s_t^=i$ and $s{t+1}^=j$, it is possible (though unlikely) that $A_{i j}=0$. This illustrates that these two ways to create sequences of states answer two different questions: what sequence is jointly most likely? And, for each time-step, what is the most likely state just for that time-step?

Suppose we are given $N$ training vectors $\left{\left(\mathbf{x}_i, y_i\right)\right}$, where $\mathbf{x} \in \mathbb{R}^D, y \in{-1,1}$. We want to learn a classifier
$$f(\mathbf{x})=\mathbf{w}^T \phi(\mathbf{x})+b$$
so that the classifier’s output for a new $\mathbf{x}$ is $\operatorname{sign}(f(\mathbf{x}))$.
Suppose that our training data are linearly-separable in the feature space $\phi(\mathbf{x})$, i.e., as illustrated in Figure 32, the two classes of training exemplars are sufficiently well separated in the feature space that one can draw a hyperplane between them (e.g., a line in 2D, or plane in 3D). If they are linearly separable then in almost all cases there will be many possible choices for the linear decision boundary, each one of which will produce no classification errors on the training data. Which one should we choose? If we place the boundary very close to some of the data, there seems to be a greater danger that we will misclassify some data, especially when the training data are alsmot certainy noisy.

This motivates the idea of placing the boundary to maximize the margin, that is, the distance from the hyperplane to the closest data point in either class. This can be thought of having the largest “margin for error” – if you are driving a fast car between a scattered set of obstacles, it’s safest to find a path that stays as far from them as possible.

## 计算机代写|机器学习代写MACHINE LEARNING代考|FREE ENERGY

$E M$ 可以看作是优化模型参数 $\theta$ 连同分布 $\xi$. 隐马尔可夫模型的自由能是:
$$F(\theta, \xi)=-\sum_i \gamma_1(i) \ln a_i-\sum_{i, j} \sum_{t=1}^{T-1} \xi_t(i, j) \ln A_{i j}-\sum_i \sum_{t=1}^T \gamma_t(i) \ln p\left(\mathbf{y} t \mid s_t=i\right) \quad+\sum i, j \sum_{t=1}^{T-1} \xi_t(i, j) \ln \xi_t(i, j)-\sum_i \sum_{t=2}^{T-2} \gamma_t(i) \ln \gamma_t(i)$$

$$\gamma_t(i)=\sum_k \xi_t(i, k)=\sum_k \xi_{t-1}(k, i)$$

$$p(\mathbf{y} 1: T)=\sum \mathbf{s} p\left(\mathbf{y}_{1: T}, \mathbf{s}\right)$$

## 计算机代写|机器学习代写MACHINE LEARNING代考|MOST LIKELY STATE SEQUENCES

$$s_{1: T}^{=} \arg \max s 1: T p\left(s_{1: T} \mid \mathbf{y} 1: T\right)$$

$$s_t^{=} \arg \max s_t p\left(s_t \mid \mathbf{y} 1: T\right)$$

$$f(\mathbf{x})=\mathbf{w}^T \phi(\mathbf{x})+b$$

## Matlab代写

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