Skip to content

Commit

Permalink
Fix some content mistakes of custom alg and pro.
Browse files Browse the repository at this point in the history
  • Loading branch information
XU-Boqing committed Jan 11, 2025
1 parent 35b8960 commit f4f04de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/guide/developer/3-custom-alg-pro.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Generate the initial population
Do
Compute fitness
Update the local best and the global best
Update the local best fitness and the global best fitness
Update the velocity
Update the population
Expand All @@ -80,7 +80,7 @@ Until stopping criterion

And here is what each part of the algorithm and the problem corresponds to in EvoX.

```python
```text
Set hyper-parameters # Algorithm.__init__
Generate the initial population # Algorithm.setup
Expand All @@ -89,7 +89,7 @@ Do
Compute fitness
# Algorithm.step
Update the local best and the global best
Update the local best fitness and the global best fitness
Update the velocity
Update the population
Expand Down Expand Up @@ -152,7 +152,7 @@ class PSO(Algorithm):
# Compute fitness
fitness = self.evaluate(self.population)

# Update the local best and the global best
# Update the local best fitness and the global best fitness
compare = self.local_best_fitness - fitness
self.local_best_location = torch.where(
compare[:, None] > 0, self.population, self.local_best_location
Expand Down

0 comments on commit f4f04de

Please sign in to comment.