Skip to content

Commit d62696a

Browse files
committed
Add figure caption
1 parent 95cc09d commit d62696a

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

docs/source/locale/zh_CN/tutorial/tutorial_part7.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ f(\mathbf{x}) = 10 d + \sum_{i=1}^{d}[x_i^2 - 10 \cos{(2\pi x_i)}],
1414

1515
其中$\mathbf{x} \in \mathbb{R}^d$, $d$为该函数的维数。Rastrigin 函数的全局最优值为$0$,出现在原点。为了清晰地展示该函数具有多个局部极值点的性质,我们绘制了二维 Rastrigin 函数的图像。
1616

17-
![Rastrigin Function](/_static/rastrigin_function.svg)
17+
```{figure} /_static/rastrigin_function.svg
18+
:alt: A plot of the Rastrigin function
19+
:figwidth: 70%
20+
:align: center
21+
22+
Rastrigin 函数
23+
```
1824

1925
在本案例中,我们将使用粒子群优化(PSO)算法在十维 Rastrigin 函数上寻优。
2026

@@ -212,7 +218,13 @@ plt.show()
212218

213219
我们可以得到多次迭代后的种群分布情况,实验结果同样符合我们的预期:
214220

215-
![Example NSGA-II Population](/_static/example_nsga2_result.svg)
221+
```{figure} /_static/example_nsga2_result.svg
222+
:alt: A plot of the NSGA-II population
223+
:figwidth: 70%
224+
:align: center
225+
226+
NSGA-II算法优化后的种群分布
227+
```
216228

217229
同时,在 JupyterNotebook 中,您还可以通过 EvoX 的可视化模块直接得到动态的实验结果,您可以直观地看到种群是如何随着算法的迭代更新的。为了实现这一目标,您只需要运行一行代码:
218230

docs/source/tutorial/tutorial_part7.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ f(\mathbf{x}) = 10 d + \sum_{i=1}^{d}[x_i^2 - 10 \cos{(2\pi x_i)}],
1414

1515
where $\mathbf{x} \in \mathbb{R}^d$ and $d$ is the dimensionality. The global optimum is 0 at the origin. The function is highly multimodal, making it ideal for testing global optimization algorithms. Here's a plot of the Rastrigin function
1616

17-
![Rastrigin Function](/_static/rastrigin_function.svg)
17+
```{figure} /_static/rastrigin_function.svg
18+
:alt: A plot of the Rastrigin function
19+
:figwidth: 70%
20+
:align: center
21+
22+
Rastrigin function
23+
```
1824

1925
In this example, we will use the Particle Swarm Optimization (PSO) algorithm to optimize the 10-dimensional Rastrigin function.
2026

@@ -185,7 +191,13 @@ plt.show()
185191

186192
We can visualize the results using Matplotlib. The blue points represent the optimized population, while the red line shows the Pareto front.
187193

188-
![Example NSGA-II Population](/_static/example_nsga2_result.svg)
194+
```{figure} /_static/example_nsga2_result.svg
195+
:alt: A plot of the NSGA-II population
196+
:figwidth: 70%
197+
:align: center
198+
199+
A plot of the NSGA-II population after optimization
200+
```
189201

190202
In Jupyter Notebook, you can use EvoX's built-in plotting capabilities to visualize the optimization process and monitor how the population evolves over generations.
191203

0 commit comments

Comments
 (0)