Skip to content

Commit

Permalink
documents update
Browse files Browse the repository at this point in the history
  • Loading branch information
qiauil committed Aug 21, 2024
1 parent f9281b0 commit d2cba5e
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 25 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</h1>
<h4 align="center">Official implementation of Conflict-Free Inverse Gradients Method</h4>
<h6 align="center">Towards Conflict-free Training for everything!</h6>
<h6 align="center">Towards Conflict-free Training for Everything and Everyone!</h6>

<p align="center">
[<a href="https://arxiv.org/abs/2312.05320">📄 Research Paper</a>][<a href="https://tum-pbs.github.io/ConFIG/">📖 Documentation & Examples</a>]
Expand All @@ -14,7 +14,7 @@

* **What is the ConFIG method?**

​ The conFIG method is a generic method for optimization problems involving **multiple loss terms** (e.g., Multi-task Learning, Continuous Learning, and Physics Informed Neural Networks). It prevents the optimization from getting stuck into a local minimum of a specific loss term due to the conflict between losses. On the contrary, it leads the optimization to the **shared minimal of all losses** by providing a **conflict-free update direction.**
​ The conFIG method is a generic method for optimization problems involving **multiple loss terms** (e.g., Multi-task Learning, Continuous Learning, and Physics Informed Neural Networks). It prevents the optimization from getting stuck into a local minimum of a specific loss term due to the conflict between losses. On the contrary, it leads the optimization to the **shared minimum of all losses** by providing a **conflict-free update direction.**

<p align="center">
<img src="docs/assets/config_illustration.png" style="zoom: 33%;" />
Expand All @@ -35,7 +35,7 @@

Then the dot product between $\boldsymbol{g}_{ConFIG}$ and each loss-specific gradient is always positive and equal, i.e., $`\boldsymbol{g}_{i}^{\top}\boldsymbol{g}_{ConFIG}=\boldsymbol{g}_{j}^{\top}\boldsymbol{g}_{ConFIG}> 0 \quad \forall i,j \in [1,m]`$​.

* **Is the ConFIG Computationally expensive?**
* **Is the ConFIG computationally expensive?**

​ Like many other gradient-based methods, ConFIG needs to calculate each loss's gradient in every optimization iteration, which could be computationally expensive when the number of losses increases. However, we also introduce a **momentum-based method** where we can reduce the computational cost **close to or even lower than a standard optimization procedure** with a slight degeneration in accuracy. This momentum-based method is also applied to another gradient-based method.

Expand Down
Binary file added docs/assets/config_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions docs/assets/config_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
122 changes: 122 additions & 0 deletions docs/assets/download.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions docs/examples/mtl_toy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
"\n",
"Here, we would like to show a classic and interesting toy example of multi-task learning (MTL). \n",
"\n",
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/tum-pbs/ConFIG/blob/main/docs/examples/mtl_toy.ipynb\">\n",
" <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tum-pbs/ConFIG/blob/main/docs/examples/mtl_toy.ipynb)\n",
"[![Open Locally](../assets/download.svg)](https://github.com/tum-pbs/ConFIG/blob/main/docs/examples/mtl_toy.ipynb)\n",
"\n",
"In this example, there are two tasks represented by two loss functions, which are"
]
Expand Down Expand Up @@ -439,7 +438,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The results are similar to ConFIG, but it needs more iterations to converge. You may notice that we give an additional 1000 optimization iterations for the momentum version. This is because we only update a single gradient direction every iteration, so it usually requires more iterations to get a similar or better performance than the ConFIG method. You can have a try by yourself to see the optimization trajectory. The acceleration of the momentum version is not so significant in this case since the backpropagation of gradients is not the main bottleneck of the optimization."
"The results are similar to ConFIG, but it needs more iterations to converge. You may notice that we give an additional 1000 optimization iterations for the momentum version. This is because we only update a single gradient direction every iteration, so it usually requires more iterations to get a similar or better performance than the ConFIG method. You can have a try by yourself to see the optimization trajectory. The acceleration of the momentum version is not so significant in this case since the backpropagation of gradients is not the main bottleneck of the optimization.\n",
"\n",
"Click [here](https://github.com/tum-pbs/ConFIG/tree/main/experiments/MTL) to have a check in the MTL experiment in our research paper."
]
}
],
Expand Down
9 changes: 5 additions & 4 deletions docs/examples/pinn_burgers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
"\n",
"In this example, we would like to show you another example of how to use ConFIG method to train a physics informed neural network (PINN) for solving a PDE. \n",
"\n",
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/tum-pbs/ConFIG/blob/main/docs/examples/pinn_burgers.ipynb\">\n",
" <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tum-pbs/ConFIG/blob/main/docs/examples/pinn_burgers.ipynb)\n",
"[![Open Locally](../assets/download.svg)](https://github.com/tum-pbs/ConFIG/blob/main/docs/examples/pinn_burgers.ipynb)\n",
"\n",
"In this example, we will solve the 1D Burgers' equation:\n",
"\n",
Expand Down Expand Up @@ -471,7 +470,9 @@
"id": "bb56fffe",
"metadata": {},
"source": [
"As the result shows, both the training speed and test accuracy are improved by using the momentum version of the ConFIG method. Please note that the momentum version does not always guarantee a better performance than the non-momentum version. The main feature of the momentum version is the acceleration, as it only requires a single gradient update in each iteration. We usually will just give the momentum version more training epochs to improve the performance further."
"As the result shows, both the training speed and test accuracy are improved by using the momentum version of the ConFIG method. Please note that the momentum version does not always guarantee a better performance than the non-momentum version. The main feature of the momentum version is the acceleration, as it only requires a single gradient update in each iteration. We usually will just give the momentum version more training epochs to improve the performance further.\n",
"\n",
"Click [here](https://github.com/tum-pbs/ConFIG/tree/main/experiments/PINN) to have a check in the PINN experiment in our research paper."
]
}
],
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ hide:
<p align="center">
<img src="./assets/config.png" width="400"/>
</p>
<h4 align="center">Towards Conflict-free Training for everything!</h4>
<h4 align="center">Towards Conflict-free Training for Everything and Everyone!</h4>

<p align="center">
[ <a href="https://arxiv.org/abs/2312.05320">📄 Research Paper</a> ][ <a href="https://github.com/tum-pbs/ConFIG"><img src="./assets/github.svg" width="16"> GitHub Repository</a> ]
Expand All @@ -20,7 +20,7 @@ hide:

* **What is the ConFIG method?**

​ The conFIG method is a generic method for optimization problems involving **multiple loss terms** (e.g., Multi-task Learning, Continuous Learning, and Physics Informed Neural Networks). It prevents the optimization from getting stuck into a local minimum of a specific loss term due to the conflict between losses. On the contrary, it leads the optimization to the **shared minimal of all losses** by providing a **conflict-free update direction.**
​ The conFIG method is a generic method for optimization problems involving **multiple loss terms** (e.g., Multi-task Learning, Continuous Learning, and Physics Informed Neural Networks). It prevents the optimization from getting stuck into a local minimum of a specific loss term due to the conflict between losses. On the contrary, it leads the optimization to the **shared minimum of all losses** by providing a **conflict-free update direction.**

<p align="center">
<img src="./assets/config_illustration.png" style="zoom: 33%;" />
Expand All @@ -41,7 +41,7 @@ $$

Then the dot product between $\mathbf{g}_{ConFIG}$ and each loss-specific gradient is always positive and equal, i.e., $\mathbf{g}_{i}^{\top}\mathbf{g}_{ConFIG}=\mathbf{g}_{j}^{\top}\mathbf{g}_{ConFIG} > 0 \quad \forall i,j \in [1,m]$​.

* **Is the ConFIG Computationally expensive?**
* **Is the ConFIG computationally expensive?**

​ Like many other gradient-based methods, ConFIG needs to calculate each loss's gradient in every optimization iteration, which could be computationally expensive when the number of losses increases. However, we also introduce a **momentum-based method** where we can reduce the computational cost **close to or even lower than a standard optimization procedure** with a slight degeneration in accuracy. This momentum-based method is also applied to another gradient-based method.

Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ theme:
- toc.integrate # Table of contents is integrated on the left; does not appear separately on the right.
- header.autohide # header disappears as you scroll
- navigation.top
- navigation.footer
palette:
- scheme: default
primary: brown
Expand All @@ -30,7 +31,7 @@ theme:
name: Switch to light mode
icon:
repo: fontawesome/brands/github # GitHub logo in top right
logo: assets/config_white.svg
logo: assets/config_white.png
favicon: assets/config_colorful.svg

extra:
Expand Down

0 comments on commit d2cba5e

Please sign in to comment.