Compare commits
27 Commits
2ad67a3625
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e9c616993 | |||
| ae243c1346 | |||
|
e0ef470c3e
|
|||
|
bc77ff5740
|
|||
|
cebd07759c
|
|||
|
e0143d5c9f
|
|||
|
cabdb4fc97
|
|||
|
234455d41d
|
|||
|
7baa556800
|
|||
|
067db624fb
|
|||
|
7545b870c9
|
|||
|
fdcbfa6e4a
|
|||
|
b307aa2786
|
|||
|
4b399a2ee9
|
|||
| d9deda7086 | |||
|
494b976aa5
|
|||
|
a767519b5e
|
|||
| 0dac68f88d | |||
|
f8855d282f
|
|||
|
668b42a2a6
|
|||
|
9aaa606b69
|
|||
|
efdcacd418
|
|||
|
78b364582a
|
|||
|
f7dfdd101d
|
|||
|
4c64230a6f
|
|||
|
548b052c42
|
|||
|
6d4113a407
|
@ -1,4 +1,5 @@
|
||||
\documentclass[11pt]{ainotes}
|
||||
\usepackage{appendix}
|
||||
|
||||
\title{Distributed Autonomous Systems}
|
||||
\date{2024 -- 2025}
|
||||
@ -43,16 +44,25 @@
|
||||
\def\v{{\vec{v}}}
|
||||
\def\r{{\vec{r}}}
|
||||
\def\s{{\vec{s}}}
|
||||
\def\u{{\vec{u}}}
|
||||
\def\D{\ensuremath{\mathcal{D}}}
|
||||
\def\A{{\matr{A}}}
|
||||
\def\w{{\vec{w}}}
|
||||
\def\R{\ensuremath{\mathbb{R}}}
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\makenotesfront
|
||||
\include{./sections/_graphs.tex}
|
||||
\include{./sections/_averaging_systems.tex}
|
||||
\include{./sections/_containment.tex}
|
||||
\include{./sections/_optimization.tex}
|
||||
\include{./sections/_formation_control.tex}
|
||||
\include{./sections/_cooperative_robotics.tex}
|
||||
\input{./sections/_graphs.tex}
|
||||
\input{./sections/_averaging_systems.tex}
|
||||
\input{./sections/_containment.tex}
|
||||
\input{./sections/_optimization.tex}
|
||||
\input{./sections/_formation_control.tex}
|
||||
\input{./sections/_cooperative_robotics.tex}
|
||||
\input{./sections/_safety_controllers.tex}
|
||||
\input{./sections/_feedback_optimization.tex}
|
||||
\input{./sections/_neural_networks.tex}
|
||||
\eoc
|
||||
|
||||
\end{document}
|
||||
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 21 KiB |
BIN
src/year2/distributed-autonomous-systems/img/gershgorin.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
src/year2/distributed-autonomous-systems/img/gershgorin_unit.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
src/year2/distributed-autonomous-systems/img/safety_control.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 25 KiB |
BIN
src/year2/distributed-autonomous-systems/img/unicycle_model.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
@ -103,42 +103,42 @@
|
||||
\]
|
||||
where $\tilde{w}_i = \frac{w_i}{\sum_{i=j}^N w_j}$ are all normalized and sum to 1 (i.e., they produce a convex combination).
|
||||
|
||||
Moreover, if $\matr{A}$ is doubly stochastic, then it holds that the consensus is the average:
|
||||
Moreover, if $\matr{A}$ is doubly stochastic, then it holds that the consensus is the average as $\vec{w} = 1$:
|
||||
\[
|
||||
\lim_{k \rightarrow \infty} \vec{x}^k = \vec{1} \frac{1}{N} \sum_{i=1}^N x_i^0
|
||||
\]
|
||||
|
||||
\begin{proof}[Sketch of proof]
|
||||
Let $\matr{T} = \begin{bmatrix} \vec{1} & \vec{v}^2 & \cdots & \vec{v}^N \end{bmatrix}$ be a change in coordinates that transforms an adjacency matrix into its Jordan form $\matr{J}$:
|
||||
\[ \matr{J} = \matr{T}^{-1} \matr{A} \matr{T} \]
|
||||
As $\lambda=1$ is a simple eigenvalue (\Cref{th:strongly_connected_eigenvalues}), it holds that:
|
||||
\[
|
||||
\matr{J} = \begin{bmatrix}
|
||||
1 & 0 & \cdots & 0 \\
|
||||
0 & & & \\
|
||||
\vdots & & \matr{J}_2 & \\
|
||||
0 & & & \\
|
||||
\end{bmatrix}
|
||||
\]
|
||||
where the eigenvalues of $\matr{J}_2 \in \mathbb{R}^{(N-1) \times (N-1)}$ lie inside the open unit disk.
|
||||
% \begin{proof}[Sketch of proof]
|
||||
% Let $\matr{T} = \begin{bmatrix} \vec{1} & \vec{v}^2 & \cdots & \vec{v}^N \end{bmatrix}$ be a change in coordinates that transforms an adjacency matrix into its Jordan form $\matr{J}$:
|
||||
% \[ \matr{J} = \matr{T}^{-1} \matr{A} \matr{T} \]
|
||||
% As $\lambda=1$ is a simple eigenvalue (\Cref{th:strongly_connected_eigenvalues}), it holds that:
|
||||
% \[
|
||||
% \matr{J} = \begin{bmatrix}
|
||||
% 1 & 0 & \cdots & 0 \\
|
||||
% 0 & & & \\
|
||||
% \vdots & & \matr{J}_2 & \\
|
||||
% 0 & & & \\
|
||||
% \end{bmatrix}
|
||||
% \]
|
||||
% where the eigenvalues of $\matr{J}_2 \in \mathbb{R}^{(N-1) \times (N-1)}$ lie inside the open unit disk.
|
||||
|
||||
Let $\vec{x}^k = \matr{T}\bar{\vec{x}}^k$, then we have that:
|
||||
\[
|
||||
\begin{split}
|
||||
&\vec{x}^{k+1} = \matr{A} \vec{x}^{k} \\
|
||||
&\iff \matr{T} \bar{\vec{x}}^{k+1} = \matr{A} (\matr{T} \bar{\vec{x}}^k) \\
|
||||
&\iff \bar{\vec{x}}^{k+1} = \matr{T}^{-1} \matr{A} (\matr{T} \bar{\vec{x}}^k) = \matr{J}\bar{\vec{x}}^k
|
||||
\end{split}
|
||||
\]
|
||||
Therefore:
|
||||
\[
|
||||
\begin{gathered}
|
||||
\lim_{k \rightarrow \infty} \bar{\vec{x}}^k = \bar{x}_1^0 \begin{bmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{bmatrix} \\
|
||||
\bar{x}_1^{k+1} = \bar{x}_1^k \quad \forall k \geq 0 \\
|
||||
\lim_{k \rightarrow \infty} \bar{x}_i^{k} = 0 \quad \forall i = 2, \dots, N \\
|
||||
\end{gathered}
|
||||
\]
|
||||
\end{proof}
|
||||
% Let $\vec{x}^k = \matr{T}\bar{\vec{x}}^k$, then we have that:
|
||||
% \[
|
||||
% \begin{split}
|
||||
% &\vec{x}^{k+1} = \matr{A} \vec{x}^{k} \\
|
||||
% &\iff \matr{T} \bar{\vec{x}}^{k+1} = \matr{A} (\matr{T} \bar{\vec{x}}^k) \\
|
||||
% &\iff \bar{\vec{x}}^{k+1} = \matr{T}^{-1} \matr{A} (\matr{T} \bar{\vec{x}}^k) = \matr{J}\bar{\vec{x}}^k
|
||||
% \end{split}
|
||||
% \]
|
||||
% Therefore:
|
||||
% \[
|
||||
% \begin{gathered}
|
||||
% \lim_{k \rightarrow \infty} \bar{\vec{x}}^k = \bar{x}_1^0 \begin{bmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{bmatrix} \\
|
||||
% \bar{x}_1^{k+1} = \bar{x}_1^k \quad \forall k \geq 0 \\
|
||||
% \lim_{k \rightarrow \infty} \bar{x}_i^{k} = 0 \quad \forall i = 2, \dots, N \\
|
||||
% \end{gathered}
|
||||
% \]
|
||||
% \end{proof}
|
||||
\end{theorem}
|
||||
|
||||
\begin{example}[Metropolis-Hasting weights]
|
||||
@ -228,7 +228,7 @@
|
||||
with states $x_i \in \mathbb{R}$, inputs $u_i \in \mathbb{R}$, and communication following a digraph $G$.
|
||||
|
||||
\item[Laplacian dynamics system] \marginnote{Laplacian dynamics system}
|
||||
Consider a network of dynamic systems where $u_i$ is defined as a proportional controller (i.e., only communicating $(i, j)$ have a non-zero weight $a_{ij}$):
|
||||
Consider a network of dynamic systems where $u_i$ is defined as a proportional controller (i.e., only communicating $(i, j)$ have a non-zero weight):
|
||||
\[
|
||||
\begin{split}
|
||||
u_i(t)
|
||||
@ -337,4 +337,377 @@
|
||||
|
||||
\begin{remark}
|
||||
The result also holds for unweighted digraphs as $\vec{1}$ is both a left and right eigenvector of $\matr{L}$.
|
||||
\end{remark}
|
||||
\end{remark}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\begin{subappendices}
|
||||
|
||||
\section{Appendix: Discrete time averaging system consensus proof}
|
||||
|
||||
% \begin{remark}
|
||||
% The distributed consensus algorithm is a positive system (i.e., $\matr{A}$ is positive).
|
||||
% \end{remark}
|
||||
|
||||
\begin{description}
|
||||
\item[Positive matrix characterization]
|
||||
Given $\A \in \mathbb{R}^{N \times N}$, it can be:
|
||||
\begin{description}
|
||||
\item[Non-negative] \marginnote{Non-negative matrix}
|
||||
$\A \geq 0$.
|
||||
\item[Irreducible] \marginnote{Irreducible matrix}
|
||||
$\sum_{h=0}^{N-1} \A^h > 0$.
|
||||
\item[Primitive] \marginnote{Primitive matrix}
|
||||
$\exists h \in \{ 1, \dots, N \}: A^h > 0$.
|
||||
% \begin{remark}
|
||||
% A graph with a primitive adjacency matrix is connected.
|
||||
% \end{remark}
|
||||
\item[Positive] \marginnote{Positive matrix}
|
||||
$\A > 0$.
|
||||
\end{description}
|
||||
\end{description}
|
||||
|
||||
|
||||
% Equilibrium:
|
||||
% \[
|
||||
% \x^{k+1} = \matr{A}\x^k
|
||||
% \]
|
||||
% \[
|
||||
% \begin{split}
|
||||
% \x_\text{eq} = \matr{A} \x_\text{eq} \\
|
||||
% \iff (\matr{I} - \matr{A}) \x_\text{eq} = 0
|
||||
% \end{split}
|
||||
% \]
|
||||
% We are interested in the null space of $(\matr{I} - \matr{A})$ (at least one eigenvector).
|
||||
|
||||
|
||||
|
||||
\begin{theorem} \label{th:positive_matrix_digraph_connected}
|
||||
Given a weighted digraph $G$ with $N \geq 2$ nodes and adjacency matrix $\A$, it holds that:
|
||||
\begin{itemize}
|
||||
\item $\A$ is irreducible $\iff$ $G$ is strongly connected.
|
||||
\item $\A$ is primitive $\iff$ $G$ is strongly connected and aperiodic.
|
||||
\end{itemize}
|
||||
\end{theorem}
|
||||
|
||||
|
||||
|
||||
\begin{theorem}[Gershgorin] \label{th:gershgorin} \marginnote{Gershgorin theorem}
|
||||
For any square matrix $\A \in \mathbb{C}^{N \times N}$, it holds that the spectrum of $\A$ (i.e., set of eigenvalues) is contained in the Gershgorin disks:
|
||||
\[
|
||||
\text{spec}(\A) \subset \bigcup_{i=1}^{N} \left\{ s \in \mathbb{C} \,\,\bigg|\,\, |s - a_{ii}| \leq \sum_{j=1, j \neq i}^{N} |a_{ij}| \right\}
|
||||
\]
|
||||
In other words, it is the union of the disks with center $a_{ii}$ and radius $\sum_{j=1, j \neq i}^{N} |a_{ij}|$.
|
||||
|
||||
\indenttbox
|
||||
\begin{remark}
|
||||
This theorem provides an approximate location of the eigenvalues.
|
||||
\end{remark}
|
||||
|
||||
\indenttbox
|
||||
\begin{example}
|
||||
Consider the matrix:
|
||||
\[
|
||||
\begin{bmatrix}
|
||||
10 & 1 & 0 & 1 \\
|
||||
0.2 & 8 & 0.2 & 0.2 \\
|
||||
1 & 1 & 2 & 1 \\
|
||||
-1 & -1 & -1 & -11
|
||||
\end{bmatrix}
|
||||
\]
|
||||
|
||||
Its eigenvalues are $\{ -10.870, 1.906, 7.918, 10.046 \}$.
|
||||
|
||||
The Gershgorin disks are:
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.4\linewidth]{./img/gershgorin.png}
|
||||
\end{figure}
|
||||
\end{example}
|
||||
\end{theorem}
|
||||
|
||||
% \begin{lemma}
|
||||
% If all the disks are within the unit disk, the eigenvalues are stable.
|
||||
% \[
|
||||
% \begin{bmatrix}
|
||||
% \frac{1}{2} & \frac{1}{2} & 0 \\
|
||||
% \frac{1}{3} & \frac{1}{3} & \frac{1}{3} \\
|
||||
% 0 & \frac{3}{4} & \frac{1}{4}
|
||||
% \end{bmatrix}
|
||||
% \]
|
||||
% \end{lemma}
|
||||
|
||||
|
||||
\begin{theorem}[Perron-Frobenius] \label{th:perron_frobenius} \marginnote{Perron-Frobenius theorem}
|
||||
Let $\A \in \R^{N \times N}$ with $N \geq 2$ be a non-negative matrix. It holds that:
|
||||
\begin{itemize}
|
||||
\item There exists a real eigenvalue $\lambda \geq 0$ that is dominant for all the other eigenvalues $\mu \in \text{spec}(\A) \smallsetminus \{\lambda\}$ (i.e., $\lambda \geq |\mu|$),
|
||||
\item The right eigenvector $\v \in \R^N$ and left eigenvector $\w \in \R^N$ associated to $\lambda$ can be chosen to be non-negative.
|
||||
\end{itemize}
|
||||
If $\A \in \R^{N \times N}$ is irreducible, then:
|
||||
\begin{itemize}
|
||||
\item The eigenvalue $\lambda$ is strictly positive ($\lambda > 0$) and simple.
|
||||
\item The right and left eigenvalues $\v$ and $\w$ associated to $\lambda$ are unique and positive.
|
||||
\end{itemize}
|
||||
If $\A \in \R^{N \times N}$ is primitive, then:
|
||||
\begin{itemize}
|
||||
\item The eigenvalue $\lambda$ is strictly dominant for all $\mu \in \text{spec}(\A) \smallsetminus \{\lambda\}$ (i.e., $\lambda > |\mu|$).
|
||||
\end{itemize}
|
||||
\end{theorem}
|
||||
|
||||
\begin{lemma} \label{th:row_stochastic_unit_disk}
|
||||
Given a row stochastic matrix $\A$, it holds that:
|
||||
\begin{itemize}
|
||||
\item $\lambda=1$ is an eigenvalue,
|
||||
\item By \hyperref[th:gershgorin]{Gershgorin Theorem}, $\text{spec}(\A)$ is a subset of the unit disk (i.e., all Gershgorin disks lie inside the unit disk).
|
||||
\end{itemize}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.2\linewidth]{./img/gershgorin_unit.png}
|
||||
\end{figure}
|
||||
|
||||
\indenttbox
|
||||
\begin{corollary}
|
||||
The eigenvalue $\lambda=1 \geq |\mu|$ is dominant.
|
||||
\end{corollary}
|
||||
\end{lemma}
|
||||
|
||||
\begin{lemma}
|
||||
Given a row stochastic and primitive matrix $\A$, by \Cref{th:row_stochastic_unit_disk} and \hyperref[th:perron_frobenius]{Perron-Frobenius Theorem} it holds that $\lambda = 1$ is simple and strictly dominant.
|
||||
|
||||
\indenttbox
|
||||
\begin{corollary}
|
||||
The consensus averaging system is marginally stable (i.e., converges but not necessarily to the origin) as the largest distinct eigenvalue is $\lambda = 1$.
|
||||
\end{corollary}
|
||||
\end{lemma}
|
||||
|
||||
|
||||
% \begin{lemma}
|
||||
% \[
|
||||
% \x_\text{eq} = ker(\matr{I} - \A) = \{ \vec{1}\beta \mid \beta \in \R \}
|
||||
% \]
|
||||
|
||||
% \[
|
||||
% \w^T \x^{k+1} = \w^T(\A \x^{k}) = \w^T \x^k
|
||||
% \]
|
||||
% i.e., $\w$ is left eigenvector of $\A$ with $\lambda = 1$.
|
||||
|
||||
% Therefore, the above must be true for:
|
||||
% \[
|
||||
% \begin{split}
|
||||
% \w^T \x_\text{eq} \\
|
||||
% \w^T \x^{0} \\
|
||||
% \end{split}
|
||||
% \]
|
||||
% \[
|
||||
% \w^T \vec{1}\beta \Rightarrow \beta = \frac{\w^T\x^{0}}{\w^T\vec{1}}
|
||||
% \]
|
||||
% \end{lemma}
|
||||
|
||||
\begin{theorem}[Discrete-time consensus] \marginnote{Discrete-time consensus}
|
||||
Consider a discrete-time averaging system with digraph $G$ and weighted adjacency matrix $\matr{A}$. Assume $G$ strongly connected and aperiodic, and $\matr{A}$ row stochastic.
|
||||
|
||||
It holds that there exists a left eigenvector $\vec{w} \in \mathbb{R}^N$, $\vec{w} > 0$ such that the consensus converges to:
|
||||
\[
|
||||
\lim_{k \rightarrow \infty} \vec{x}^k
|
||||
= \vec{1}\frac{\vec{w}^T \vec{x}^0}{\vec{w}^T\vec{1}}
|
||||
= \begin{bmatrix} 1 \\ \vdots \\ 1 \end{bmatrix} \frac{\sum_{i=1}^N w_i x_i^0}{\sum_{j=1}^N w_j}
|
||||
= \begin{bmatrix} 1 \\ \vdots \\ 1 \end{bmatrix} \sum_{i=1}^N \frac{w_i}{\sum_{j=1}^N w_j} x_i^0
|
||||
\]
|
||||
where $\tilde{w}_i = \frac{w_i}{\sum_{i=j}^N w_j}$ are all normalized and sum to 1 (i.e., they produce a convex combination).
|
||||
|
||||
Moreover, if $\matr{A}$ is doubly stochastic, then it holds that the consensus is the average as $\vec{w} = 1$:
|
||||
\[
|
||||
\lim_{k \rightarrow \infty} \vec{x}^k = \vec{1} \frac{1}{N} \sum_{i=1}^N x_i^0
|
||||
\]
|
||||
|
||||
% \begin{proof}[Sketch of proof]
|
||||
% Let $\matr{T} = \begin{bmatrix} \vec{1} & \vec{v}^2 & \cdots & \vec{v}^N \end{bmatrix}$ be a change in coordinates that transforms an adjacency matrix into its Jordan form $\matr{J}$:
|
||||
% \[ \matr{J} = \matr{T}^{-1} \matr{A} \matr{T} \]
|
||||
% As $\lambda=1$ is a simple eigenvalue (\Cref{th:strongly_connected_eigenvalues}), it holds that:
|
||||
% \[
|
||||
% \matr{J} = \begin{bmatrix}
|
||||
% 1 & 0 & \cdots & 0 \\
|
||||
% 0 & & & \\
|
||||
% \vdots & & \matr{J}_2 & \\
|
||||
% 0 & & & \\
|
||||
% \end{bmatrix}
|
||||
% \]
|
||||
% where the eigenvalues of $\matr{J}_2 \in \mathbb{R}^{(N-1) \times (N-1)}$ lie inside the open unit disk.
|
||||
|
||||
% Let $\vec{x}^k = \matr{T}\bar{\vec{x}}^k$, then we have that:
|
||||
% \[
|
||||
% \begin{split}
|
||||
% &\vec{x}^{k+1} = \matr{A} \vec{x}^{k} \\
|
||||
% &\iff \matr{T} \bar{\vec{x}}^{k+1} = \matr{A} (\matr{T} \bar{\vec{x}}^k) \\
|
||||
% &\iff \bar{\vec{x}}^{k+1} = \matr{T}^{-1} \matr{A} (\matr{T} \bar{\vec{x}}^k) = \matr{J}\bar{\vec{x}}^k
|
||||
% \end{split}
|
||||
% \]
|
||||
% Therefore:
|
||||
% \[
|
||||
% \begin{gathered}
|
||||
% \lim_{k \rightarrow \infty} \bar{\vec{x}}^k = \bar{x}_1^0 \begin{bmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{bmatrix} \\
|
||||
% \bar{x}_1^{k+1} = \bar{x}_1^k \quad \forall k \geq 0 \\
|
||||
% \lim_{k \rightarrow \infty} \bar{x}_i^{k} = 0 \quad \forall i = 2, \dots, N \\
|
||||
% \end{gathered}
|
||||
% \]
|
||||
% \end{proof}
|
||||
|
||||
\begin{proof}[Proof (Jordan-form approach)]
|
||||
As is $G$ strongly connected and aperiodic, and $\A$ is row stochastic, it holds that:
|
||||
\begin{itemize}
|
||||
\item By \Cref{th:positive_matrix_digraph_connected}, $\A$ is primitive.
|
||||
\item By \hyperref[th:perron_frobenius]{Perron-Frobenius Theorem} and \Cref{th:row_stochastic_unit_disk}, the eigenvalue $\lambda=1$ is strictly dominant and it is associated to the right eigenvector $\vec{1}$ (row stochasticity) and left eigenvector $\w$.
|
||||
\end{itemize}
|
||||
|
||||
Consider the non-singular matrix $\matr{T} \in \R^{N \times N}$ defined as:
|
||||
\[
|
||||
\matr{T} = \begin{bmatrix}
|
||||
\vert & \vert & & \vert \\
|
||||
\vec{1} & \v^2 & \dots & \v^N \\
|
||||
\vert & \vert & & \vert \\
|
||||
\end{bmatrix} = \begin{bmatrix}
|
||||
\vec{1} & \matr{W}_R
|
||||
\end{bmatrix}
|
||||
\qquad
|
||||
\matr{T}^{-1} = \begin{bmatrix}
|
||||
- & (\w)^T & - \\
|
||||
- & (\w^2)^T & - \\
|
||||
- & \vdots & - \\
|
||||
- & (\w^N)^T & - \\
|
||||
\end{bmatrix} = \begin{bmatrix}
|
||||
\w^T \\ \matr{W}_L
|
||||
\end{bmatrix}
|
||||
\]
|
||||
|
||||
A change in coordinates defined as:
|
||||
\[
|
||||
\x \mapsto \tilde{\x} = \matr{T}^{-1} \x
|
||||
\]
|
||||
allows to obtain the Jordan form $\matr{T}^{-1}\A\matr{T}$:
|
||||
\[
|
||||
\matr{T}^{-1}\A\matr{T} = \begin{bmatrix}
|
||||
1 & 0 & \dots \\
|
||||
0 & & \\
|
||||
\vdots & & \matr{J}_2 \\
|
||||
\end{bmatrix}
|
||||
\]
|
||||
with $\matr{J}_2 \in \mathbb{R}^{(N-1) \times (N-1)}$ Schur (i.e., $\text{spec}(\matr{J}_2)$ inside the open unit disk).
|
||||
|
||||
The dynamics $\x^{k+1} = \A \x^k$ in the new coordinate system is:
|
||||
\[
|
||||
\begin{split}
|
||||
\tilde{\x}^{k+1} &= \matr{T}^{-1} \x^{k+1} = \matr{T}^{-1} \A \matr{T} \tilde{\x}^k \\
|
||||
&= \begin{bmatrix}
|
||||
1 & 0 & \dots \\
|
||||
0 & & \\
|
||||
\vdots & & \matr{J}_2 \\
|
||||
\end{bmatrix} \tilde{\x}^k
|
||||
= \begin{bmatrix}
|
||||
1 & 0 & \dots \\
|
||||
0 & & \\
|
||||
\vdots & & \matr{J}_2 \\
|
||||
\end{bmatrix}^{k+1} \tilde{\x}^0
|
||||
\end{split}
|
||||
\]
|
||||
Let's denote:
|
||||
\[
|
||||
\tilde{\x}^k = \matr{T}^{-1}\x^k = \begin{bmatrix}
|
||||
\w^T\x^k \\ \matr{W}_L\x^k
|
||||
\end{bmatrix}
|
||||
= \begin{bmatrix}
|
||||
\tilde{\x}^k_{m} \\ \tilde{\x}^k_{\bot}
|
||||
\end{bmatrix}
|
||||
\]
|
||||
We have that:
|
||||
\[
|
||||
\begin{split}
|
||||
\lim_{k \rightarrow \infty} \tilde{\x}^k
|
||||
&= \lim_{k \rightarrow \infty} \begin{bmatrix}
|
||||
1 & 0 & \dots \\
|
||||
0 & & \\
|
||||
\vdots & & \matr{J}_2 \\
|
||||
\end{bmatrix}^k \tilde{\x}^0 \\
|
||||
&= \lim_{k \rightarrow \infty} \begin{bmatrix}
|
||||
1 & 0 & \dots \\
|
||||
0 & & \\
|
||||
\vdots & & (\matr{J}_2)^k \\
|
||||
\end{bmatrix} \begin{bmatrix}
|
||||
\tilde{\x}^0_{m} \\ \tilde{\x}^0_{\bot}
|
||||
\end{bmatrix} \\
|
||||
&= \begin{bmatrix}
|
||||
1 \cdot \tilde{\x}^0_{m} \\
|
||||
\lim_{k \rightarrow \infty} (\matr{J}_2)^k \tilde{\x}^0_{\bot}
|
||||
\end{bmatrix} \\
|
||||
&= \begin{bmatrix}
|
||||
\w^T \x^0 \\
|
||||
0
|
||||
\end{bmatrix} \\
|
||||
\end{split}
|
||||
\]
|
||||
Note that $\lim_{k \rightarrow \infty} \matr{J}_2^k = 0$ as it is stable (i.e., all eigenvalues are in the open unit disk $|\mu| < 1$).
|
||||
|
||||
In the original coordinate system, the limit is:
|
||||
\[
|
||||
\begin{split}
|
||||
\lim_{k \rightarrow \infty} \x^k
|
||||
&= \lim_{k \rightarrow \infty} \matr{T} \tilde{\x}^k \\
|
||||
&= \matr{T} \lim_{k \rightarrow \infty} \tilde{\x}^k \\
|
||||
&= \begin{bmatrix}
|
||||
\vec{1} & \matr{W}_R
|
||||
\end{bmatrix} \begin{bmatrix}
|
||||
\w^T \x^0 \\
|
||||
0
|
||||
\end{bmatrix}
|
||||
= \vec{1} (\w^T \x^0)
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
\indenttbox
|
||||
\begin{remark}
|
||||
It is assumed that $\Vert \w \Vert = 1$ (i.e., no normalization term).
|
||||
\end{remark}
|
||||
\end{proof}
|
||||
|
||||
% \begin{proof}[Lyapunov approach]
|
||||
% $\A - \vec{1}\w^T$ is rank-1. This is to change one specific eigenvalue (move 1 to 0).
|
||||
|
||||
% Dissensus vector represents error:
|
||||
% \[
|
||||
% \begin{split}
|
||||
% delta^{k+1}
|
||||
% = \x^{k+1} - \vec{1}\w^T \x^0 \\
|
||||
% = \x^{k+1} - \vec{1}\w^T \x^{k+1} \\
|
||||
% = (\matr{I} - \vec{1}\w^T) \x^{k+1} \\
|
||||
% = (\matr{I} - \vec{1}\w^T) \A\x^{k} \\
|
||||
% = (\A - \vec{1}\w^T) \x^{k} \\
|
||||
% = (\A - \vec{1}\w^T) \delta^{k} \\
|
||||
% \end{split}
|
||||
% \]
|
||||
|
||||
% Study:
|
||||
% \[
|
||||
% \delta^{k+1} = (\A - \vec{1}\w^T) \delta{k}
|
||||
% \]
|
||||
% If $\delta^k \rightarrow 0$, then $\x^k \rightarrow\vec{1}\w^T\x^0$.
|
||||
% Note $(\A - \vec{1}\w^T)$ is Schur.
|
||||
|
||||
% Lyapunov equation for discrete time systems:
|
||||
% \[
|
||||
% \bar{\A}^T \matr{P} \bar{\A} = - \matr{P} = - \matr{Q}
|
||||
% \]
|
||||
% where $\bar{\A}$ is the Jordan-form of $(\A - \vec{1}\w^T)$
|
||||
|
||||
% Select $Q_2$ to be block-diagonal and $p_1$
|
||||
|
||||
|
||||
% \[
|
||||
% V(\delta) = \delta^T (\matr{T}^{-1})^T \matr{P} \matr{T}^{-1} \delta
|
||||
% \]
|
||||
% \end{proof}
|
||||
\end{theorem}
|
||||
|
||||
\end{subappendices}
|
||||
@ -42,7 +42,7 @@
|
||||
where:
|
||||
\begin{itemize}
|
||||
\item $\z = (\z_1, \dots, \z_N)$ with $\z_i \in \mathbb{R}^{n_i}$,
|
||||
\item $l_i: \mathbb{R}^{n_i} \rightarrow \mathbb{R}^d$ is the loss function of the agent $i$,
|
||||
\item $l_i: \mathbb{R}^{n_i} \times \mathbb{R}^d \rightarrow \mathbb{R}$ is the loss function of the agent $i$,
|
||||
\item $\sigma(\z)$ is an aggregation function generically defined as $\sigma(\z) = \frac{1}{N} \sum_{i=1}^{N} \phi_i(\z_i)$, for some $\phi_i: \mathbb{R}^{n_i} \rightarrow \mathbb{R}^d$
|
||||
\end{itemize}
|
||||
|
||||
@ -102,7 +102,7 @@
|
||||
\begin{itemize}
|
||||
\item An estimate $\z_i^k$ of its optimal position $\z_i^*$,
|
||||
\item An estimate $\s_i^k$ of the aggregation function $\sigma(\z^k) = \frac{1}{N} \sum_{j=1}^{N} \phi_j(\z_j^k)$,
|
||||
\item An estimate $\v_i^k$ of the gradient with respect to the second argument of the loss $\sum_{j=1}^{N} \nabla_{[\sigma(\z^k)]} l_j(\z_j^k, \sigma(\z^k))$.
|
||||
\item An estimate $\v_i^k$ of the gradient with respect to the second argument of the loss $\frac{1}{N} \sum_{j=1}^{N} \nabla_{[\sigma(\z^k)]} l_j(\z_j^k, \sigma(\z^k))$.
|
||||
\end{itemize}
|
||||
|
||||
The step is based on the centralized gradient method using the local estimates:
|
||||
@ -176,4 +176,4 @@
|
||||
\end{aligned}
|
||||
\]
|
||||
where $P_{Z_i^k}$ is the Euclidean projection and $\delta \in (0, 1)$ is a hyperparameter.
|
||||
\end{description}
|
||||
\end{description}
|
||||
|
||||
@ -0,0 +1,210 @@
|
||||
\chapter{Feedback optimization}
|
||||
|
||||
|
||||
% Single system:
|
||||
|
||||
% \begin{enumerate}
|
||||
% \item Optimization algorithm: generate a ``reference'' for the control system (algorithmic level).
|
||||
% \item Control system: move the robot and use the output as an input of the optimization algorithm (physical level).
|
||||
% \end{enumerate}
|
||||
|
||||
\begin{description}
|
||||
\item[Feedback optimization] \marginnote{Feedback optimization}
|
||||
Consider a continuous-time non-linear dynamical system:
|
||||
\[
|
||||
\dot{\x}(t) = f(\x(t), \u(t)) \quad \x(0) = \x_0
|
||||
\]
|
||||
|
||||
Assume that there exists a steady-state map $h: \mathbb{R}^m \rightarrow \mathbb{R}^n$ (i.e., sort of oracle) that given the input $\bar{\u}$ returns the equilibrium state $\bar{\x}$ associated to it:
|
||||
\[
|
||||
% \begin{gathered}
|
||||
% \forall \bar{\u} \in \mathbb{R}^m: \bar{\u} \mapsto \bar{\x} = h(\bar{\u}) \\
|
||||
f(h(\bar{\u}), \bar{\u}) = 0
|
||||
% \end{gathered}
|
||||
\]
|
||||
% Assume that the system is pre-stabilized around the equilibra. i.e.,
|
||||
% \[
|
||||
% \begin{split}
|
||||
% \bar{\u} \in \R^m \\
|
||||
% \bar{\u} \mapsto \bar{\x} = h(\bar{\u}) \\
|
||||
% f(\bar{\x}, \bar{\u}) = 0 \\
|
||||
% \end{split}
|
||||
% \]
|
||||
Moreover, it is assumed that, for any $\bar{\u} \in \mathbb{R}^m$, $\bar{\x} = h(\bar{\u})$ is a globally exponentially stable equilibrium for the system $f(\x(t), \bar{\u})$.
|
||||
|
||||
The goal of feedback optimization is to design a dynamic feedback law $\u(t) = \kappa(\x(t), t)$ such that $\u(t)$ and $\x(t)$ converge to the solution of the problem:
|
||||
\[
|
||||
\begin{gathered}
|
||||
\min_{\z \in \R^n, \u \in \R^m} l(\z) \\
|
||||
\text{subject to } \z = h(\u)
|
||||
\end{gathered}
|
||||
\]
|
||||
where $h$ is not explicitly available and the control law can only access the current state $\x(t)$ ($\nabla h$ can however be used).
|
||||
|
||||
\item[Reduced feedback optimization problem] \marginnote{Reduced feedback optimization problem}
|
||||
By injecting the constraint of the feedback optimization problem into the cost function, the problem becomes unconstrained:
|
||||
\[
|
||||
\min_{\u \in \R^m} l(h(\u))
|
||||
\]
|
||||
|
||||
% Can apply the gradient method:
|
||||
% \[
|
||||
% \u^{k+1} = \u^k - \alpha \nabla h(\u^k) \nabla l(h(\u^k))
|
||||
% \]
|
||||
and can be solved using the gradient flow:
|
||||
\[
|
||||
\dot{\u}(t) = -\delta \nabla h(\u(t)) \nabla l(h(\u(t)))
|
||||
\]
|
||||
where $\delta$ is a hyperparameter (note that it is not the step size as it is not needed in continuous time).
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.35\linewidth]{./img/feedback_reduced_naive.png}
|
||||
\end{figure}
|
||||
|
||||
\begin{remark}
|
||||
By assumption, $h$ is not available.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
|
||||
|
||||
\section{Centralized feedback optimization}
|
||||
|
||||
\begin{description}
|
||||
\item[Feedback optimization based on time-scale separation] \marginnote{Feedback optimization based on time-scale separation}
|
||||
Gradient flow of the reduced feedback optimization problem where the steady-state $h(\u(t))$ is approximated with the current state $\x(t)$.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.35\linewidth]{./img/feedback_timescale.png}
|
||||
\end{figure}
|
||||
|
||||
Intuitively, with $\delta > 0$ sufficiently small, we are creating a time-scale separation (i.e., dynamics working on different time-scales) between plant and optimization dynamics:
|
||||
\begin{itemize}
|
||||
\item The plant $\x(t)$ is a fast dynamics that tracks $h(\u(t))$ (i.e., the equilibrium for the current $\u$) so that $\nabla l(\x(t)) \approx \nabla l(h(\u(t)))$ for the optimization dynamics.
|
||||
\item The optimization dynamics is a slow dynamics that changes the input, thus refining the equilibrium that minimizes the loss.
|
||||
\end{itemize}
|
||||
% (i.e., $\x(t)$ is a fast dynamic tracking (an equilibrium) and the optimization dynamics is slow that changes the input and thus the equilibrium).
|
||||
|
||||
% If $\delta = 0$, $\dot{\u} = 0$ and $\bar{\x} = h(\bar{\u})$ is globally exponentially stable so that:
|
||||
% \[
|
||||
% \x(t) \rightarrow \bar{\x} = h(\bar{\u})
|
||||
% \]
|
||||
|
||||
\begin{remark}[Time-scale separation theory]
|
||||
Method to analyze a dynamical system by identifying a slow and fast dynamics, and studying them separately. Auxiliary systems are introduced:
|
||||
\begin{descriptionlist}
|
||||
\item[Boundary-layer system] with $\u$ constant to model the fast system. It is exponentially stable by assumption and can be associated with the Lyapunov function $U(\x)$.
|
||||
\item[Reduced system] with the gradient flow without the state $\x$ to model the slow system. It can be shown that it is asymptotically stable with the Lyapunov function $W(\u)$.
|
||||
\end{descriptionlist}
|
||||
The stability of the whole dynamics is studied by using $U+W$ as Lyapunov function and a sufficiently small $\delta$.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.95\linewidth]{./img/feedback_time_scale_theory.png}
|
||||
\end{figure}
|
||||
% \begin{itemize}
|
||||
% \item Slow dynamics: optimization dynamics,
|
||||
% \item Fast dynamics: plant dynamics
|
||||
% \end{itemize}
|
||||
|
||||
% Treat them separately with two systems:
|
||||
% \begin{itemize}
|
||||
% \item Boundary-layer system. It has $\u$ constant (thus exponentially stable by assumption).
|
||||
% \item Reduced system. It is the gradient flow without state $\x$. Can be shown to be asymptotically stable.
|
||||
% \end{itemize}
|
||||
|
||||
% Use Lyapunov functions $U(\x)$ and $W(\u)$, one for each system, to prove stability. Then, combine then $U+W$ with sufficiently small $\delta$ to show overall stability.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
\begin{theorem}[Feedback optimization based on time-scale separation convergence]
|
||||
Consider a closed-loop system and assume that:
|
||||
\begin{itemize}
|
||||
\item $\bar{\x} = h(\bar{\u})$ is a globally exponentially stable equilibrium,
|
||||
\item $l(h(\cdot))$ is radially unbounded and possibly non-convex,
|
||||
\item $\nabla l(h(\cdot))$, $\nabla l$, $h$, and $f$ are Lipschitz continuous.
|
||||
\end{itemize}
|
||||
It holds that, for a sufficiently small $\delta > 0$, the trajectory $(\x(t), \u(t))$ of the system satisfies:
|
||||
\[
|
||||
\lim_{t \rightarrow \infty} \texttt{dist}\left( \begin{bmatrix} \x(t) - h(\u(t)) \\ \u(t) \end{bmatrix}, \begin{bmatrix} 0 \\ \u^* \in \mathcal{U}^* \end{bmatrix} \right) = 0
|
||||
\]
|
||||
where $\texttt{dist}$ is the set distance and $\mathcal{U}^*$ is the set of stationary points of $l(h(\cdot))$.
|
||||
\end{theorem}
|
||||
|
||||
|
||||
|
||||
\section{Distributed feedback optimization}
|
||||
|
||||
\begin{description}
|
||||
\item[Distributed feedback optimization] \marginnote{Distributed feedback optimization}
|
||||
Network of $N$ agents each with dynamics:
|
||||
\[
|
||||
\dot{\x}_i(t) = f_i(\x_i(t), \u_i(t))
|
||||
\]
|
||||
|
||||
The goal is to design a control law $\u_i(t) = \kappa_i(\{ \x_j(t) \}_{j \in \mathcal{N}_i}, t)$ such that $\u_1(t), \dots, \u_N(t)$ and $\x_1(t), \dots, \x_N(t)$ converge to the solution of the problem:
|
||||
\[
|
||||
\begin{gathered}
|
||||
\min_{\substack{(\z_1, \dots, \z_N)\\(\u_1, \dots, \u_N)}} \sum_{i=1}^{N} l_i(\z_i, \sigma(\z)) \\
|
||||
\text{subject to } \z_i = h_i(\u_i)
|
||||
\end{gathered}
|
||||
\]
|
||||
where $\sigma(\z) = \frac{1}{N} \sum_{i=1}^{N} \phi_i(\z_i)$ is an aggregation function.
|
||||
|
||||
\item[Reduced distributed feedback optimization] \marginnote{Reduced distributed feedback optimization}
|
||||
By injecting the constraint into the cost function, the problem becomes:
|
||||
\[
|
||||
\min_{(\u_1, \dots, \u_N)} \sum_{i=1}^{N} l_i(h_i(\u_i), \sigma(h(\u)))
|
||||
\]
|
||||
and can be solved using the parallel gradient flow:
|
||||
\[
|
||||
\small
|
||||
\dot{\u}_i = - \delta_1 \nabla h_i(\u_i) \left( \nabla_{[h_i(\u_i)]} l_i(h_i(\u_i), \sigma(h(\u))) + \left( \sum_{j=1}^{N} \nabla_{[\sigma(h(\u))]} l_j(h_j(\u_j), \sigma(h(\u))) \right) \frac{1}{N}\nabla \phi_i(h_i(\u_i)) \right)
|
||||
\]
|
||||
where $\delta_1 > 0$ is a hyperparameter.
|
||||
|
||||
\begin{remark}
|
||||
This formulation uses $h$ which is not available and requires global information.
|
||||
\end{remark}
|
||||
|
||||
\item[Aggregative tracking feedback] \marginnote{Aggregative tracking feedback}
|
||||
Use $\x_i$ to approximate $h_i(\u_i)$ and dynamic average consensus for the aggregation function. The dynamics is:
|
||||
\[
|
||||
\begin{split}
|
||||
\dot{\u}_i &= -\delta_1 \nabla h_i(\u_i) \Big( \nabla_{[\x_i]} l_i(\x_i, \phi_i(\x_i)+\w_i) + \left( \nabla_{[\phi_i(\x_i)+\w_i]} l_i(\x_i, \phi_i(\x_i)+\w_i) + \v_i \right) \nabla \phi_i(\x_i) \Big) \\
|
||||
\delta_2 \dot{\w}_i &= - \sum_{j \in \mathcal{N}_i} a_{ij} (\w_i - \w_j) - \sum_{j \in \mathcal{N}_i} a_{ij} (\phi_i(\x_i) - \phi_i(\x_j)) \\
|
||||
\delta_2 \dot{\v}_i &= - \sum_{j \in \mathcal{N}_i} a_{ij} (\v_i - \v_j) - \sum_{j \in \mathcal{N}_i} a_{ij} (\nabla_{[\phi_i(\x_i)+\w_i]} l_i(\x_i, \phi_i(\x_i)+\w_i) - \nabla_{[\phi_j(\x_j)+\w_j]} l_j(\x_j, \phi_j(\x_j)+\w_j)) \\
|
||||
\end{split}
|
||||
\]
|
||||
where $\delta_1 > 0$ is used to slow down $\dot{\u}_i$ and $\delta_2 > 0$ to speed up $\dot{\w}_i$ and $\dot{\v}_i$.
|
||||
|
||||
\begin{remark}
|
||||
The formulation for dynamic average consensus is for the continuous case with the Laplacian.
|
||||
\end{remark}
|
||||
|
||||
\begin{remark}
|
||||
The overall system works on three time-scales.
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.6\linewidth]{./img/feedback_distributed.png}
|
||||
\end{figure}
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
\begin{theorem}[Aggregative tracking feedback convergence]
|
||||
If:
|
||||
\begin{itemize}
|
||||
\item The aggregative tracking feedback algorithm is initialized so that $\sum_{i=1}^{N} \texttt{col}(\w_i(0), \v_i(0)) = 0$,
|
||||
\item $G$ is strongly connected and weight balanced,
|
||||
\item $\bar{\x}_i = h_i(\bar{\u}_i)$ is globally exponentially stable,
|
||||
\item $\sum_{i=1}^{N} l_i(h_i(\cdot), \sigma(h(\cdot)))$ is radially unbounded and possibly non-convex,
|
||||
\item $\nabla_{[\cdot]} l_i$, $\phi_i$, and $h_i$ are Lipschitz continuous.
|
||||
\end{itemize}
|
||||
Then, for small $\delta_1 > 0$ and $\delta_2 > 0$, the trajectory of the system satisfies:
|
||||
\[
|
||||
\lim_{t \rightarrow \infty} \texttt{dist}\left( \begin{bmatrix} \x(t) - h(\u(t)) \\ \u(t) \end{bmatrix}, \begin{bmatrix} 0 \\ \u^* \in \mathcal{U}^* \end{bmatrix} \right) = 0
|
||||
\]
|
||||
where $\mathcal{U}^*$ is the set of stationary points of $\sum_{i=1}^{N} l_i(h_i(\cdot), \sigma(h(\cdot)))$.
|
||||
\end{theorem}
|
||||
@ -5,44 +5,49 @@
|
||||
|
||||
\begin{description}
|
||||
\item[Mass-spring system] \marginnote{Mass-spring system}
|
||||
System of $N$ masses where each mass $i$ has a position $x_i \in \mathbb{R}$ and is connected through a sprint to mass $i-1$ and $i+1$. Each spring has an elastic constant $a_{j, i} = a_{i, j} > 0$.
|
||||
System of $N$ masses where each mass $i$ has a position $x_i \in \mathbb{R}$ and is connected through a spring to mass $i-1$ and $i+1$. Each spring has an elastic constant $a_{j, i} = a_{i, j} > 0$.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.5\linewidth]{./img/mass_spring_system.png}
|
||||
\includegraphics[width=0.35\linewidth]{./img/mass_spring_system.png}
|
||||
\end{figure}
|
||||
|
||||
The elastic force $F_{e,i}(x)$ at mass $i$ is given by:
|
||||
The elastic force $F_{e,i}(\x)$ at mass $i$ is given by:
|
||||
\[
|
||||
F_{e,i}(x) = -a_{i,i-1}(x_i-x_{i-1}) - a_{i,i+1}(x_i - x_{i+1})
|
||||
F_{e,i}(\x) = -a_{i,i-1}(x_i-x_{i-1}) - a_{i,i+1}(x_i - x_{i+1})
|
||||
\]
|
||||
Equivalently, it is possible to express the elastic force as the negative gradient of the elastic potential energy:
|
||||
\[
|
||||
F_{e,i}(x) = -\frac{\partial}{\partial x_i}\left( \frac{1}{2} a_{i,i-1} \Vert x_i - x_{i-1} \Vert^2 + \frac{1}{2} a_{i,i+1} \Vert x_i - x_{i+1} \Vert^2 \right)
|
||||
F_{e,i}(\x) = -\frac{\partial}{\partial x_i}\left( \frac{1}{2} a_{i,i-1} \Vert x_i - x_{i-1} \Vert^2 + \frac{1}{2} a_{i,i+1} \Vert x_i - x_{i+1} \Vert^2 \right)
|
||||
\]
|
||||
|
||||
\item[Mass-spring system with two springs] \marginnote{Mass-spring system with two springs}
|
||||
Assume that the springs of a mass-spring system can be split with halved elastic constants.
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.5\linewidth]{./img/mass_spring_system2.png}
|
||||
\includegraphics[width=0.35\linewidth]{./img/mass_spring_system2.png}
|
||||
\end{figure}
|
||||
|
||||
Accordingly, the elastic force can be defined as:
|
||||
\[
|
||||
\small
|
||||
\begin{split}
|
||||
F_{e,i}(x)
|
||||
F_{e,i}(\x)
|
||||
&=
|
||||
- \frac{1}{2} a_{i,i-1}(x_i - x_{i-1})
|
||||
- \frac{1}{2} a_{i-1,i}(x_i - x_{i-1})
|
||||
- \frac{1}{2} a_{i,i+1}(x_i - x_{i+1})
|
||||
- \frac{1}{2} a_{i+1,i}(x_i - x_{i+1}) \\
|
||||
&=
|
||||
- \frac{1}{2} a_{i,i-1}(x_i - x_{i-1})
|
||||
+ \frac{1}{2} a_{i-1,i}(x_{i-1} - x_i)
|
||||
- \frac{1}{2} a_{i,i+1}(x_i - x_{i+1})
|
||||
+ \frac{1}{2} a_{i+1,i}(x_{i+1} - x_i) \\
|
||||
&= -\frac{\partial}{\partial x_i} \left(
|
||||
\frac{1}{2} \frac{a_{i,i-1}}{2} \Vert x_i - x_{i-1} \Vert^2 +
|
||||
\frac{1}{2} \frac{a_{i-1,i}}{2} \Vert x_{i} - x_{i-1} \Vert^2 +
|
||||
\frac{1}{2} \frac{a_{i,i+1}}{2} \Vert x_i - x_{i+1} \Vert^2 +
|
||||
\frac{1}{2} \frac{a_{i+1,i}}{2} \Vert x_{i} - x_{i+1} \Vert^2 \right) \\
|
||||
% &=
|
||||
% - \frac{1}{2} a_{i,i-1}(x_i - x_{i-1})
|
||||
% + \frac{1}{2} a_{i-1,i}(x_{i-1} - x_i)
|
||||
% - \frac{1}{2} a_{i,i+1}(x_i - x_{i+1})
|
||||
% + \frac{1}{2} a_{i+1,i}(x_{i+1} - x_i) \\
|
||||
&= -\frac{\partial}{\partial x_i} \left(
|
||||
\frac{1}{2} \frac{a_{i,i-1}}{2} \Vert x_i - x_{i-1} \Vert^2 +
|
||||
\frac{1}{2} \frac{a_{i-1,i}}{2} \Vert x_{i-1} - x_{i} \Vert^2 +
|
||||
@ -53,7 +58,7 @@
|
||||
The total potential energy (i.e., sum of the function in the derivative over all masses) can be compactly defined as:
|
||||
\[
|
||||
\begin{split}
|
||||
V(x) &= \sum_{i=1}^{N} \sum_{j \in \mathcal{N}_i} \frac{1}{2} \frac{a_{i,j}}{2} \Vert x_i - x_j \Vert^2 \\
|
||||
V(\x) &= \sum_{i=1}^{N} \sum_{j \in \mathcal{N}_i} \frac{1}{2} \frac{a_{i,j}}{2} \Vert x_i - x_j \Vert^2 \\
|
||||
&= \sum_{i=1}^{N} \sum_{j \in \mathcal{N}_i} V_{ij}(x_i, x_j)
|
||||
\end{split}
|
||||
\quad
|
||||
@ -63,17 +68,17 @@
|
||||
|
||||
Then, the potential energy at mass $i$ can be written as:
|
||||
\[
|
||||
V_i(x) = \sum_{j \in \mathcal{N}_i} ( V_{i,j}(x_i, x_j) + V_{j,i}(x_j, x_i) )
|
||||
V_i(\x) = \sum_{j \in \mathcal{N}_i} ( V_{i,j}(x_i, x_j) + V_{j,i}(x_j, x_i) )
|
||||
\]
|
||||
|
||||
Finally, the elastic force at mass $i$ can be reformulated as:
|
||||
\[
|
||||
\begin{split}
|
||||
F_{e,i}(x)
|
||||
F_{e,i}(\x)
|
||||
&= - \frac{\partial}{\partial x_i} \Big( V_{i,i-1}(x_i, x_{i-1}) + V_{i-1,i}(x_{i-1}, x_i) + V_{i,i+1}(x_i, x_{i+1}) + V_{i+1,i}(x_{i+1}, x_i) \Big) \\
|
||||
&= - \frac{\partial}{\partial x_i} \left( \sum_{j \in \mathcal{N}_i} ( V_{i,j}(x_i, x_j) + V_{j,i}(x_j, x_i) ) \right) \\
|
||||
&= - \frac{\partial}{\partial x_i} V_i(x) \\
|
||||
&= - \frac{\partial}{\partial x_i} V(x)
|
||||
&= - \frac{\partial}{\partial x_i} V_i(\x) \\
|
||||
&= - \frac{\partial}{\partial x_i} V(\x)
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
@ -90,7 +95,7 @@
|
||||
\[
|
||||
\begin{split}
|
||||
\dot{x}_i &= v_i \\
|
||||
m_i \dot{v}_i &= - v_i - c\frac{\partial}{\partial x_i} V(x) = - v_i - \frac{\partial}{\partial x_i} V(x)
|
||||
m_i \dot{v}_i &= - v_i - c\frac{\partial}{\partial x_i} V(\x) = - v_i - \frac{\partial}{\partial x_i} V(\x)
|
||||
\end{split}
|
||||
\]
|
||||
where $m_i$ is the mass of the $i$-th mass.
|
||||
@ -98,8 +103,8 @@
|
||||
By assuming small masses $m_i$, the following approximation can be made:
|
||||
\[
|
||||
\begin{gathered}
|
||||
\cancel{m_i \dot{v}_i} = - v_i - \frac{\partial}{\partial x_i} V(x) \Rightarrow v_i \approx -\frac{\partial}{\partial x_i} V(x) \\
|
||||
\dot{x_i} = -\frac{\partial}{\partial x_i} V(x) = F_{e,i}(x)
|
||||
\cancel{m_i \dot{v}_i} = - v_i - \frac{\partial}{\partial x_i} V(\x) \Rightarrow v_i \approx -\frac{\partial}{\partial x_i} V(\x) \\
|
||||
\dot{x_i} = -\frac{\partial}{\partial x_i} V(\x) = F_{e,i}(\x)
|
||||
\end{gathered}
|
||||
\]
|
||||
|
||||
@ -117,20 +122,20 @@
|
||||
Therefore, the overall system follows a Laplacian dynamics and can be equivalently formulated as the gradient flow of $V$:
|
||||
\[
|
||||
\begin{split}
|
||||
\dot{\x} &= -\matr{L}\x = - \nabla V(x) \\
|
||||
\dot{\x} &= -\matr{L}\x = - \nabla V(\x) \\
|
||||
\begin{bmatrix}
|
||||
\dot{x}_1 \\ \vdots \\ \dot{x}_N
|
||||
\end{bmatrix}
|
||||
&=
|
||||
- \begin{bmatrix}
|
||||
\frac{\partial}{\partial x_1} V(x) \\
|
||||
\frac{\partial}{\partial x_1} V(\x) \\
|
||||
\vdots
|
||||
\\
|
||||
\frac{\partial}{\partial x_N} V(x)
|
||||
\frac{\partial}{\partial x_N} V(\x)
|
||||
\end{bmatrix}
|
||||
\end{split}
|
||||
\]
|
||||
And consensus is reached at a stationary point of $V(x)$.
|
||||
And consensus is reached at a stationary point of $V(\x)$.
|
||||
\end{description}
|
||||
|
||||
|
||||
@ -160,7 +165,7 @@
|
||||
V_{ij}^\text{form}(\x_i, \x_j) = \frac{1}{8} \left( \Vert \x_i - \x_j \Vert^2 - d_{ij}^2 \right)^2
|
||||
\end{gathered}
|
||||
\]
|
||||
where $\frac{1}{8}$ is used to cancel out the fraction when deriving.
|
||||
where $\frac{1}{8}$ is used to cancel out the coefficients when deriving.
|
||||
|
||||
The gradient flow dynamics is then:
|
||||
\[
|
||||
|
||||
@ -115,9 +115,9 @@
|
||||
\begin{remark}
|
||||
It holds that:
|
||||
\[
|
||||
\matr{D}^\text{IN} = \text{diag}(\matr{A}^T \vec{1})
|
||||
\matr{D}^\text{OUT} = \text{diag}(\matr{A}^T \vec{1})
|
||||
\quad
|
||||
\matr{D}^\text{OUT} = \text{diag}(\matr{A} \vec{1})
|
||||
\matr{D}^\text{IN} = \text{diag}(\matr{A} \vec{1})
|
||||
\]
|
||||
where $\vec{1}$ is a vector of ones.
|
||||
\end{remark}
|
||||
@ -148,4 +148,4 @@
|
||||
\begin{remark}
|
||||
$\matr{L}^\text{IN}$ is the out-degree Laplacian of the reverse graph.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
\end{description}
|
||||
|
||||
@ -0,0 +1,303 @@
|
||||
\chapter{Neural networks}
|
||||
|
||||
\begin{description}
|
||||
\item[Supervised learning] \marginnote{Supervised learning}
|
||||
Given $M$ data-label samples $\{ (\D^1, p^1), \dots, (\D^M, p^M) \}$, the goal is to approximate the mapping through a non-linear function $\phi(\cdot; \u)$ parametrized on $\u$.
|
||||
\end{description}
|
||||
|
||||
|
||||
\begin{description}
|
||||
\item[Neuron model] \marginnote{Neuron model}
|
||||
Computational unit composed of a set of weights $\u \in \mathbb{R}^d$ ($\mathbb{R}^{d+1}$ if with bias) that, given an input $\x \in \mathbb{R}^d$, computes:
|
||||
\[
|
||||
x^{+} = \sigma(\x^T \u + u_{b})
|
||||
\]
|
||||
where $\sigma: \mathbb{R} \rightarrow \mathbb{R}$ is an activation function.
|
||||
|
||||
\begin{remark}
|
||||
The bias can be easily added by considering as weights $\begin{bmatrix} u_b & \u \end{bmatrix}^T$ and as input $\begin{bmatrix} 1 & \x \end{bmatrix}^T$.
|
||||
\end{remark}
|
||||
|
||||
|
||||
\item[Multi-layer perceptron] \marginnote{Multi-layer perceptron}
|
||||
Network with $T$ layers each (for simplicity) with $d$ neurons where the $h$-th unit at layer $t$ has weights $\u_{h,t} \in \mathbb{R}^d$. The update at each neuron is defined as:
|
||||
\[
|
||||
x_{h,t+1} = \sigma(\x_t^T \u_{h,t})
|
||||
\quad
|
||||
x_{h,0} = \D^i_h
|
||||
\]
|
||||
In matrix form, it becomes:
|
||||
\[
|
||||
\begin{split}
|
||||
\begin{bmatrix}
|
||||
x_{1, t+1} \\ \vdots \\ x_{d, t+1}
|
||||
\end{bmatrix}
|
||||
&=
|
||||
\begin{bmatrix}
|
||||
\sigma(\x_t^T \u_{1,t}) \\
|
||||
\vdots \\
|
||||
\sigma(\x_t^T \u_{d,t})
|
||||
\end{bmatrix} \\
|
||||
\x_{t+1} &= f(\x_t, \u_t) \quad \u_t = \begin{bmatrix}
|
||||
\u_{1,t} \\ \vdots \\ \u_{d,t}
|
||||
\end{bmatrix} \in \mathbb{R}^{d^2}
|
||||
\end{split}
|
||||
\]
|
||||
\end{description}
|
||||
|
||||
|
||||
|
||||
\section{Training problem definition}
|
||||
|
||||
\begin{description}
|
||||
\item[Single sample training] \marginnote{Single sample training}
|
||||
Task of finding $\u = (\u_0, \dots, \u_{T-1})$ such that at the last layer $t=T$ the prediction is as accurate as possible:
|
||||
\[ \Vert \x_T - p \Vert < \varepsilon \]
|
||||
|
||||
By using forward simulation of the dynamics $\x_{t+1} = f(\x_t, \u_t)$, we can obtain the output of the last layer as:
|
||||
\[
|
||||
\x_T = \phi(\x_0; \u) = \phi(\D; \u)
|
||||
\]
|
||||
where $\phi$ is called shooting map and it passes the data sample through the layers (from a deep learning point-of-view, it represents the composition of function).
|
||||
|
||||
The best weights $\u^*$ can be obtained by solving:
|
||||
\[
|
||||
\min_{\u} l(\x_T; p) = \min_{\u} l(\phi(\D; \u); p)
|
||||
\]
|
||||
where $l$ is the loss.
|
||||
|
||||
\begin{remark}
|
||||
In optimal control, the learning problem is a reduced/condensed problem and the algorithm to solve it is a direct single shooting.
|
||||
\end{remark}
|
||||
|
||||
By defining:
|
||||
\[
|
||||
J(\u) = l(\phi(\D; \u); p)
|
||||
\]
|
||||
The reduced optimization problem is:
|
||||
\[
|
||||
\min_{\u} J(\u)
|
||||
\]
|
||||
And can be solved using the gradient method:
|
||||
\[
|
||||
\u^{k+1} = \u^k - \alpha^k \nabla J(\u^k)
|
||||
\]
|
||||
|
||||
|
||||
\item[Multiple samples training] \marginnote{Multiple samples training}
|
||||
With multiple samples, the shooting function is applied at each data point:
|
||||
\[
|
||||
\x_T^m = \phi(\x_0^m; \u)
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
$\u$ is independent of $m$ (it is called ensemble control).
|
||||
\end{remark}
|
||||
|
||||
The optimization problem becomes:
|
||||
\[
|
||||
\min_{\u} \sum_{m=1}^{M} J_m(\u)
|
||||
\qquad
|
||||
J_m(\u) = l(\phi(\x_0^m; \u); p^m)
|
||||
\]
|
||||
And its solution with the gradient method is:
|
||||
\[
|
||||
\u^{k+1} = \u^k - \alpha^k \sum_{m=1}^{M} \nabla J_m(\u^k)
|
||||
\]
|
||||
\end{description}
|
||||
|
||||
|
||||
\section{Backpropagation}
|
||||
|
||||
|
||||
\subsection{Preliminaries}
|
||||
|
||||
\begin{description}
|
||||
\item[Finite-horizon optimal control problem] \marginnote{Finite-horizon optimal control problem}
|
||||
Optimization problem defined as:
|
||||
\[
|
||||
\begin{aligned}
|
||||
&\min_{\x, \u} \sum_{t=0}^{T-1} l_t(\x_t, \u_t) + l_T(\x_T)
|
||||
&& \x_0 = \x_\text{init} \\
|
||||
&\,\text{subject to } \x_{t+1} = f_t(\x_t, \u_t)
|
||||
\end{aligned}
|
||||
\]
|
||||
where:
|
||||
\begin{itemize}
|
||||
\item $\x = (\x_1, \dots, \x_T)$ are the state trajectories,
|
||||
\item $\u = (\u_1, \dots, \u_{T-1})$ are the input trajectories,
|
||||
\item $f_t: \mathbb{R}^n \times \mathbb{R}^m \rightarrow \mathbb{R}^n$ for $t=0, \dots, T-1$ are the dynamics,
|
||||
\item $l_t: \mathbb{R}^n \times \mathbb{R}^m \rightarrow \mathbb{R}$ for $t=0, \dots, T-1$ are the stage costs,
|
||||
\item $l_T: \mathbb{R}^n \rightarrow \mathbb{R}$ is the terminal cost.
|
||||
\end{itemize}
|
||||
|
||||
\item[Adjoint method (general case)] \marginnote{Adjoint method (general case)}
|
||||
Algorithm to compute the gradient of the cost function of a finite-horizon optimal control problem.
|
||||
|
||||
Given the initial trajectory $(\x^0, \u^0)$, the method works as follows:
|
||||
\begin{enumerate}
|
||||
\item Repeat for the number of iterations $k = 0, 1, \dots$:
|
||||
\begin{enumerate}
|
||||
\item Perform backward simulation of the co-state $\lambda$ for $t = T-1, \dots, 0$:
|
||||
\[
|
||||
\begin{split}
|
||||
\lambda_t &= \nabla_{[\x_t^k]} l_t(\x_t^k, \u_t^k) + \nabla_{[\x_t^k]} f_t(\x_t^k, \u_t^k) \lambda_{t+1}
|
||||
\qquad
|
||||
\lambda_T = \nabla l_T(\x_T^k) \\
|
||||
\Delta \u_t^k &= \nabla_{[\u_t^k]} l_t(\x_t^k, \u_t^k) + \nabla_{[\u_t^k]} f_t(\x_t^k, \u_t^k) \lambda_{t+1}
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
Intuitively, $\lambda_t$ is the derivative of the cost function w.r.t. the first argument and $\Delta \u_t^k$ is w.r.t. the second.
|
||||
\end{remark}
|
||||
|
||||
\item Apply descent step on the control input for $t = 0, \dots, T-1$:
|
||||
\[
|
||||
\u_{t}^{k+1} = \u_{t}^{k} - \alpha^k \Delta \u_t^k
|
||||
\]
|
||||
\item Apply forward simulation of the dynamics for $t = 0, \dots, T-1$:
|
||||
\[
|
||||
\x_{t+1}^{k+1} = f_t(\x_t^{k+1}, \u_t^{k+1})
|
||||
\qquad
|
||||
\x_0^{k+1} = \x_\text{init}
|
||||
\]
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
|
||||
\item[Adjoint method (simplified)] \marginnote{Adjoint method (simplified)}
|
||||
Without stage cost and with a time-invariant dynamics, the problem becomes:
|
||||
\[
|
||||
\begin{aligned}
|
||||
&\min_{\x, \u} l_T(\x_T) && \x_0 = \x_\text{init} \\
|
||||
&\,\text{subject to } \x_{t+1} = f(\x_t, \u_t)
|
||||
\end{aligned}
|
||||
\]
|
||||
|
||||
The backward simulation of the co-state becomes:
|
||||
\[
|
||||
\begin{split}
|
||||
\lambda_t &= \nabla_{[\x_t^k]} f(\x_t^k, \u_t^k) \lambda_{t+1}
|
||||
\qquad
|
||||
\lambda_T = \nabla l_T(\x_T^k) \\
|
||||
\Delta \u_t^k &= \nabla_{[\u_t^k]} f(\x_t^k, \u_t^k) \lambda_{t+1}
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
The co-states $\lambda_t$ represent the partial derivatives necessary to apply the chain rule and $\Delta\u_t = \frac{\partial J(\u)}{\partial \u_t}$.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Adjoint method for neural networks}
|
||||
|
||||
\begin{description}
|
||||
\item[Backpropagation (one-sample)] \marginnote{Backpropagation (one-sample)}
|
||||
The simplified adjoint method is equivalent to the backpropagation algorithm for neural networks with:
|
||||
\[
|
||||
f(\x_t, \u_t) =
|
||||
\begin{bmatrix}
|
||||
f_1(\x_t^k, \u_t^k) \\ \vdots \\ f_d(\x_t^k, \u_t^k)
|
||||
\end{bmatrix} =
|
||||
\begin{bmatrix}
|
||||
\sigma(\x_t^T \u_{1,t}) \\ \vdots \\ \sigma(\x_t^T \u_{d,t})
|
||||
\end{bmatrix}
|
||||
\qquad
|
||||
t = 0, 1, \dots, T-1
|
||||
\]
|
||||
|
||||
The gradient w.r.t. the first argument is:
|
||||
\[
|
||||
\begin{split}
|
||||
\nabla_{[\x_t^k]} f(\x_t^k, \u_t^k)
|
||||
&= \begin{bmatrix}
|
||||
\nabla_{[\x_t^k]} f_1(\x_t^k, \u_t^k) & \dots & \nabla_{[\x_t^k]} f_d(\x_t^k, \u_t^k)
|
||||
\end{bmatrix} \\
|
||||
&= \begin{bmatrix}
|
||||
\u_{1,t}^k \sigma'((\x_t^k)^T \u_{1,t}^k) & \dots & \u_{d,t}^k \sigma'((\x_t^k)^T \u_{d,t}^k)
|
||||
\end{bmatrix} \in \mathbb{R}^{d \times d}
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
The gradient w.r.t. the second argument is:
|
||||
\[
|
||||
\begin{split}
|
||||
\nabla_{[\u_t^k]} f(\x_t^k, \u_t^k)
|
||||
&= \begin{bmatrix}
|
||||
\nabla_{[\u_t^k]} f_1(\x_t^k, \u_t^k) & \dots & \nabla_{[\u_t^k]} f_d(\x_t^k, \u_t^k)
|
||||
\end{bmatrix} \\
|
||||
&= \begin{bmatrix}
|
||||
\x_t^k \sigma'((\x_t^k)^T \u_{1,t}^k) & \dots & 0_d \\
|
||||
0_d & \ddots & 0_d \\
|
||||
\vdots & & \vdots \\
|
||||
0_d & \dots & \x_t^k \sigma'((\x_t^k)^T \u_{d,t}^k)
|
||||
\end{bmatrix} \in \mathbb{R}^{d^2 \times d}
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
When computing $\nabla_{[\u_t^k]} f(\x_t^k, \u_t^k) \lambda_{t+1}$, a summation is sufficient instead of performing the complete matrix multiplication:
|
||||
\[
|
||||
\begin{bmatrix}
|
||||
\x_t^k \sigma'((\x_t^k)^T \u_{1,t}^k) & \dots & 0_d \\
|
||||
0_d & \ddots & 0_d \\
|
||||
\vdots & & \vdots \\
|
||||
0_d & \dots & \x_t^k \sigma'((\x_t^k)^T \u_{d,t}^k)
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
\lambda_{1,t+1} \\ \vdots \\ \lambda_{d,t+1}
|
||||
\end{bmatrix}
|
||||
\]
|
||||
\end{remark}
|
||||
|
||||
\item[Backpropagation (multiple samples)] \marginnote{Backpropagation (multiple samples)}
|
||||
With $M$ data points, $\Delta \u_t^{m,k}$ is computed individually for each example and the update step is performed as:
|
||||
\[
|
||||
\u_t^{k+1} = \u_t^k - \alpha^k \sum_{m=1}^{M} \Delta \u_t^{m,k}
|
||||
\]
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Federated machine learning}
|
||||
|
||||
\begin{description}
|
||||
\item[Federated machine learning] \marginnote{Federated machine learning}
|
||||
Given a parameter server and $N$ agents each with $M_i$ data points, the problem is defined as:
|
||||
\[ \min_\u \sum_{i=1}^{N} \sum_{m=1}^{M_i} l(\phi(\mathcal{D}^m; \u); p^m) = \min_\u \sum_{i=1}^{N} J_i(\u) \]
|
||||
Communication is only between the parameter server and the agents.
|
||||
|
||||
\item[Federated backpropagation] \marginnote{Federated backpropagation}
|
||||
Algorithm that works as follows:
|
||||
\begin{enumerate}
|
||||
\item Repeat for the number of iterations $k = 0, 1, \dots$:
|
||||
\begin{enumerate}
|
||||
\item The parameter server sends the current weights $\u_k$ to the agents.
|
||||
\item Each agent computes the step direction $\vec{d}_i^k = -\nabla J_i(\u^k)$ and sends it to the parameter server.
|
||||
\item The parameter server performs the update step:
|
||||
\[ \u^{k+1} = \u^k + \alpha^k \sum_{i=1}^{N} \vec{d}_i^k \]
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Distributed machine learning}
|
||||
|
||||
\begin{description}
|
||||
\item[Distributed machine learning] \marginnote{Distributed machine learning}
|
||||
Given $N$ agents each with $M_i$ data points, the problem is defined as:
|
||||
\[ \min_\u \sum_{i=1}^{N} \sum_{m=1}^{M_i} l(\phi(\mathcal{D}^m; \u); p^m) = \min_\u \sum_{i=1}^{N} J_i(\u) \]
|
||||
Communication is only between neighboring agents.
|
||||
|
||||
\item[Distributed backpropagation] \marginnote{Distributed backpropagation}
|
||||
Algorithm that works as follows:
|
||||
\begin{enumerate}
|
||||
\item Repeat for the number of iterations $k = 0, 1, \dots$:
|
||||
\begin{enumerate}
|
||||
\item Each agent sends its local weights $\u_i^k$ to its neighbors.
|
||||
\item Each agent computes the local step direction $\vec{d}_i^k = -\nabla J_i\left( \sum_{j \in \mathcal{N}_i} a_{ij}\u_j^k \right)$.
|
||||
\item Each agent performs the local update step:
|
||||
\[ \u_i^{k+1} = \sum_{j \in \mathcal{N}_i} \left( a_{ij} \u_j^k + \alpha^k \vec{d}_i^k \right) \]
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
\end{description}
|
||||
@ -34,7 +34,7 @@
|
||||
\item[Convex set] \marginnote{Convex set}
|
||||
A set $Z \subseteq \mathbb{R}^d$ is convex if it holds that:
|
||||
\[
|
||||
\forall \z_A, \z_B \in Z: \Big( \exists \alpha \in [0, 1]: (\alpha \z_A + (1-\alpha)\z_B) \in Z \Big)
|
||||
\forall \z_A, \z_B \in Z: \Big( \forall \alpha \in [0, 1]: (\alpha \z_A + (1-\alpha)\z_B) \in Z \Big)
|
||||
\]
|
||||
|
||||
\begin{figure}[H]
|
||||
@ -45,7 +45,7 @@
|
||||
\item[Convex function] \marginnote{Convex function}
|
||||
Given a convex set $Z \subseteq \mathbb{R}^d$, a function $l: Z \rightarrow \mathbb{R}$ is convex if it holds that:
|
||||
\[
|
||||
\forall \z_A, \z_B \in Z: \Big( \exists \alpha \in [0, 1]: l(\alpha \z_A + (1-\alpha) \z_B) \leq \alpha l(\z_A) + (1-\alpha) l(\z_B) \Big)
|
||||
\forall \z_A, \z_B \in Z: \Big( \forall \alpha \in [0, 1]: l(\alpha \z_A + (1-\alpha) \z_B) \leq \alpha l(\z_A) + (1-\alpha) l(\z_B) \Big)
|
||||
\]
|
||||
|
||||
\begin{figure}[H]
|
||||
@ -67,7 +67,7 @@
|
||||
Given a convex set $Z \subseteq \mathbb{R}^d$, a function $l: Z \rightarrow \mathbb{R}$ is strongly convex with parameter $\mu > 0$ if it holds that:
|
||||
\[
|
||||
\begin{split}
|
||||
\forall \z_A, \z_B \in Z, \z_A \neq \z_B: \Big( \exists \alpha \in (0, 1)&: l(\alpha \z_A + (1-\alpha) \z_B) < \\
|
||||
\forall \z_A, \z_B \in Z, \z_A \neq \z_B: \Big( \forall \alpha \in (0, 1)&: l(\alpha \z_A + (1-\alpha) \z_B) < \\
|
||||
&\alpha l(\z_A) + (1-\alpha) l(\z_B) - \frac{1}{2} \mu \alpha (1-\alpha) \Vert \z_A-\z_B \Vert^2 \Big)
|
||||
\end{split}
|
||||
\]
|
||||
@ -611,7 +611,7 @@
|
||||
|
||||
\begin{description}
|
||||
\item[Distributed gradient algorithm] \marginnote{Distributed gradient algorithm}
|
||||
Method that estimates a (more precise) set of parameters as a weighted sum those of its neighbors' (self-loop included):
|
||||
Method that estimates a (more precise) set of parameters as a weighted sum of those of its neighbors' (self-loop included):
|
||||
\[
|
||||
\vec{v}_i^{k+1} = \sum_{j \in \mathcal{N}_i} a_{ij} \z_j^k
|
||||
\]
|
||||
@ -718,7 +718,7 @@
|
||||
\[ \vec{r}_i^k = \nabla l_i(\z_i^k) \]
|
||||
Then, the estimate of the average signal (i.e., gradient) is given by:
|
||||
\[
|
||||
\vec{s}_i^{k+1} = \sum_{j \in \mathcal{N}_i} a_{ij} \vec{s}_j^k + \left( \nabla l_i(\z_i^{k+1}) - \nabla l_i(\z_i^k) \right)
|
||||
\vec{s}_i^{k+1} = \sum_{j \in \mathcal{N}_i} a_{ij} \vec{s}_j^k + \left( \nabla l_i(\z_i^{k+1}) - \nabla l_i(\z_i^k) \right) \qquad \s_i^0 = \nabla l_i(\z_i^0)
|
||||
\]
|
||||
The update step is then performed as:
|
||||
\[ \z_i^{k+1} = \sum_{j \in \mathcal{N}_i} a_{ij} \z_j^k - \alpha \vec{s}_i^k \]
|
||||
@ -748,9 +748,207 @@
|
||||
\,\,\land\,\,
|
||||
\rho \Vert \z_i^{k+1} - \z^* \Vert \leq \rho^k \Vert \z_i^0 - \z^* \Vert
|
||||
\]
|
||||
|
||||
\indenttbox
|
||||
\begin{remark}
|
||||
It can be shown that gradient tracking also works with non-convex optimization and, under the correct assumptions, converges to a stationary point.
|
||||
\end{remark}
|
||||
\end{theorem}
|
||||
\end{description}
|
||||
|
||||
\begin{remark}
|
||||
It can be shown that gradient tracking also works with non-convex optimization and, under the correct assumptions, converges to a stationary point.
|
||||
\end{remark}
|
||||
|
||||
\begin{subappendices}
|
||||
|
||||
\section{Appendix: Gradient tracking optimality and stability proof}
|
||||
|
||||
\begin{theorem}[Gradient tracking algorithm optimality] \marginnote{Gradient tracking algorithm optimality}
|
||||
If:
|
||||
\begin{itemize}
|
||||
\item $\matr{A}$ is the adjacency matrix of an undirected and connected communication graph $G$ such that it is doubly stochastic and $a_{ij} > 0$.
|
||||
\item Each cost function $l_i$ is $\mu$-strongly convex and its gradient $L$-Lipschitz continuous.
|
||||
\end{itemize}
|
||||
Then, there exists $\alpha^* > 0$ such that, for any choice of the step size $\alpha \in (0, \alpha^*)$, the sequence of local solutions $\{ \z_i^k \}_{k \in \mathbb{N}}$ of each agent generated by the gradient tracking algorithm asymptotically converges to a consensual optimal solution $\z^*$:
|
||||
\[ \lim_{k \rightarrow \infty} \Vert \z_i^k - \z^* \Vert = 0 \]
|
||||
|
||||
Moreover, the convergence rate is linear and stability is exponential:
|
||||
\[
|
||||
\exists \rho \in (0,1): \Vert \z_i^k - \z^* \Vert \leq \rho \Vert \z_i^{k+1} - \z^* \Vert
|
||||
\,\,\land\,\,
|
||||
\rho \Vert \z_i^{k+1} - \z^* \Vert \leq \rho^k \Vert \z_i^0 - \z^* \Vert
|
||||
\]
|
||||
|
||||
\begin{proof}
|
||||
Consider the gradient tracking algorithm written in matrix form:
|
||||
\[
|
||||
\begin{aligned}
|
||||
\z^{k+1} &= \A \z^k - \alpha \s^k \\
|
||||
\s^{k+1} &= \A \s^k + (\nabla \vec{l}(\z^{k+1}) - \nabla \vec{l}(\z^k))
|
||||
\end{aligned}
|
||||
\]
|
||||
where $\nabla \vec{l}(\z^k) = \begin{bmatrix} l_1(\z^k_1) & \dots & l_N(\z^k_N) \end{bmatrix}$.
|
||||
|
||||
% \begin{remark}
|
||||
% In the vector case, the Kronecker product should be applied on $\A$.
|
||||
% \end{remark}
|
||||
|
||||
\begin{description}
|
||||
\item[Equilibrium]
|
||||
We want to find the equilibrium points $(\z_\text{eq}, \s_\text{eq})$ that satisfies:
|
||||
\[
|
||||
\begin{aligned}
|
||||
\s_\text{eq} &= \A \s_\text{eq} + \nabla \vec{l}(\z_\text{eq}) - \nabla \vec{l}(\z_\text{eq}) &\iff& (\matr{I} - \A) \s_\text{eq} = 0 \\
|
||||
\z_\text{eq} &= \A\z_\text{eq} - \alpha \s_\text{eq} &\iff& (\matr{I} - \A) \z_\text{eq} = -\alpha \s_\text{eq} \\
|
||||
\end{aligned}
|
||||
\]
|
||||
It must be that:
|
||||
\begin{itemize}
|
||||
\item $\s_\text{eq} \in \text{ker}(\matr{I} - \A) = \{ \vec{1}\beta_1 \mid \beta_1 \in \R \}$ (as $\A$ is doubly stochastic).
|
||||
\item $(\matr{I} - \A) \z_\text{eq} = - \alpha \vec{1} \beta_1$. As $\vec{1} (-\alpha \beta_1) \in \text{ker}(\matr{I} - \A)$, it must be that $\beta_1 = 0$ (as the image cannot be mapped into the kernel).
|
||||
\end{itemize}
|
||||
Therefore, we end up with:
|
||||
\[
|
||||
\begin{split}
|
||||
\s_\text{eq} &= \vec{1}\beta_1 = 0 \\
|
||||
\z_\text{eq} &= \A\z_\text{eq} - \alpha 0 = \matr{1} \beta_2 \quad \text{ i.e., eigenvector of $\A$} \\
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
In addition, by pre-multiplying the equation of $\s$ by $\vec{1}^T$, we obtain:
|
||||
\[
|
||||
\begin{split}
|
||||
\vec{1}^T \s^{k+1} &= \vec{1}^T \A \s^k + \vec{1}^T \nabla \vec{l}(\z^{k+1}) - \vec{1}^T \nabla \vec{l}(\z^{k}) \\
|
||||
&= \vec{1}^T \s^k + \vec{1}^T \nabla \vec{l}(\z^{k+1}) - \vec{1}^T \nabla \vec{l}(\z^{k})
|
||||
\end{split}
|
||||
\]
|
||||
Which shows the following invariance condition:
|
||||
\[
|
||||
\begin{aligned}
|
||||
\vec{1}^T \s^{k+1} - \vec{1}^T \nabla \vec{l}(\z^{k+1})
|
||||
&= \vec{1}^T \s^k - \vec{1}^T \nabla \vec{l}(\z^{k}) \\
|
||||
&= \vec{1}^T \s_\text{eq} - \vec{1}^T \nabla \vec{l}(\z_\text{eq}) \\
|
||||
&= \vec{1}^T \s^0 - \vec{1}^T \nabla \vec{l}(\z^{0}) \\
|
||||
\end{aligned}
|
||||
\]
|
||||
Thus, we have that:
|
||||
\[
|
||||
\begin{split}
|
||||
\vec{1}^T \s_\text{eq} - \vec{1}^T \nabla \vec{l}(\z_\text{eq})
|
||||
&= \vec{1}^T \s^0 - \vec{1}^T \nabla \vec{l}(\z^{0}) \\
|
||||
\iff 0 - \vec{1}^T \nabla \vec{l}(\vec{1}\beta_2) &= 0 \\
|
||||
\end{split}
|
||||
\]
|
||||
Then, it must be that $\z_\text{eq} = \vec{1}\beta_2$ is an optimum with $\beta_2 = z^*$.
|
||||
|
||||
\item[Stability]
|
||||
Apply the following change in coordinates:
|
||||
\[
|
||||
\begin{bmatrix}
|
||||
\z^k \\ \xi^k
|
||||
\end{bmatrix}
|
||||
\mapsto
|
||||
\begin{bmatrix}
|
||||
\tilde{\z}^k \\ \tilde{\xi}^k
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
\z^k - \vec{1}z^* \\
|
||||
\xi^k - \alpha \nabla \vec{l}(\vec{1}z^*)
|
||||
\end{bmatrix}
|
||||
\]
|
||||
So that the equilibrium of the system is shifted to $0$.
|
||||
|
||||
Then, exploit strong convexity to re-formulate the overall system in such a way that the Lyapunov theorem can be applied to prove exponential stability.
|
||||
% Change in coordinates to avoid having $\z^{k+1}$ in $\s^{k}$. The (non-linear) transformation is:
|
||||
% \[
|
||||
% \begin{bmatrix}
|
||||
% \z^k \\ \s^k
|
||||
% \end{bmatrix}
|
||||
% \mapsto
|
||||
% \begin{bmatrix}
|
||||
% \z^k \\ \vec{\xi}^k
|
||||
% \end{bmatrix}
|
||||
% =
|
||||
% \begin{bmatrix}
|
||||
% \z^k \\ \alpha (\nabla \vec{l}(\z^k) - \s^k)
|
||||
% \end{bmatrix}
|
||||
% \]
|
||||
|
||||
% \[
|
||||
% \begin{split}
|
||||
% \z^{k+1}
|
||||
% &= \A\z^k - \alpha ( \frac{1}{\alpha} \vec{\xi}^k + \nabla \vec{l}(\z^k) ) \\
|
||||
% \vec{\xi}^k
|
||||
% &= \alpha \nabla \vec{l}(\z^{k+1}) - \alpha (\A \s^k + \nabla \vec{l}(\z^{k+1}) - \nabla \vec{l} (\z^k)) \\
|
||||
% &= - \alpha \A (-\frac{1}{\alpha} \xi^k + \nabla \vec{l}(\z^k)) + \alpha \nabla \vec{l}(\z^k) \\
|
||||
% &= \A \vec{\xi}^k - \alpha(\A - \vec{I}) \nabla \vec{l}(\z^k)
|
||||
% \end{split}
|
||||
% \]
|
||||
|
||||
% In matrix form:
|
||||
% \[
|
||||
% \begin{bmatrix}
|
||||
% \z^{k+1} \\ \vec{\xi}^{k+1} = \begin{bmatrix}
|
||||
% \A & \matr{I} \\ 0 & \A
|
||||
% \end{bmatrix}
|
||||
% \begin{bmatrix}
|
||||
% \z^k \\ \vec{\xi}^k
|
||||
% \end{bmatrix}
|
||||
% - \alpha \begin{bmatrix}
|
||||
% \matr{I} \\ \A \matr{I}
|
||||
% \end{bmatrix}
|
||||
% \nabla \vec{l}(\z^k)
|
||||
% \end{bmatrix}
|
||||
% \]
|
||||
% The initialization is:
|
||||
% \[
|
||||
% \begin{split}
|
||||
% \z^0 \in \R^N \\
|
||||
% \vec{\xi}^{0} = \alpha (\nabla \vec{l}(\z^0) - \s^0) = 0
|
||||
% \end{split}
|
||||
% \]
|
||||
% The equilibrium has been shifted to:
|
||||
% \[
|
||||
% \begin{split}
|
||||
% \z_\text{eq} = \vec{1} \z^* \\
|
||||
% \vec{\xi}_\text{eq} = \alpha \nabla l(\vec{1} \z^*) = \alpha \begin{bmatrix}
|
||||
% \nabla l_1(\z^*) \\ \vdots \\ \nabla l_N(\z^*)
|
||||
% \end{bmatrix}
|
||||
% \end{split}
|
||||
% \]
|
||||
|
||||
|
||||
% \[
|
||||
% \begin{gathered}
|
||||
% \begin{bmatrix}
|
||||
% \z^{k+1} \\ \vec{\xi}^{k+1} = \begin{bmatrix}
|
||||
% \A & \matr{I} \\ 0 & \A
|
||||
% \end{bmatrix}
|
||||
% \begin{bmatrix}
|
||||
% \z^k \\ \vec{\xi}^k
|
||||
% \end{bmatrix}
|
||||
% \begin{bmatrix}
|
||||
% \matr{I} \\ \A \matr{I}
|
||||
% \end{bmatrix}
|
||||
% \u^k
|
||||
% \end{bmatrix} \\
|
||||
% \vec{y}^k = \begin{bmatrix}
|
||||
% \matr{I} & 0
|
||||
% \end{bmatrix}
|
||||
% \begin{bmatrix}
|
||||
% \z^k \\ \vec{\xi}^{k}
|
||||
% \end{bmatrix} \\
|
||||
% -- \\
|
||||
% \u^k = \nabla \vec{l}(\vec{y}^k)
|
||||
% \end{gathered}
|
||||
% \]
|
||||
|
||||
|
||||
% Take Lyapunov function $V(\tilde{\z}, \xi^k)$ and check whether:
|
||||
% \[
|
||||
% V(\tilde{\z}^{k+1}, \tilde{\xi}^{k+1}) - V(\tilde{\z}^{k}, \tilde{\xi}^{k}) \leq 0
|
||||
% \]
|
||||
\end{description}
|
||||
\end{proof}
|
||||
\end{theorem}
|
||||
|
||||
\end{subappendices}
|
||||
|
||||
@ -0,0 +1,338 @@
|
||||
\chapter{Safety controllers}
|
||||
|
||||
|
||||
\begin{description}
|
||||
\item[Control-affine non-linear dynamical system] \marginnote{Control-affine non-linear dynamical system}
|
||||
System whose dynamics follows:
|
||||
\[
|
||||
\dot{\x}(t) = f(\x(t)) + g(\x(t)) \u(t) \quad \x(0) = \x_0
|
||||
\]
|
||||
with $\x(t) \in \mathbb{R}^n$, $\u(t) \in U \subseteq \mathbb{R}^m$, $f(\x(t)) \in \mathbb{R}^n$, and $g(\x(t)) \in \mathbb{R}^{n \times m}$.
|
||||
|
||||
$f(\x(t))$ can be seen as the drift of the system and $\u(t)$ as a coefficient that controls how much $g(\x(t))$ is injected into $f(\x(t))$.
|
||||
|
||||
The overall system can be interpreted as composed of:
|
||||
\begin{itemize}
|
||||
\item A high-level controller that produces the direction $\u^\text{ref}(\x)$ towards the target position.
|
||||
\item A safety layer that modifies $\u^\text{ref}(\x)$ into $\u(t) = \kappa(\x)$ to account for obstacles.
|
||||
\end{itemize}
|
||||
|
||||
\item[Safety control] \marginnote{Safety control}
|
||||
Given a (sufficiently regular) function $V^s: X \subseteq \mathbb{R}^n \rightarrow \mathbb{R}$, it is possible to define a safe state set as:
|
||||
\[
|
||||
X^s = \{ \x \in X \subseteq \mathbb{R}^n \mid V^s(\x) \geq 0 \}
|
||||
\]
|
||||
|
||||
The goal is to design a feedback control law $\kappa^s: X \rightarrow \mathbb{R}^m$ for a control-affine non-linear dynamical system such that the set $X^s$ is forward invariant (i.e., any trajectory starting in $X^s$ remains in $X^s$).
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.25\linewidth]{./img/safety_control.png}
|
||||
\end{figure}
|
||||
|
||||
\begin{remark}
|
||||
The time derivative of $V^s(\x(t))$ along the system trajectories is given by:
|
||||
\[
|
||||
\begin{split}
|
||||
\frac{d}{dt} V^s(\x(t))
|
||||
&= \nabla V^s(\x(t))^T \frac{d}{dt} \x(t) \\
|
||||
&= \nabla V^s(\x(t))^T \Big( f(\x(t)) + g(\x(t)) \u(t) \Big) \\
|
||||
&= \nabla V^s(\x(t))^T f(\x(t)) + \sum_{h=1}^{m} \Big( \nabla V^s(\x(t))^T g_h(\x(t)) \u_h(t) \Big)\\
|
||||
&= L_f V^s(\x(t)) + L_g V^s(\x(t)) \u(t) \\
|
||||
\end{split}
|
||||
\]
|
||||
where $L_h V^s(\x(t)) = \nabla V^s(\x(t))^T h(\x(t))$ is the lie derivative.
|
||||
\end{remark}
|
||||
|
||||
\item[Control barrier function (CBF)] \marginnote{Control barrier function (CBF)}
|
||||
A function $V^s$ is a control barrier function if there exists a continuous strictly increasing function $\gamma: \mathbb{R} \rightarrow \mathbb{R}$ with $\gamma(0) = 0$ such that the following inequality (control barrier certificate) holds:
|
||||
\[
|
||||
\sup_{\u \in U} \{ L_fV^s(\x) + L_gV^s(\x)\u + \gamma(V^s(\x)) \} \geq 0 \quad \forall \x \in X
|
||||
\]
|
||||
$\gamma$ can be interpreted as a degree of movement freedom since, as long as it holds that $V^s(\x(t)) > 0$, it is allowed that $\frac{d}{dt} V^s(\x(t)) < 0$ (i.e., the agent can move closer to the border between safe and unsafe region).
|
||||
|
||||
\begin{remark}
|
||||
In principle, the negative part of $\gamma$ is not necessary (the agent should start in a safe area). However, as it is strictly increasing, it allows to move out the unsafe region if the agent ever ends up there.
|
||||
\end{remark}
|
||||
|
||||
\begin{example}
|
||||
A simple choice for $\gamma$ is a linear function $\gamma(r) = \gamma r$ with $\gamma > 0$.
|
||||
\end{example}
|
||||
|
||||
\item[Set of admissible safe controllers] \marginnote{Set of admissible safe controllers}
|
||||
The set of inputs that satisfy the control barrier certificate for a given state $\x$ is:
|
||||
\[
|
||||
U^s(\x) = \{ \u \in U \mid L_f V^s(\x) + L_g V^s(\x) \u + \gamma(V^s(\x)) \geq 0 \}
|
||||
\]
|
||||
\end{description}
|
||||
|
||||
|
||||
\section{Safety filter via control barrier certificate}
|
||||
|
||||
\begin{description}
|
||||
\item[Safety filter via control barrier certificate] \marginnote{Safety filter via control barrier certificate}
|
||||
Given a possibly unsafe reference input (from the high-level controller) $\u^\text{ref}(\x) \in \mathbb{R}^m$, the safety controller (i.e., rectifying controller) based on the control barrier certificate is designed to be minimally invasive (i.e., alter the reference as little as possible).
|
||||
|
||||
The policy $\u = \kappa^s(\x)$ can be defined as:
|
||||
\[
|
||||
\begin{gathered}
|
||||
\kappa^s(\x) = \arg\min_{\u \in U} \Vert \u - \u^\text{ref}(\x) \Vert^2 \\
|
||||
\text{subject to } -L_fV^s(\x) - L_gV^s(\x)\u - \gamma(V^s(\x)) \leq 0
|
||||
\end{gathered}
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
In the general case, this problem should be solved at each $t \geq 0$.
|
||||
\end{remark}
|
||||
|
||||
|
||||
\item[Single integrator model] \marginnote{Single integrator model}
|
||||
Control-affine non-linear dynamical system where $f(\x(t)) = 0$ and $g(\x(t)) = \matr{I}$. The dynamics is:
|
||||
\[
|
||||
\begin{split}
|
||||
\dot{\x}
|
||||
&= 0 + \matr{I}\u \\
|
||||
&= \u
|
||||
\end{split}
|
||||
\]
|
||||
with $\x \in \mathbb{R}^d$ and $\u \in \mathbb{R}^d$.
|
||||
|
||||
\begin{remark}
|
||||
In the case of single integrators, we have that:
|
||||
\begin{itemize}
|
||||
\item $L_f V^s(\x) = \nabla V^s(\x)^T 0 = 0$,
|
||||
\item $L_g V^s(\x) = \nabla V^s(\x)^T \matr{I} = \nabla V^s(\x)^T$.
|
||||
\end{itemize}
|
||||
Therefore:
|
||||
\[
|
||||
\begin{split}
|
||||
\frac{d}{dt} V^s(\x(t))
|
||||
&= L_f V^s(\x(t)) + L_g V^s(\x(t)) \u(t) \\
|
||||
&= \nabla V^s(\x(t))^T \u(t)
|
||||
\end{split}
|
||||
\]
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Single-robot obstacle avoidance with single integrator models}
|
||||
|
||||
\begin{description}
|
||||
\item[Single-robot obstacle avoidance] \marginnote{Single-robot obstacle avoidance}
|
||||
Task where the goal is to keep an agent to a safety distance $\Delta > 0$ from an obstacle.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.35\linewidth]{./img/safety_control_single.png}
|
||||
\end{figure}
|
||||
|
||||
A control barrier function to solve the task (i.e., rectify the trajectory of the high level controller) can be:
|
||||
\[
|
||||
V^s(\x) = \Vert \x - \x_\text{obs} \Vert^2 - \Delta^2
|
||||
\qquad
|
||||
\nabla V^s(\x) = 2(\x - \x_\text{obs})
|
||||
\]
|
||||
|
||||
The CBF-based safety policy $\kappa^s(\x)$ can be obtained by solving:
|
||||
\[
|
||||
\begin{gathered}
|
||||
\arg\min_{\u \in U} \Vert \u - \u^\text{ref}(\x) \Vert^2 \\
|
||||
\text{subject to } -2(\x-\x_\text{obs})^T \u - \gamma(\Vert \x-\x_\text{obs} \Vert^2 - \Delta^2) \leq 0
|
||||
\end{gathered}
|
||||
\]
|
||||
|
||||
As there are two constants in the constraint $a = -2(\x-\x_\text{obs})^T$ and $b = \gamma(\Vert \x-\x_\text{obs} \Vert^2 - \Delta^2)$, the problem can be reformulated as:
|
||||
% \[
|
||||
% \arg\min_{\u \in U} \u^T\u - 2\u^T\u^\text{ref} \quad \text{subject to } a^T \u + b \leq 0
|
||||
% \]
|
||||
\[
|
||||
\arg\min_{\u \in U} \Vert \u - \u^\text{ref}(\x) \Vert^2 \quad \text{subject to } a^T \u + b \leq 0
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
If $U$ is a polytope (or unconstrained: $U = \mathbb{R}^d$), the problem becomes a quadratic program.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Multi-robot collision avoidance with single integrator models}
|
||||
|
||||
|
||||
\begin{description}
|
||||
\item[Multi-robot collision avoidance] \marginnote{Multi-robot collision avoidance}
|
||||
Task with $N$ single integrator agents that want to keep a safety distance $\Delta > 0$ among them.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.35\linewidth]{./img/safety_control_multi.png}
|
||||
\end{figure}
|
||||
|
||||
The local control barrier function to solve the task can be defined as:
|
||||
\[
|
||||
V^s_{i,j}(\x_i, \x_j) = \Vert \x_i - \x_j \Vert^2 - \Delta^2
|
||||
\qquad
|
||||
\begin{aligned}
|
||||
\nabla_{[\x_i]} V_{i,j}^s(\x_i, \x_j) &= 2(\x_i - \x_j) \\
|
||||
\nabla_{[\x_j]} V_{i,j}^s(\x_i, \x_j) &= 2(\x_j - \x_i)
|
||||
\end{aligned}
|
||||
\]
|
||||
The safe region $X_i$ for agent $i$ can be defined as:
|
||||
\[
|
||||
X_i = \{ \x \in \mathbb{R}^d \mid \forall j \in \mathcal{N}_i: V_{i,j}^s(\x) \geq 0 \}
|
||||
\]
|
||||
|
||||
The set of admissible controllers is:
|
||||
\[
|
||||
\begin{aligned}
|
||||
\begin{aligned}
|
||||
U^s(\x) = \Big\{ \u \in \mathbb{R}^{dN} \mid
|
||||
-\nabla_{[\x_i]} V_{ij}^s(\x_i, \x_j)^T \u_i
|
||||
- \nabla_{[\x_i]} V_{ji}^s(\x_j, \x_i)^T \u_j
|
||||
- &\gamma(V_{ij}^{s}(\x_i, \x_j)) \leq 0 \\
|
||||
&\forall j \in \mathcal{N}_i, \forall i \in \{1, \dots, N\} \Big\}
|
||||
\end{aligned} \\
|
||||
= \Big\{ \u \in \mathbb{R}^{dN} \mid -2(\x_i-\x_j)^T \u_i - 2(\x_j-\x_i)^T \u_j - \gamma(V_{ij}^s(\x_i, \x_j)) \leq 0 \,\,\forall j \in \mathcal{N}_i, \forall i \in \{1, \dots, N\} \Big\}
|
||||
\end{aligned}
|
||||
\]
|
||||
|
||||
% \[
|
||||
% L_g V_{ij}^s(\x) = \nabla_{[\x_i]} V^s(\x_i, \x_j)^T \u_i + \nabla_{[\x_j]} V^s(\x_i, \x_j)^T \u_j
|
||||
% \]
|
||||
\end{description}
|
||||
|
||||
\begin{description}
|
||||
\item[Centralized safety controller] \marginnote{Centralized safety controller}
|
||||
The CBF-based policy can be obtained by solving:
|
||||
\[
|
||||
\begin{gathered}
|
||||
\arg\min_{\u \in \mathbb{R}^N} \sum_{i=1}^{N} \Vert \u_i - \u_i^\text{ref} \Vert^2 \\
|
||||
\begin{aligned}
|
||||
\text{subject to }
|
||||
&-2(\x_i-\x_j)^T \u_i - 2(\x_j-\x_i)^T \u_j - \gamma(V_{ij}^s(\x_i, \x_j)) \leq 0 \\
|
||||
& \Vert \u_i \Vert \leq \u_i^\text{max} \\
|
||||
& \forall j \in \mathcal{N}_i, \forall i \in \{ 1, \dots, N \}
|
||||
\end{aligned}
|
||||
\end{gathered}
|
||||
\]
|
||||
where $\u_i^\text{ref}$ is the reference input of the high level controller and $\u_i^\text{max}$ is the bound.
|
||||
|
||||
\begin{remark}
|
||||
The policy should be computed continuously for each $\x_i(t)$.
|
||||
\end{remark}
|
||||
|
||||
\item[Decentralized safety controller] \marginnote{Decentralized safety controller}
|
||||
The CBF-based policy can be obtained by solving a more constrained problem compared to the centralized formulation:
|
||||
\[
|
||||
\begin{gathered}
|
||||
\arg\min_{\u_i \mathbb{R}^d} \Vert \u_i - \u_i^\text{ref} \Vert^2 \\
|
||||
\begin{aligned}
|
||||
\text{subject to } &- \nabla_{[\x_i]} V_{ij}^s(\x_i, \x_j)^T \u_i - \frac{1}{2} \gamma (V_{ij}^s(\x_i, \x_j)) \leq 0 \\
|
||||
& \Vert \u_i \Vert \leq \u_i^\text{max} \\
|
||||
& \forall j \in \mathcal{N}_i
|
||||
\end{aligned}
|
||||
\end{gathered}
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
If $\forall i \in \{1, \dots, N\}: \nabla_{[\x_i]} V_{ij}^s(\x_i, \x_j)^T \u_i \geq \frac{1}{2} \gamma (V_{ij}^s(\x_i, \x_j))$, then it holds that:
|
||||
\[
|
||||
\begin{split}
|
||||
\nabla_{[\x_i]} V_{ij}^s(\x_i, \x_j)^T \u_i + \nabla_{[\x_i]} V_{ji}^s(\x_j, \x_i)^T \u_j
|
||||
&\geq -\frac{1}{2} \gamma\left( V_{ij}^s(\x_i, \x_j) \right) - \frac{1}{2} \gamma\left( V_{ji}^s(\x_j, \x_i) \right) \\
|
||||
&\geq - \gamma\left( V_{ij}^s(\x_i, \x_j) \right)
|
||||
\end{split}
|
||||
\]
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Multi-robot collision avoidance with unicycle control}
|
||||
|
||||
\begin{description}
|
||||
\item[Unicycle model with non-holonomic constraints]
|
||||
Model that captures the constraints given by wheels. Its dynamics is:
|
||||
\[
|
||||
\begin{split}
|
||||
\dot{\vec{p}}_x &= v \cos(\theta) \\
|
||||
\dot{\vec{p}}_y &= v \sin(\theta) \\
|
||||
\dot{\theta} &= \omega \\
|
||||
\end{split}
|
||||
\]
|
||||
where:
|
||||
\begin{itemize}
|
||||
\item $(\vec{p}_x, \vec{p}_y)$ is the position of the center of mass,
|
||||
\item $\dot{\theta}$ is the orientation,
|
||||
\item $v$ is the linear velocity,
|
||||
\item $\omega$ is the angular velocity.
|
||||
\end{itemize}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.25\linewidth]{./img/unicycle_model.png}
|
||||
\end{figure}
|
||||
|
||||
\begin{remark}
|
||||
It is assumed that the robot does not drift sideways ($v_{\bot} = 0$).
|
||||
\end{remark}
|
||||
|
||||
\item[Single integrator to unicycle control mapping] \marginnote{Single integrator to unicycle control mapping}
|
||||
Consider a point $\x^\text{int}$ longitudinal to $v$ that is not the barycenter:
|
||||
\[
|
||||
\x^\text{int} = \begin{bmatrix}
|
||||
\vec{p}_x \\ \vec{p}_y
|
||||
\end{bmatrix}
|
||||
+
|
||||
\rho \begin{bmatrix}
|
||||
\cos(\theta) \\ \sin(\theta)
|
||||
\end{bmatrix}
|
||||
\]
|
||||
where $\rho > 0$ is the distance to the barycenter.
|
||||
|
||||
By differentiating w.r.t. time, the dynamics is:
|
||||
\[
|
||||
\dot{\x}^\text{int} = \begin{bmatrix}
|
||||
\dot{\vec{p}}_x \\ \dot{\vec{p}}_y
|
||||
\end{bmatrix}
|
||||
+
|
||||
\rho \dot{\theta} \begin{bmatrix}
|
||||
- \sin(\theta) \\ \cos(\theta)
|
||||
\end{bmatrix}
|
||||
\]
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.2\linewidth]{./img/single_unicycle_map.png}
|
||||
\end{figure}
|
||||
|
||||
By using the unicycle model dynamics, it becomes:
|
||||
\[
|
||||
\begin{split}
|
||||
\dot{\x}^\text{int} &= \begin{bmatrix}
|
||||
\cos(\theta) & -\rho\sin(\theta) \\
|
||||
\sin(\theta) & \rho\cos(\theta) \\
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
v \\ \omega
|
||||
\end{bmatrix} \\
|
||||
\dot{\theta} &= \omega
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
By formulating $v$ and $\omega$ as a state-feedback control with input $\u^\text{int} \in \mathbb{R}^2$ as:
|
||||
\[
|
||||
\begin{bmatrix}
|
||||
v \\ \omega
|
||||
\end{bmatrix}
|
||||
=
|
||||
\begin{bmatrix}
|
||||
\cos(\theta) & \sin(\theta) \\
|
||||
-\frac{1}{\rho} \sin(\theta) & \frac{1}{\rho} \cos(\theta)
|
||||
\end{bmatrix} \u^\text{int}
|
||||
\]
|
||||
The result is a single-integrator $\dot{\x}^\text{int} = g(\x)\u^\text{int}$.
|
||||
|
||||
A choice of $\u$ can be:
|
||||
\[
|
||||
\u^\text{int} = k (\x^\text{int} - \x^\text{dest}) + \dot{\x}^\text{dest}
|
||||
\]
|
||||
\end{description}
|
||||
@ -10,10 +10,6 @@
|
||||
{
|
||||
"name": "Ethics module 2",
|
||||
"path": "module2/ethics2.pdf"
|
||||
},
|
||||
{
|
||||
"name": "Ethics module 3",
|
||||
"path": "module3/ethics3.pdf"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -18,7 +18,7 @@
|
||||
AI systems could undermine this right if used for surveillance, profiling, automated assessment, manipulation, or interference.
|
||||
|
||||
\item[Right to equality and non-discrimination]
|
||||
Digitally disadvantaged individuals might be excluded from accessing AI system or exploited. AI systems themselves can be biased and reproduce existing discriminatory practices.
|
||||
Digitally disadvantaged individuals might be excluded from accessing AI systems or exploited by it. AI systems themselves can be biased and reproduce existing discriminatory practices.
|
||||
|
||||
\item[Right to privacy]
|
||||
Related to the right of a person to make autonomous decisions, and to have control of the data collected and how it is processed.
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
\begin{description}
|
||||
\item[Morality] \marginnote{Morality}
|
||||
There is no widely agreed definition of morality. On a high level, it refers to norms to determine which actions are right and wrong.
|
||||
There is no widely agreed upon definition of morality. On a high-level, it refers to norms to determine which actions are right or wrong.
|
||||
\end{description}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
Field that uses scientific techniques to study how people reason and act.
|
||||
|
||||
\item[Meta-ethics] \marginnote{Meta-ethics}
|
||||
Field that analysis the language, concepts, and methods of reasoning in normative ethics. Some research questions are ``can ethical judgments be true or false?'', ``does morality correspond to facts in the world?'', \dots
|
||||
Field that analyzes the language, concepts, and methods of reasoning in normative ethics. Some research questions are ``can ethical judgments be true or false?'', ``does morality correspond to facts in the world?'', \dots
|
||||
\end{description}
|
||||
\end{description}
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
\begin{itemize}
|
||||
\item It is too demanding on the individuals as it requires constant self-sacrifice.
|
||||
\item It does not provide a decision procedure or a way to assess decisions.
|
||||
\item It has no room for impartiality (i.e., a family member is as important as a stranger).
|
||||
\item It has no room for partiality (i.e., a family member is as important as a stranger).
|
||||
\item If the majority of society is against a minority group, unjust actions against the minority increases the overall world's well-being.
|
||||
\end{itemize}
|
||||
\end{remark}
|
||||
@ -239,7 +239,7 @@
|
||||
\end{remark}
|
||||
|
||||
\item[Categorical imperatives] \marginnote{Categorical imperatives}
|
||||
Imperatives that do not depend on a single individual but are applicable to every rational beings. Categorical imperatives command to do things that one might want or not want to do. Disregarding them makes one irrational.
|
||||
Imperatives that do not depend on a single individual but are applicable to every rational being. Categorical imperatives command to do things that one might want or not want to do. Disregarding them makes one irrational.
|
||||
|
||||
\begin{remark}
|
||||
According to Kant's \textit{argument for the irrationality of immorality}, moral duties are categorical imperatives:
|
||||
@ -293,7 +293,7 @@
|
||||
|
||||
\begin{description}
|
||||
\item[Proceduralism] \marginnote{Proceduralism}
|
||||
Approach to ethics that does not start by make assumptions on any basic moral views but rather follows a procedure to show that they are morally right.
|
||||
Approach to ethics that does not start by making assumptions on any basic moral views but rather follows a procedure to show that they are morally right.
|
||||
|
||||
\begin{remark}
|
||||
The golden rule, rule consequentialism, Kant's principle of universalizability are all instances of proceduralism.
|
||||
@ -316,17 +316,17 @@
|
||||
\end{remark}
|
||||
|
||||
\item[Contractarianism (moral)] \marginnote{Contractarianism (moral)}
|
||||
Ethical theory which states that actions are morally right if and only if they would be accepted by free, equal, and rational people, on the condition that everyone obey to these rules.
|
||||
Ethical theory which states that actions are morally right if and only if they would be accepted by free, equal, and rational people, on the condition that everyone obeys to these rules.
|
||||
\end{description}
|
||||
|
||||
\begin{description}
|
||||
\item[Prisoner's dilemma] \marginnote{Prisoner's dilemma}
|
||||
Situation where the best outcome would be obtained if everyone stops pursuing their self-interest.
|
||||
Situation where the best outcome would be obtained if everyone stops pursuing its self-interest.
|
||||
|
||||
\begin{table}[H]
|
||||
\caption{
|
||||
\parbox[t]{0.7\linewidth}{
|
||||
Scenario that the dilemma takes inspiration from: two prisoners are interrogated separately, they can either stay silent (cooperate) or snitch the other (betray). The numbers are the years in prison each of them would get.
|
||||
Scenario that the dilemma takes inspiration from: two prisoners are interrogated separately; they can either stay silent (cooperate) or snitch the other (betray). The numbers are the years in prison each of them would get.
|
||||
}
|
||||
}
|
||||
\centering
|
||||
@ -354,7 +354,7 @@
|
||||
\begin{description}
|
||||
\item[Contractarianism characteristics] \phantom{}
|
||||
\begin{itemize}
|
||||
\item Morality is a social phenomenon: moral rules are basically rules of cooperation. There are no self-regarding moral duties, so any action that do not have bearing on others is morally right.
|
||||
\item Morality is a social phenomenon: moral rules are basically rules of cooperation. There are no self-regarding moral duties, so any action that does not have bearing on others is morally right.
|
||||
\item Basic moral rules are justified.
|
||||
\begin{descriptionlist}
|
||||
\item[Veil of ignorance] \marginnote{Veil of ignorance}
|
||||
@ -363,7 +363,7 @@
|
||||
\item Each person will prioritize basic liberties, which will match those of everyone.
|
||||
\item Social and economic inequalities are allowed if everyone has equal access to those positions and the benefits should be aimed to the least advantaged members of society.
|
||||
\end{enumerate}
|
||||
Overall, what will be selected is going match the basic moral rules.
|
||||
Overall, what will be selected is going to match the basic moral rules.
|
||||
\end{descriptionlist}
|
||||
\item There is a procedure to determine if an action is right or wrong: ask whether free, equal, and rational people would agree to rules that allow that action.
|
||||
\item Contractarianism justifies the origin of morality as originated from the same society we live in, but in a more rational and free version.
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Opportunities and risks of AI for society}
|
||||
\subsection{Opportunities and risks of AI on society}
|
||||
|
||||
This chapter identifies four opportunity-risk points of AI systems:
|
||||
\begin{descriptionlist}
|
||||
@ -54,7 +54,6 @@ This chapter identifies four opportunity-risk points of AI systems:
|
||||
\subsection{Unified framework of principles for AI in society}
|
||||
|
||||
This chapter groups and presents the common principles used by different organizations and initiatives.
|
||||
|
||||
Most of them overlap with the principles of bioethics:
|
||||
\begin{descriptionlist}
|
||||
\item[Beneficence] \marginnote{Beneficence}
|
||||
@ -84,7 +83,7 @@ This chapter presents 20 action points of four types:
|
||||
\item[Assessment] \phantom{}
|
||||
\begin{itemize}
|
||||
\item Assess the capabilities of existing institutions in dealing with harms caused by AI systems.
|
||||
\item Assess which task should not be delegated to AI systems.
|
||||
\item Assess which tasks should not be delegated to AI systems.
|
||||
\item Assess whether current regulations are sufficiently grounded in ethics.
|
||||
\end{itemize}
|
||||
|
||||
@ -148,7 +147,7 @@ This chapter presents 20 action points of four types:
|
||||
\end{remark}
|
||||
|
||||
\item[Ethical] \marginnote{Ethical}
|
||||
AI must be in line with ethical principles and values (i.e., moral AI) for which laws might be lacking or unsuited for the purpose.
|
||||
AI must be in line with ethical principles and values (i.e., moral AI) for which laws might be lacking or be unsuited for the purpose.
|
||||
|
||||
\item[Robust] \marginnote{Robust}
|
||||
AI must be technically and socially robust in order to minimize intentional or unintentional harm.
|
||||
@ -217,10 +216,10 @@ The concept of AI ethics presented in the framework is rooted to the fundamental
|
||||
Seen as legally enforceable rights, fundamental rights can be considered as part of the \textsc{lawful} AI component. Seen as the rights of everyone, from a moral status, they fall within the \textsc{ethical} AI component.
|
||||
\end{remark}
|
||||
|
||||
This chapter describes four ethical principle for trustworthy AI based on fundamental rights:
|
||||
This chapter describes four ethical principles for trustworthy AI based on fundamental rights:
|
||||
\begin{descriptionlist}
|
||||
\item[Principle of respect for human autonomy] \marginnote{Principle of respect for human autonomy}
|
||||
AI users should keep full self-determination. AI systems should be human-centric leaving room for human choices and they should not manipulate them.
|
||||
AI users should keep full self-determination. AI systems should be human-centric leaving room for human choices and be without manipulation.
|
||||
|
||||
% AI should empower individuals and not control and restrict freedom. Vulnerable groups need extra protection.
|
||||
|
||||
@ -284,7 +283,7 @@ The main requirements the framework defines are:
|
||||
\item Possible unintended uses or abuse of the system should be taken into account and mitigated.
|
||||
\item There should be fallback plans in case of problems (e.g., switching from a statistical to a rule-based algorithm, asking a human, \dots).
|
||||
\item There should be an explicit evaluation process to assess the accuracy of the AI system and determine its error rate.
|
||||
\item The output of an AI system should be reliable (robust to a wide range of inputs) and reproducible.
|
||||
\item The output of an AI system should be reliable (i.e., robust to a wide range of inputs) and reproducible.
|
||||
\end{itemize}
|
||||
|
||||
\item[Privacy and data governance] \marginnote{Privacy and data governance}
|
||||
@ -326,7 +325,7 @@ The main requirements the framework defines are:
|
||||
The impact of AI systems should also consider society in general and the environment (principles of fairness and prevention of harm):
|
||||
\begin{itemize}
|
||||
\item The environmental impact of the lifecycle of an AI system should be assessed.
|
||||
\item The effects of AI systems on people's physical and mental well-being, as well as institutions, democracy, and society should be assessed and monitored.
|
||||
\item The effects of AI systems on people's physical and mental well-being, as well as on institutions, democracy, and society should be assessed and monitored.
|
||||
\end{itemize}
|
||||
% AI should not have negative impacts on the society and environment.
|
||||
|
||||
@ -379,7 +378,7 @@ The chapter also describes some technical and non-technical methods to ensure tr
|
||||
Organizations should appoint a person or a board for decisions regarding ethics.
|
||||
|
||||
\item[Education and awareness]
|
||||
Educate, and train involved stakeholders.
|
||||
Educate and train involved stakeholders.
|
||||
|
||||
\item[Stakeholder participation and social dialogue]
|
||||
Ensure open discussions between stakeholders and involve the general public.
|
||||
|
||||
@ -8,7 +8,11 @@
|
||||
\begin{document}
|
||||
|
||||
\makenotesfront
|
||||
\include{./sections/_gdpr.tex}
|
||||
\include{./sections/_claudette.tex}
|
||||
|
||||
\input{./sections/_gdpr.tex}
|
||||
\input{./sections/_claudette.tex}
|
||||
\input{./sections/_discrimination.tex}
|
||||
\input{./sections/_autonomous_vehicles.tex}
|
||||
\input{./sections/_ai_act.tex}
|
||||
\eoc
|
||||
|
||||
\end{document}
|
||||
BIN
src/year2/ethics-in-ai/module2/img/decision_anatomy.png
Normal file
|
After Width: | Height: | Size: 293 KiB |
BIN
src/year2/ethics-in-ai/module2/img/gemini_diversity.png
Normal file
|
After Width: | Height: | Size: 595 KiB |
BIN
src/year2/ethics-in-ai/module2/img/human_driving_crash.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
src/year2/ethics-in-ai/module2/img/pasmoc2_thresholds.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
src/year2/ethics-in-ai/module2/img/sapmoc_density.png
Normal file
|
After Width: | Height: | Size: 235 KiB |
BIN
src/year2/ethics-in-ai/module2/img/self_driving_crash.png
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
src/year2/ethics-in-ai/module2/img/stable_diffusion_ceo.png
Normal file
|
After Width: | Height: | Size: 390 KiB |
BIN
src/year2/ethics-in-ai/module2/img/stable_diffusion_nurse.png
Normal file
|
After Width: | Height: | Size: 426 KiB |
BIN
src/year2/ethics-in-ai/module2/img/tech_workforce.png
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
src/year2/ethics-in-ai/module2/img/trolley_problem.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
343
src/year2/ethics-in-ai/module2/sections/_ai_act.tex
Normal file
@ -0,0 +1,343 @@
|
||||
\chapter{AI Act}
|
||||
|
||||
|
||||
\section{Introduction}
|
||||
|
||||
|
||||
\subsection{General principles}
|
||||
\marginnote{General principles}
|
||||
|
||||
Regulate the development of AI systems based on the principles of:
|
||||
\begin{itemize}
|
||||
\item Human agency and oversight,
|
||||
\item Technical robustness and safety,
|
||||
\item Privacy and data governance,
|
||||
\item Transparency,
|
||||
\item Diversity, non-discrimination, and fairness,
|
||||
\item Social and environmental well-being.
|
||||
\end{itemize}
|
||||
|
||||
|
||||
\subsection{Definitions}
|
||||
|
||||
\begin{description}
|
||||
\item[AI system] \marginnote{AI system}
|
||||
Machine-based system that is designed to operate with varying levels of autonomy and adaptability. Moreover, its output is inferred from the input data.
|
||||
|
||||
\begin{remark}
|
||||
Rule-based systems are excluded.
|
||||
\end{remark}
|
||||
|
||||
\item[General purpose AI] \marginnote{General purpose AI}
|
||||
AI system that exhibits significant generality and is able to perform a wide range of tasks.
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Scope}
|
||||
|
||||
The AI Act applies to:
|
||||
\begin{itemize}
|
||||
\item Providers who put an AI system on the EU's market, independently of their location.
|
||||
\item Deployers of AI systems located within the EU.
|
||||
\item Providers and deployers in third countries if the output produced is used in the EU.
|
||||
\item Importers and distributors of AI systems.
|
||||
\item Product manufacturers who use AI systems in their products.
|
||||
\item Authorized representatives of providers.
|
||||
\item People affected by AI systems in the EU.
|
||||
\end{itemize}
|
||||
|
||||
\begin{remark}
|
||||
The AI Act is excluded for the following areas:
|
||||
\begin{itemize}
|
||||
\item Military, defense, and national security,
|
||||
\item Scientific research and development activities,
|
||||
\item Pre-market development and testing, if done in protected environments,
|
||||
\item International law enforcement cooperation, if fundamental rights safeguards are in place.
|
||||
\end{itemize}
|
||||
\end{remark}
|
||||
|
||||
\begin{remark}
|
||||
The AI Act is a compromise between a product safety approach (e.g., minimum safety requirements, standards, \dots) and a fundamental rights approach.
|
||||
\end{remark}
|
||||
|
||||
\begin{remark}
|
||||
The AI Act does not introduce new individual rights.
|
||||
\end{remark}
|
||||
|
||||
|
||||
|
||||
\section{Risk regulation}
|
||||
|
||||
\begin{description}
|
||||
\item[Risk]
|
||||
Combination of the probability of harm and the severity of that harm.
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Risk levels}
|
||||
|
||||
\begin{description}
|
||||
\item[Unacceptable-risk (article 5)] \marginnote{Unacceptable-risk}
|
||||
Includes AI systems that are used for:
|
||||
\begin{itemize}
|
||||
\item Deploying harmful and manipulative subliminal techniques (i.e., beyond individual cognition),
|
||||
\item Exploiting vulnerable groups,
|
||||
\item Social scoring,
|
||||
\item Real-time remote biometric identification in public spaces for law enforcement purposes (with some exceptions),
|
||||
\item Biometric categorization of protected features,
|
||||
\item Predicting criminal offenses solely based on profiling or personality traits,
|
||||
\item Creating facial recognition databases by scraping the Internet or CCTV footage,
|
||||
\item Inferring emotions in workplaces or educational institutions, unless for medical or safety reasons.
|
||||
\end{itemize}
|
||||
|
||||
\item[High-risk (article 6)] \marginnote{High-risk}
|
||||
Includes the following groups of AI systems:
|
||||
\begin{itemize}
|
||||
\item Those used as safety components of a product or falling under the EU health and safety legislation (e.g., toys, aviation, cars, medical devices, \dots)
|
||||
\item Those used in the following specific areas: biometric identification, critical infrastructures, education, employment, access to essential services, law enforcement, migration, and juridical and democratic processes.
|
||||
\item Those that performs profiling of natural persons.
|
||||
\end{itemize}
|
||||
|
||||
Requirements to assess the impact of a these systems are:
|
||||
\begin{itemize}
|
||||
\item Determining the categories of natural persons and groups affected by the system,
|
||||
\item Checking compliance with European and national laws,
|
||||
\item Fundamental rights risk assessment (FRIA),
|
||||
\begin{example}[FRAIA]
|
||||
Questionnaire created by the Dutch government to assess the impact of AI systems on fundamental rights.
|
||||
\end{example}
|
||||
\item Determining the risk of harm towards vulnerable groups and the environmental impact,
|
||||
\item Determining a plan for risk mitigation,
|
||||
\item Creating a governance system for human oversight, complaint handling, and redress.
|
||||
\end{itemize}
|
||||
|
||||
\begin{remark}
|
||||
These requirements are still under research.
|
||||
\end{remark}
|
||||
|
||||
\item[Limited-risk (article 52)] \marginnote{Limited-risk}
|
||||
Involves AI systems that interact with users with limited effects. It includes chatbots, emotion recognition, deep fakes, \dots
|
||||
|
||||
Requirements are:
|
||||
\begin{itemize}
|
||||
\item The user must be informed that it is interacting with an AI system,
|
||||
\item Artificial content must be labeled as generated and contain detectable watermarks,
|
||||
\item Employers must inform workers on whether AI is used in the workplace and the reasons.
|
||||
\end{itemize}
|
||||
|
||||
\item[Minimal-risk (article 69)] \marginnote{Minimal-risk}
|
||||
Involves AI systems with low to no effects on the user. It includes spam filters, video games, purchase recommendation systems, \dots.
|
||||
|
||||
They are required to comply with the existing regulation but are not further regulated by the AI Act.
|
||||
|
||||
\begin{remark}
|
||||
Providers of these systems are nonetheless encouraged to voluntarily respect high-risk requirements.
|
||||
\end{remark}
|
||||
|
||||
\item[General purpose AI requirements] \marginnote{General purpose AI requirements}
|
||||
Specific requirements for general purpose AI are:
|
||||
\begin{itemize}
|
||||
\item Technical documentation must be kept for training, testing, and performance,
|
||||
\item Key information must be shared with downstream AI system providers,
|
||||
\item A summary of the training data must be published,
|
||||
\item Copyright compliance must be declared,
|
||||
\item Collaboration with regulators,
|
||||
\item Codes of practice should be provided.
|
||||
\end{itemize}
|
||||
|
||||
\begin{remark}
|
||||
There is a subgroup of general purpose AI systems that includes those that pose a systemic risk. Additional requirements for these systems are:
|
||||
\begin{itemize}
|
||||
\item Additional risk mitigation,
|
||||
\item Independent system evaluation and model registration.
|
||||
\end{itemize}
|
||||
\end{remark}
|
||||
|
||||
\begin{remark}
|
||||
If the computing power to train a model exceeds a certain threshold, that system is presumed to be a general purpose AI that poses systemic risks.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Enforcement}
|
||||
|
||||
\begin{description}
|
||||
\item[Enforcement] \marginnote{Enforcement}
|
||||
National supervisory authority enforces the AI Act in each member state with the support of the European Artificial Intelligence Office.
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{AI regulatory sandboxes}
|
||||
|
||||
\begin{description}
|
||||
\item[AI sandbox] \marginnote{AI sandbox}
|
||||
Voluntary framework organized by member states for small to medium companies to test AI systems in controlled environments.
|
||||
\end{description}
|
||||
|
||||
|
||||
|
||||
\section{AI liability}
|
||||
|
||||
\begin{remark}
|
||||
In the case of AI systems, liability has to account for:
|
||||
\begin{itemize}
|
||||
\item Black-box models,
|
||||
\item Autonomous and unpredictable models,
|
||||
\item Multiple actors and diffused responsibility,
|
||||
\item Lack of a clear legal framework,
|
||||
\item Difficulty in finding the causal chain.
|
||||
\end{itemize}
|
||||
\end{remark}
|
||||
|
||||
|
||||
\subsection{Liability theories}
|
||||
|
||||
\begin{description}
|
||||
\item[Strict liability] \marginnote{Strict liability}
|
||||
The producer is always responsible for their product both if it is their fault or due to negligence. The injured party only has to prove that damage occurred.
|
||||
|
||||
\item[Fault liability] \marginnote{Fault liability}
|
||||
The defender has to show that someone is responsible for causing damage intentionally or negligently.
|
||||
|
||||
\item[Mandatory insurance] \marginnote{Mandatory insurance}
|
||||
Enforce that the product (e.g., AI system) is covered by an insurance.
|
||||
|
||||
\item[Compensation funds] \marginnote{Compensation funds}
|
||||
Economic relief for the users in case of damage or bankruptcy of the company.
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Revised Product Liability Directive}
|
||||
|
||||
\begin{description}
|
||||
\item[Revised Product Liability Directive] \marginnote{Revised Product Liability Directive}
|
||||
Product Liability Directive extended to software and AI systems. It is applied in all member states (i.e., maximum harmonization) and is based on the strict liability theory.
|
||||
|
||||
The requirements to prove for compensation are that:
|
||||
\begin{itemize}
|
||||
\item The product is defective,
|
||||
\item Damage was caused,
|
||||
\item There is a causal link between defect and damage.
|
||||
\end{itemize}
|
||||
|
||||
\item[Product] \marginnote{Product}
|
||||
The revised Product Liability Directive extends the definition of product with:
|
||||
\begin{itemize}
|
||||
\item Software and its updates,
|
||||
\item Digital manufacturing files (e.g., model for 3D printers),
|
||||
\item Digital services.
|
||||
\end{itemize}
|
||||
|
||||
\begin{remark}
|
||||
Free and non-commercial open-source software are excluded
|
||||
\end{remark}
|
||||
|
||||
\item[Liable parties (article 8)] \marginnote{Liable parties}
|
||||
The revised Product Liability Directive extends liable entities with:
|
||||
\begin{itemize}
|
||||
\item Any economic operator that has substantially modified the product outside the control of the manufacturer,
|
||||
\item Distributors of defective products,
|
||||
\item Online platforms.
|
||||
\end{itemize}
|
||||
|
||||
\begin{remark}
|
||||
In the case of AI systems, the producer is the provider defined in the AI Act.
|
||||
\end{remark}
|
||||
|
||||
\item[Types of damage (article 6)] \marginnote{Types of damage}
|
||||
Compensation can be provided for:
|
||||
\begin{itemize}
|
||||
\item Death or personal injury, including psychological health.
|
||||
\item Damage or destruction of properties, with the exception of the product itself, other components the defective product is integrated with, and products used for professional purposes only.
|
||||
\item Destruction or corruption of data that is not used for professional purposes.
|
||||
\end{itemize}
|
||||
|
||||
\item[Defectiveness (article 7)] \marginnote{Defectiveness}
|
||||
In the case of software, liability is applied also for defects that come out after the product has been put in the market. This includes:
|
||||
\begin{itemize}
|
||||
\item Software updates under the manufacturer's control,
|
||||
\item Failure to address cybersecurity vulnerabilities,
|
||||
\item Machine learning.
|
||||
\end{itemize}
|
||||
|
||||
\item[Presumption of defectiveness and causality (article 10)] \marginnote{Presumption of defectiveness and causality}
|
||||
Defectiveness is presumed when:
|
||||
\begin{itemize}
|
||||
\item The manufacturer fails to comply with the obligation to disclose information,
|
||||
\item A product does not comply with mandatory safety requirements,
|
||||
\item Damage is caused by an obvious product malfunction.
|
||||
\end{itemize}
|
||||
|
||||
A causal link is presumed when:
|
||||
\begin{itemize}
|
||||
\item The damage is consistent with the type of defect,
|
||||
\item The technical or scientific complexity makes it difficult to prove liability (e.g., as with black-box models).
|
||||
\end{itemize}
|
||||
\end{description}
|
||||
|
||||
\begin{remark}
|
||||
The revised Product Liability Directive does not cover:
|
||||
\begin{itemize}
|
||||
\item Discrimination,
|
||||
\item Violation of privacy (that are not already covered in the GDPR),
|
||||
\item Use of AI for professional purposes,
|
||||
\item Sustainability effects.
|
||||
\end{itemize}
|
||||
\end{remark}
|
||||
|
||||
|
||||
\subsection{AI Liability Directive}
|
||||
|
||||
\begin{description}
|
||||
\item[AI Liability Directive] \marginnote{AI Liability Directive}
|
||||
Additional protection for cases not covered in the revised Product Liability Directive. It is based on the fault liability theory.
|
||||
|
||||
The directive has been cancelled by the EU Commission.
|
||||
\end{description}
|
||||
|
||||
|
||||
\begin{example}[Case study: delivery robot accident]
|
||||
An autonomous delivery robot that is able to navigate the pavement of pedestrian areas falls on the edge and hits a bicycle courier on the cycle lane. Both the biker and the robot sustained injuries/damage.
|
||||
|
||||
\begin{descriptionlist}
|
||||
\item[AI Act] The system falls under the high-risk level (autonomous vehicle).
|
||||
\item[Revised Product Liability Directive] \phantom{}
|
||||
\begin{itemize}
|
||||
\item Liability can be sought after the company deploying the robots or the one renting them.
|
||||
\item The defect is related to the sensors/decision-making of the robot.
|
||||
\item Injuries are both physical and possibly psychological.
|
||||
\end{itemize}
|
||||
\end{descriptionlist}
|
||||
\end{example}
|
||||
|
||||
\begin{example}[Case study: smart bank]
|
||||
A bank stores its data in the storage service provided by another company. An update released by the bank causes the corruption and loss of financial data.
|
||||
|
||||
An affected customer failed to make payments leading to penalties and decrease in credit score.
|
||||
|
||||
\begin{descriptionlist}
|
||||
\item[AI Act] The system does not involve AI.
|
||||
\item[Revised Product Liability Directive] \phantom{}
|
||||
\begin{itemize}
|
||||
\item Liability can be sought after the bank.
|
||||
\item The defect is the loss of records due to the update.
|
||||
\item Damages are psychological and economical.
|
||||
\end{itemize}
|
||||
\end{descriptionlist}
|
||||
\end{example}
|
||||
|
||||
\begin{example}[Case study: AI friend]
|
||||
A mental health chatbot is developed to support young users. However, a flaw in the system causes the generation of inappropriate and harmful messages.
|
||||
|
||||
In an affected user, this lead to depression, self-harm, declining school performance, and withdrawal from social activities.
|
||||
|
||||
\begin{descriptionlist}
|
||||
\item[AI Act] The system might fall under the unacceptable-risk level (manipulation) or under the high-risk level (medical diagnosis).
|
||||
\item[Revised Product Liability Directive] \phantom{}
|
||||
\begin{itemize}
|
||||
\item Liability can be sought after the company deploying the system.
|
||||
\item The defect is the flaw of the chatbot.
|
||||
\item Damage is psychological and physical. It also involves the loss of opportunities.
|
||||
\end{itemize}
|
||||
\end{descriptionlist}
|
||||
\end{example}
|
||||
353
src/year2/ethics-in-ai/module2/sections/_autonomous_vehicles.tex
Normal file
@ -0,0 +1,353 @@
|
||||
\chapter{Autonomous vehicles}
|
||||
|
||||
\begin{description}
|
||||
\item[Autonomous vehicle] \marginnote{Autonomous vehicle}
|
||||
Unmanned vehicle that senses the environment and navigates without human input.
|
||||
\end{description}
|
||||
|
||||
|
||||
\begin{description}
|
||||
\item[Level of automation taxonomy (LoAT)] \marginnote{Level of automation taxonomy (LoAT)}
|
||||
Describes the four steps for action decision, each with different levels of automation:
|
||||
\begin{enumerate}
|
||||
\item Information acquisition,
|
||||
\item Information analysis,
|
||||
\item Decision and action selection,
|
||||
\item Action implementation.
|
||||
\end{enumerate}
|
||||
|
||||
\begin{remark}
|
||||
An intermediate level of automation is the most subject to accidents.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
|
||||
\begin{description}
|
||||
\item[Autonomous vehicles taxonomy] \marginnote{Autonomous vehicles taxonomy}
|
||||
Autonomy for vehicles ranked on six levels:
|
||||
\begin{enumerate}
|
||||
\setcounter{enumi}{-1}
|
||||
\item Traditional car,
|
||||
\item Hands-on autonomy: driver and automated system share the controls (e.g., parking assistance).
|
||||
\item Hands-off autonomy: the driver must be prepared to intervene.
|
||||
\item Eyes-off autonomy: the driver's attention is not required in some cases.
|
||||
\item Mind-off autonomy: the driver's attention is not required.
|
||||
\item No steering wheel autonomy: no human intervention is possible.
|
||||
\begin{remark}
|
||||
The current legislation still requires a steering wheel.
|
||||
\end{remark}
|
||||
\end{enumerate}
|
||||
\end{description}
|
||||
|
||||
|
||||
|
||||
\section{Liability}
|
||||
|
||||
\begin{description}
|
||||
\item[Liability] \marginnote{Liability}
|
||||
State under which an individual is legally responsible for something related to a harmful event and it is subject to a sanction or damage compensation.
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Criminal liability}
|
||||
|
||||
\begin{description}
|
||||
\item[Criminal liability] \marginnote{Criminal liability}
|
||||
Related to a crime and punished with a fine or detention. It can be related to a natural or legal person.
|
||||
|
||||
It presupposes an act or omission that violates the criminal law. There are two conditions:
|
||||
\begin{descriptionlist}
|
||||
\item[Actus reus] The material element of the crime (an act or an omission).
|
||||
\item[Mens rea] The subjective element of the crime, the mental state of the perpetrator (e.g., intention, negligence, \dots).
|
||||
\end{descriptionlist}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Civil liability}
|
||||
|
||||
\begin{description}
|
||||
\item[Civil liability] \marginnote{Civil liability}
|
||||
Presupposes a tort or a breach of contract and involves the obligation to repair.
|
||||
|
||||
\begin{description}
|
||||
\item[Fault liability] Breach a duty intentionally or negligently.
|
||||
\item[Special cases] \phantom{}
|
||||
\begin{description}
|
||||
\item[Product liability] In the case of autonomous vehicles, technology counts as a product and the manufacturer is considered the producer. The conditions to be applicable are:
|
||||
\begin{itemize}
|
||||
\item The technology is defective:
|
||||
\begin{itemize}
|
||||
\item By design
|
||||
\item Manufacturing defect
|
||||
\item Warning defect (e.g., missing or unclear instructions)
|
||||
\end{itemize}
|
||||
\item The technology causes damage.
|
||||
\end{itemize}
|
||||
\item[Enterprise liability]
|
||||
\item[Vicarious liability]
|
||||
\end{description}
|
||||
\end{description}
|
||||
\end{description}
|
||||
|
||||
\begin{remark}
|
||||
Liability with autonomous vehicle can be distributed as follows:
|
||||
\begin{itemize}
|
||||
\item With high automation, the manufacturer is more liable,
|
||||
\item With medium automation, manufacturer and driver share liability,
|
||||
\item With low automation, the driver is more liable.
|
||||
\end{itemize}
|
||||
\end{remark}
|
||||
|
||||
|
||||
\subsection{Administrative liability}
|
||||
|
||||
\begin{description}
|
||||
\item[Administrative liability] \marginnote{Administrative liability}
|
||||
Related to the violation of administrative rules or regulations.
|
||||
\end{description}
|
||||
|
||||
|
||||
|
||||
\section{Unavoidable accidents}
|
||||
|
||||
\begin{description}
|
||||
\item[Unavoidable accidents]
|
||||
Ethical dilemmas that question how a system should handle certain scenarios.
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Trolley problem}
|
||||
|
||||
\begin{description}
|
||||
\item[Trolley problem] \marginnote{Trolley problem}
|
||||
A trolley is headed towards a path where it will kill five people. If a lever is pulled, the trolley will be diverted and kill one person.
|
||||
|
||||
The dilemma is whether to do nothing and kill five people or pull the lever and actively kill one.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.5\linewidth]{./img/trolley_problem.png}
|
||||
\end{figure}
|
||||
|
||||
\item[Trolley problem (fat person)] \marginnote{Trolley problem (fat person)}
|
||||
Variation of the trolley problem where the trolley goes towards a single path that will kill some people and can be stopped by pushing a fat person on the track.
|
||||
|
||||
This scenario tests whether a direct physical involvement affecting someone not in danger changes the morality in the decision.
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Unavoidable car collision}
|
||||
|
||||
\begin{description}
|
||||
\item[Unavoidable car collision] \marginnote{Self-driving car collision}
|
||||
A human-driven or self-driving car with brakes failure is headed towards one or more pedestrians. The question is whether the car should stay on course or swerve.
|
||||
|
||||
Consider the following scenarios:
|
||||
\begin{enumerate}[label=(\Alph*)]
|
||||
\item The car can either kill many pedestrians crossing the street or a single person on the side of the road.
|
||||
\item The car can either kill a single pedestrian crossing the street or hit a wall killing its driver.
|
||||
\item The car can either kill many pedestrians crossing the street or hit a wall killing its driver.
|
||||
\end{enumerate}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.8\linewidth]{./img/human_driving_crash.png}
|
||||
\end{figure}
|
||||
|
||||
% \begin{figure}[H]
|
||||
% \centering
|
||||
% \includegraphics[width=0.3\linewidth]{./img/self_driving_crash.png}
|
||||
% \end{figure}
|
||||
|
||||
|
||||
\item[Human-driven car collision] \marginnote{Human-driven car collision}
|
||||
Unavoidable car collision with a human driver.
|
||||
|
||||
\begin{description}
|
||||
\item[State-of-necessity] \marginnote{State-of-necessity}
|
||||
Under the law, one is not criminally liable if:
|
||||
\begin{itemize}
|
||||
\item There is an unavoidable danger of serious bodily harm to the offender (or others) not voluntarily caused by the offender.
|
||||
\item The fact committed by the offender is proportionate to the danger.
|
||||
\end{itemize}
|
||||
|
||||
\begin{remark}
|
||||
The offender is still civilly liable (i.e., must compensate the damage).
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
In the three scenarios, the legal outcomes are:
|
||||
\begin{enumerate}[label=(\Alph*)]
|
||||
\item As the driver is not in danger, it should swerve to minimize losses as otherwise it would be considered an omission in saving many lives.
|
||||
\item The driver can invoke the state-of-necessity and hit the pedestrian.
|
||||
\item The driver can invoke the state-of-necessity and hit the pedestrians.
|
||||
\end{enumerate}
|
||||
|
||||
|
||||
\item[Self-programmed car collision] \marginnote{Self-programmed car collision}
|
||||
Unavoidable car collision with a car pre-programmed by the manufacturer.
|
||||
|
||||
In this case, who programmed the car cannot invoke the state-of-necessity and the legal outcomes are:
|
||||
\begin{enumerate}[label=(\Alph*)]
|
||||
\item The legally justifiable action should be the one that causes the least damage (i.e., the car should be programmed to kill the lowest number of lives).
|
||||
\item Both choices are ambiguous.
|
||||
\item The legally justifiable action should be the one that causes the least damage.
|
||||
\end{enumerate}
|
||||
|
||||
\begin{remark}
|
||||
Experiments show that people prefer impartial autonomous vehicles (i.e., minimize loss) for others and one that favors the passengers for themselves.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
|
||||
|
||||
\section{Ethical knob}
|
||||
|
||||
|
||||
\subsection{Ethical knob 1.0}
|
||||
|
||||
\begin{description}
|
||||
\item[Ethical knob 1.0] \marginnote{Ethical knob 1.0}
|
||||
Imaginary tool that allows the passenger to select a level of morality:
|
||||
\begin{descriptionlist}
|
||||
\item[Altruist] Preference is given to others.
|
||||
\item[Impartial] Equal importance is given to passengers and others (i.e., minimize loss).
|
||||
\item[Egoist] Preference is given to passengers.
|
||||
\end{descriptionlist}
|
||||
|
||||
\begin{remark}
|
||||
Liability is the same as for the human-driven car, but there is no distinction between active and omissive behavior.
|
||||
\end{remark}
|
||||
|
||||
The legal outcomes for the car collision scenarios are:
|
||||
\begin{enumerate}[label=(\Alph*)]
|
||||
\item The passenger is not in danger, therefore the autonomous vehicle with the knob in any setting should minimize losses.
|
||||
\item The car will follow the knob setting and the state-of-necessity is applicable. In case of impartiality, the choice can be predefined or randomized.
|
||||
\item The car will follow the knob setting and the state-of-necessity is applicable.
|
||||
\end{enumerate}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Ethical knob 2.0}
|
||||
|
||||
\begin{description}
|
||||
\item[Ethical knob 2.0] \marginnote{Ethical knob 2.0}
|
||||
Ethical knob that allows the passenger to set the proportional importance of the passengers to the importance of others. In addition, the car can determine the probability of causing harm. The decision is based on the disutility computed as follows:
|
||||
\[ \texttt{disutility} = \texttt{importance} \cdot \texttt{probability\_of\_harm} \]
|
||||
|
||||
\begin{example}
|
||||
Consider a case where:
|
||||
\begin{itemize}
|
||||
\item The passenger is $60\%$ important and has $10\%$ of probability to be harmed,
|
||||
\item The pedestrian is $40\%$ important and has $100\%$ of probability to be harmed.
|
||||
\end{itemize}
|
||||
The disutilities are:
|
||||
\[
|
||||
\begin{split}
|
||||
\texttt{disutility}(\text{passenger}) &= 60\% \cdot 10\% = 6\% \\
|
||||
\texttt{disutility}(\text{pedestrian}) &= 40\% \cdot 100\% = 40\% \\
|
||||
\end{split}
|
||||
\]
|
||||
The autonomous vehicle will put the passenger at risk.
|
||||
\end{example}
|
||||
|
||||
\begin{example}
|
||||
Consider a case where:
|
||||
\begin{itemize}
|
||||
\item The passenger is $95\%$ important and has $10\%$ of probability to be harmed,
|
||||
\item The pedestrian is $5\%$ important and has $100\%$ of probability to be harmed.
|
||||
\end{itemize}
|
||||
The disutilities are:
|
||||
\[
|
||||
\begin{split}
|
||||
\texttt{disutility}(\text{passenger}) &= 95\% \cdot 10\% = 9.5\% \\
|
||||
\texttt{disutility}(\text{pedestrian}) &= 5\% \cdot 100\% = 5\% \\
|
||||
\end{split}
|
||||
\]
|
||||
The autonomous vehicle will put the pedestrian at risk.
|
||||
\end{example}
|
||||
|
||||
\begin{remark}
|
||||
In case of more people involved, the total disutility can be scaled by the number of lives involved and normalized.
|
||||
\end{remark}
|
||||
|
||||
\begin{remark}[Rawls's difference principle] \marginnote{Rawls's difference principle}
|
||||
Rawls's difference principle is an alternative approach to utilitarianism that aims at minimizing the loss of the most disfavored individual.
|
||||
|
||||
\indenttbox
|
||||
\begin{example}
|
||||
Consider a scenario with one pedestrian $c_1$ crossing the road and three others $k_1, k_2, k_3$ on the side of the street, all with the same importance $l$.
|
||||
|
||||
Assume that the disutilities are:\\[1em]
|
||||
\begin{minipage}{0.48\linewidth}
|
||||
\begin{center}
|
||||
\texttt{Proceed forward}
|
||||
\end{center}
|
||||
\[
|
||||
\begin{split}
|
||||
\texttt{disutility}(c_1) &= 0.9 l \\
|
||||
\texttt{disutility}(k_1) &= 0.0 l \\
|
||||
\texttt{disutility}(k_2) &= 0.0 l \\
|
||||
\texttt{disutility}(k_3) &= 0.0 l \\
|
||||
\end{split}
|
||||
\]
|
||||
\end{minipage}
|
||||
\hfill
|
||||
\begin{minipage}{0.48\linewidth}
|
||||
\begin{center}
|
||||
\texttt{Swerve}
|
||||
\end{center}
|
||||
\[
|
||||
\begin{split}
|
||||
\texttt{disutility}(c_1) &= 0.0 l \\
|
||||
\texttt{disutility}(k_1) &= 0.6 l \\
|
||||
\texttt{disutility}(k_2) &= 0.6 l \\
|
||||
\texttt{disutility}(k_3) &= 0.6 l \\
|
||||
\end{split}
|
||||
\]
|
||||
\end{minipage}\\[0.5em]
|
||||
|
||||
An autonomous vehicle based on Rawls's difference will choose to swerve and hit the three pedestrians on the side of the road.
|
||||
\end{example}
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
\begin{remark}
|
||||
If everyone chooses an egoistic approach, it would lead to a ``tragedy of the commons'' scenario where individuals deplete a shared resource causing more harm (in this case resulting in more pedestrian casualties).
|
||||
\end{remark}
|
||||
|
||||
|
||||
\begin{description}
|
||||
\item[Public good game]
|
||||
Game where subjects choose how many of their private tokens to put in a public pot. The content of the pot is multiplied by a certain factor and represents the public good payoff that is distributed equally to every subject.
|
||||
|
||||
In the case of autonomous vehicles, the public good can represent road or population safety. An agent-based simulation can be performed to assess different possible scenarios:
|
||||
\begin{itemize}
|
||||
\item Initialize the knob of each agent randomly and update them according to past experience.
|
||||
\item Consider as tokens the level of altruism.
|
||||
\item Define a cost for individualist choices.
|
||||
\item Aim to find the value of the knob that maximizes both individual and collective payoff.
|
||||
\end{itemize}
|
||||
Results show that:
|
||||
\begin{itemize}
|
||||
\item A low cost for individualist actions rapidly converges to egoism.
|
||||
\item A medium cost for individualist actions slowly convergences to egoism.
|
||||
\item A high cost for individualist actions converges to altruism.
|
||||
\end{itemize}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Genetic ethical knob}
|
||||
|
||||
\begin{description}
|
||||
\item[Genetic ethical knob] \marginnote{Genetic ethical knob}
|
||||
Ethical knob that reflects the autonomous vehicle's assessment of the relative importance of passengers and others.
|
||||
|
||||
Experimentally, this is implemented using a neural network to predict the level of the knob and a genetic algorithm to find the best configuration. The fitness function $f(p_i)$ for agent $p_i$ is defined as:
|
||||
\[
|
||||
f(p_i) = \Delta u(p_i) + \texttt{reward}(p_i)
|
||||
\]
|
||||
where $\Delta u(p_i)$ is the difference between the utility of the choice and the expected utility of the alternative choices, and $\texttt{reward}(p_i)$ is based on the action taken by the average individual.
|
||||
|
||||
The goal of the experiment is to find an ideal threshold between egoism and altruism.
|
||||
\end{description}
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
\begin{description}
|
||||
\item[CLAUDETTE] \marginnote{CLAUDETTE}
|
||||
Clause detector (CLAUDETTE) is a system to classify clauses in terms of services or privacy policies as:
|
||||
Clause detector (CLAUDETTE) is a system to classify clauses in a terms of service or privacy policy as:
|
||||
\begin{itemize}
|
||||
\item \textsc{Clearly fair},
|
||||
\item \textsc{Potentially unfair},
|
||||
@ -34,6 +34,13 @@
|
||||
\begin{itemize}
|
||||
\item \textsc{potentially unfair}, if the provider can unilaterally modify the terms of service or the service.
|
||||
\end{itemize}
|
||||
|
||||
\item[Unilateral termination] \marginnote{Unilateral termination}
|
||||
A clause is classified as:
|
||||
\begin{itemize}
|
||||
\item \textsc{potentially unfair}, if the provider has the right to suspend or terminate the service and the reasons are specified.
|
||||
\item \textsc{clearly unfair}, if the provider can suspend or terminate the service for any reason.
|
||||
\end{itemize}
|
||||
|
||||
\item[Jurisdiction clause] \marginnote{Jurisdiction clause}
|
||||
A clause is classified as:
|
||||
@ -64,13 +71,6 @@
|
||||
\item \textsc{potentially unfair}, if the provider is never liable unless obliged by law.
|
||||
\item \textsc{clearly unfair}, if the provider is never liable (intentional damage included).
|
||||
\end{itemize}
|
||||
|
||||
\item[Unilateral termination] \marginnote{Unilateral termination}
|
||||
A clause is classified as:
|
||||
\begin{itemize}
|
||||
\item \textsc{potentially unfair}, if the provider has the right to suspend or terminate the service and the reasons are specified.
|
||||
\item \textsc{clearly unfair}, if the provider can suspend or terminate the service for any reason.
|
||||
\end{itemize}
|
||||
|
||||
\item[Content removal] \marginnote{Content removal}
|
||||
A clause is classified as:
|
||||
|
||||
425
src/year2/ethics-in-ai/module2/sections/_discrimination.tex
Normal file
@ -0,0 +1,425 @@
|
||||
\chapter{Discrimination}
|
||||
|
||||
\begin{description}
|
||||
\item[Disparate treatment] \marginnote{Disparate treatment}
|
||||
The outcome of an algorithm is based on protected features.
|
||||
|
||||
\item[Disparate impact] \marginnote{Disparate impact}
|
||||
The outcome of an algorithm that uses neutral features is disproportionate against certain groups without an acceptable reason.
|
||||
\end{description}
|
||||
|
||||
|
||||
\section{Biased data}
|
||||
|
||||
|
||||
\subsection{Historical bias}
|
||||
|
||||
\begin{description}
|
||||
\item[Historical bias] \marginnote{Historical bias}
|
||||
Systems trained on intrinsically biased data will reproduce the same biased behavior.
|
||||
|
||||
\begin{remark}
|
||||
Data can be biased because it comes from past human judgement or by the hierarchies of society (e.g., systems working on marginalized languages will most likely have lower performance compared to a widespread language).
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
\begin{example}[Amazon AI recruiting tool]
|
||||
Tool that Amazon was using in the past to review job applications. It was heavily biased towards male applicants and, even with the gender removed, it was able to infer it from the other features.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.3\linewidth]{./img/tech_workforce.png}
|
||||
\caption{Tech companies workforce in the US}
|
||||
\end{figure}
|
||||
\end{example}
|
||||
|
||||
\begin{example}[UK AI visa and asylum system]
|
||||
System used by the UK government to assess visa and asylum applications. It was found out that:
|
||||
\begin{itemize}
|
||||
\item The system ranked applications based on nationality.
|
||||
\item Applicants from certain countries were automatically flagged as high risk.
|
||||
\end{itemize}
|
||||
\end{example}
|
||||
|
||||
\begin{example}[Generative AI]
|
||||
Prompting Stable Diffusion to generate the image of a \texttt{ceo} and a \texttt{nurse} highlights the gender and ethnicity bias of the training data.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\begin{subfigure}{0.5\linewidth}
|
||||
\centering
|
||||
\includegraphics[width=\linewidth]{./img/stable_diffusion_nurse.png}
|
||||
\end{subfigure}
|
||||
\hfill
|
||||
\begin{subfigure}{0.4\linewidth}
|
||||
\centering
|
||||
\includegraphics[width=\linewidth]{./img/stable_diffusion_ceo.png}
|
||||
\end{subfigure}
|
||||
\end{figure}
|
||||
|
||||
Also, other systems (e.g., Gemini) included constraints to favor diversity resulting in unexpected results.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.45\linewidth]{./img/gemini_diversity.png}
|
||||
\end{figure}
|
||||
|
||||
In the context of language models, some systems implement a refusal mechanism to prevent a biased response. However:
|
||||
\begin{itemize}
|
||||
\item Using a different prompt of the same topic might bypass the filter.
|
||||
\item Refusal might be applied unequally depending on demographics or domain.
|
||||
\end{itemize}
|
||||
\end{example}
|
||||
|
||||
|
||||
\subsection{Proxy variables}
|
||||
|
||||
\begin{description}
|
||||
\item[Proxy variable] \marginnote{Proxy variable}
|
||||
Neutral feature that is connected to a protected one resulting in a disparate impact on a certain group.
|
||||
\end{description}
|
||||
|
||||
\begin{example}[Disaster relief allocation system]
|
||||
A system that predicts which communities need assistance based on past insurance claims is biased as it is a proxy for socioeconomic conditions: low-income communities often have lower insurance coverage and therefore will be disadvantaged by this system.
|
||||
\end{example}
|
||||
|
||||
\begin{example}[Optum healthcare algorithm]
|
||||
System used in US hospitals to predict which patients would benefit from additional resources. It was trained on historical data and it was found out that it was using the past healthcare cost data as a proxy to assess medical needs.
|
||||
|
||||
Due to historical disparity in accessing healthcare, this would cause a disparate impact on minorities that were unable to afford healthcare.
|
||||
\end{example}
|
||||
|
||||
\begin{example}[Hurricane Katrina and racial disparities]
|
||||
Due to historical racial segregation, the neighborhoods of many US cities can be divided by ethnicity. When Hurricane Katrina hit New Orleans, it mainly damaged the side of the city mostly lived by low-income communities. However, the evacuation plans assumed the availability of private vehicles and shelters were mostly built in the wealthier areas. Also, federal aid arrived quicker for wealthier communities and many low-income residences were never rebuilt.
|
||||
|
||||
An AI system trained on these data would reproduce the same behavior using the area one lives as a proxy.
|
||||
\end{example}
|
||||
|
||||
|
||||
\subsection{Biases embedded in predictors}
|
||||
|
||||
\begin{description}
|
||||
\item[Bias embedded in predictors] \marginnote{Bias embedded in predictors}
|
||||
A system that uses favorable features that only a certain group has.
|
||||
\end{description}
|
||||
|
||||
\begin{example}[House allocation in Los Angeles]
|
||||
VI-SPDAT is a system used in Los Angeles to distribute housing resources to homeless. As it relied on self-reported information, it was favoring those with higher literacy levels.
|
||||
\end{example}
|
||||
|
||||
|
||||
\subsection{Unbalanced samples}
|
||||
|
||||
\begin{description}
|
||||
\item[Unbalanced samples] \marginnote{Unbalanced samples}
|
||||
The dataset does not reflect the statistical composition of the population.
|
||||
\end{description}
|
||||
|
||||
\begin{example}
|
||||
Due to the lack of data of certain groups, a system to predict diseases will be more inaccurate towards minorities.
|
||||
\end{example}
|
||||
|
||||
|
||||
|
||||
\section{Algorithm choice}
|
||||
|
||||
|
||||
\subsection{Aggregation bias problem}
|
||||
|
||||
\begin{description}
|
||||
\item[Aggregation bias problem] \marginnote{Aggregation bias problem}
|
||||
System that has good results overall but with poor performance for specific groups.
|
||||
\end{description}
|
||||
|
||||
\begin{example}
|
||||
A system to predict the distribution of humanitarian aid trained on past successful data can present aggregation bias due to geographical data as a large part of the training data will most likely come from well established urban areas.
|
||||
\end{example}
|
||||
|
||||
|
||||
\subsection{Different base rates}
|
||||
|
||||
\begin{description}
|
||||
\item[Base rate/prior probability] \marginnote{Base rate/prior probability}
|
||||
Proportion of samples belonging to a certain class.
|
||||
\end{description}
|
||||
|
||||
\begin{example}[COMPAS system]
|
||||
COMPAS is a system used by US courts to determine the risk of recidivism (high, medium, low).
|
||||
|
||||
\begin{description}
|
||||
\item[Loomis case]
|
||||
E. Loomis was a defendant that according to COMPAS had a high risk of recidivism and was sentenced to 6 years in prison. The decision was appealed by Loomis as COMPAS has the following issues:
|
||||
\begin{itemize}
|
||||
\item Its functioning is unknown,
|
||||
\item Its validity cannot be verified,
|
||||
\item It discriminates on gender and ethnicity,
|
||||
\item Statistical predictions violate the right to individualized decisions.
|
||||
\end{itemize}
|
||||
|
||||
The Supreme Court of Wisconsin rejected the argument and stated that:
|
||||
\begin{itemize}
|
||||
\item Statistical algorithms do not violate the right to individualized decisions as they are used to enhance a judge's evaluation,
|
||||
\item Gender is necessary to achieve statistical accuracy,
|
||||
\item Judges should be informed about the possibility of racial discrimination by COMPAS.
|
||||
\end{itemize}
|
||||
|
||||
\item[ProPublica and Northpointe studies]
|
||||
ProPublica, a non-profit organization, published a study on the accuracy and fairness of COMPAS by comparing the predicted recidivism rates of $\num{11757}$ defendants and the actual rates between 2013 and 2014. Results found out that:
|
||||
\begin{itemize}
|
||||
\item The overall accuracy is moderate-low ($61.2\%$),
|
||||
\item Black defendants were more likely labeled with a high level of risk, leading to a higher probability of high risk misclassification ($45\%$ blacks vs $23\%$ whites).
|
||||
\item White defendants were more likely labeled with a low level of risk, leading to a higher probability of low risk misclassification ($48\%$ whites vs $28\%$ blacks).
|
||||
\end{itemize}
|
||||
|
||||
Northpointe, the software house of COMPAS, stated that ProPublica made several statistical and technical errors as:
|
||||
\begin{itemize}
|
||||
\item The accuracy of COMPAS is higher that human judgement.
|
||||
\item The general recidivism risk scale is equally accurate for blacks and whites,
|
||||
\item COMPAS is compliant with the principle of fairness and does not implement racial discrimination.
|
||||
\end{itemize}
|
||||
\end{description}
|
||||
|
||||
\indenttbox
|
||||
\begin{remark}[Decision workflow]
|
||||
A decision system can be represented in three steps:
|
||||
\begin{enumerate}
|
||||
\item Assign a predictive score (i.e., compute likelihood). In this step, unfairness can be caused by using protected features, biased data, a proxy, \dots
|
||||
\item Classify the score based on some thresholds. In this step, unfairness can be caused by the choice of the threshold.
|
||||
\item Make the decision. In this step, unfairness can be caused by how the value is used.
|
||||
\end{enumerate}
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.8\linewidth]{./img/decision_anatomy.png}
|
||||
\end{figure}
|
||||
\end{remark}
|
||||
|
||||
\begin{description}
|
||||
\item[SAPMOC case]
|
||||
SAPMOC is a toy example that predicts recidivism only based on whether the defendant has a previous criminal record. Assume that:
|
||||
\begin{itemize}
|
||||
\item $80\%$ of previous offenders recidivate and the remaining do not.
|
||||
\item $20\%$ of first time offenders recidivate and the remaining do not.
|
||||
\item The training data is composed of 3000 defendants divided into 1500 blues (1000 previous offenders) and 1500 greens (500 previous offenders).
|
||||
\end{itemize}
|
||||
|
||||
Therefore, the ground-truth aggregated outcomes are:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Has record} & \textbf{No record} \\
|
||||
\midrule
|
||||
\textbf{Recidivism} & 1200 ($80\%$) & 300 ($20\%$) \\
|
||||
\textbf{No recidivism} & 300 ($20\%$) & 1200 ($80\%$) \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Assume that SAPMOC's predictions are:\\[-1.5em]
|
||||
\begin{minipage}{0.48\linewidth}
|
||||
\begin{table}[H]
|
||||
\caption{Aggregated predictions}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Has record} & \textbf{No record} \\
|
||||
\midrule
|
||||
\textbf{Recidivism} & 1500 & 0 \\
|
||||
\textbf{No recidivism} & 0 & 1500 \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
\end{minipage}
|
||||
\hfill
|
||||
\begin{minipage}{0.48\linewidth}
|
||||
\begin{table}[H]
|
||||
\caption{Group-wise confusion matrix}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|ccc|ccc}
|
||||
\toprule
|
||||
& \textbf{Pos.} & \texttt{TP} & \texttt{FP} & \textbf{Neg.} & \texttt{TN} & \texttt{FN} \\
|
||||
\midrule
|
||||
\textbf{Blues} & 1000 & 800 & 200 & 500 & 400 & 100 \\
|
||||
\textbf{Greens} & 500 & 400 & 100 & 1000 & 800 & 200 \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
\end{minipage}
|
||||
|
||||
The base rates are then computed as:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& $\textbf{Base rate}_\textbf{pos}$ $\frac{\texttt{TP}+\texttt{FN}}{\texttt{TP}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$
|
||||
& $\textbf{Base rate}_\textbf{neg}$ $\frac{\texttt{TN}+\texttt{FP}}{\texttt{TP}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $\frac{900}{1500} = 60\%$ & $\frac{600}{1500} = 40\%$ \\
|
||||
\textbf{Greens} & $\frac{600}{1500} = 40\%$ & $\frac{900}{1500} = 60\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Note that the overall accuracy is the same for each group:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|c}
|
||||
\toprule
|
||||
& \textbf{Accuracy} $\frac{\texttt{TP}+\texttt{TN}}{\texttt{TP}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $80\%$ \\
|
||||
\textbf{Greens} & $80\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{description}
|
||||
\end{example}
|
||||
|
||||
\begin{description}
|
||||
\item[Fairness criteria]
|
||||
The main fairness criteria are the following:
|
||||
\begin{description}
|
||||
\item[Statistical parity] \marginnote{Statistical parity}
|
||||
Each group should have an equal proportion of positive and negative predictions.
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC does not satisfy statistical parity:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Predicted pos.} $\frac{\texttt{TP}+\texttt{FP}}{\texttt{TP}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$
|
||||
& \textbf{Predicted neg.} $\frac{\texttt{TN}+\texttt{TN}}{\texttt{FN}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $67\%$ & $33\%$ \\
|
||||
\textbf{Greens} & $33\%$ & $67\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
\item[Equality of opportunity/true positive rate] \marginnote{Equality of opportunity/true positive rate}
|
||||
The members sharing the same features between different groups should be treated equally (i.e., same recall).
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC does not satisfy equality of opportunity:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Recall pos.} $\frac{\texttt{TP}}{\texttt{TP}+\texttt{FN}}$
|
||||
& \textbf{Recall neg.} $\frac{\texttt{TN}}{\texttt{TN}+\texttt{FP}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $89\%$ & $67\%$ \\
|
||||
\textbf{Greens} & $67\%$ & $89\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
\item[Calibration] \marginnote{Calibration}
|
||||
The proportion of correct predictions should be equal for each class within each group (i.e., same precision).
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC satisfies calibration:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Precision pos.} $\frac{\texttt{TP}}{\texttt{TP}+\texttt{FP}}$
|
||||
& \textbf{Precision neg.} $\frac{\texttt{TN}}{\texttt{TN}+\texttt{FN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $80\%$ & $80\%$ \\
|
||||
\textbf{Greens} & $80\%$ & $80\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
\item[Conditional use error/false rate] \marginnote{Conditional use error/false rate}
|
||||
The proportion of incorrect predictions should be equal for each class within each group.
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC satisfies conditional use error:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{False rate pos.} $\frac{\texttt{FP}}{\texttt{TP}+\texttt{FP}}$
|
||||
& \textbf{False rate neg.} $\frac{\texttt{FN}}{\texttt{TN}+\texttt{FN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $20\%$ & $20\%$ \\
|
||||
\textbf{Greens} & $20\%$ & $20\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
\item[Treatment equality] \marginnote{Treatment equality}
|
||||
The error ratio of positive and negative predictions should be equal across all groups.
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC does not satisfy treatment equality:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Error pos.} $\frac{\texttt{FP}}{\texttt{FN}}$
|
||||
& \textbf{Error neg.} $\frac{\texttt{FN}}{\texttt{FP}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $200\%$ & $50\%$ \\
|
||||
\textbf{Greens} & $50\%$ & $200\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
\end{description}
|
||||
|
||||
\begin{remark}
|
||||
There are many other fairness criteria that are correlated to those above.
|
||||
\end{remark}
|
||||
|
||||
\begin{remark}
|
||||
There is a conflict between individual and group fairness so that not all criteria can be satisfied at once.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
\begin{description}
|
||||
\item[Handling different base rates] \phantom{}
|
||||
\begin{description}
|
||||
\item[Do nothing] \marginnote{Do nothing}
|
||||
Accept that different groups are actually associated to different probabilities.
|
||||
|
||||
\item[Modify the threshold for everyone] \marginnote{Modify the threshold for everyone}
|
||||
Raise (or decrease) the threshold to diminish the favorable classification for everyone (affecting more the groups with a higher base rate).
|
||||
|
||||
\item[Change the decision for everyone] \marginnote{Change the decision for everyone}
|
||||
Adopt alternative measures based on the classification results or use different thresholds depending on the group.
|
||||
|
||||
\begin{remark}
|
||||
Using different thresholds might still lead to discrimination. It makes sense in cases that require an affirmative action to increase diversity.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
\end{description}
|
||||
|
||||
\begin{example}[SAPMOC II]
|
||||
SAPMOC extended to multiple features and an output in $[0, 1]$. It is possible to represent the relationship between the output score and the likelihood of recidivism as densities:
|
||||
\begin{descriptionlist}
|
||||
\item[Recidivism density]
|
||||
Function of the score such that the area under the curve between $[s', s'']$ is the number of recidivists associated to a score in that interval.
|
||||
|
||||
\item[Non-recidivism density]
|
||||
Function of the score such that the area under the curve between $[s', s'']$ is the number of non-recidivists associated to a score in that interval.
|
||||
\end{descriptionlist}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.75\linewidth]{./img/sapmoc_density.png}
|
||||
\end{figure}
|
||||
|
||||
If the same threshold is applied for both groups, SAPMOC II respects the same fairness criteria of SAPMOC.
|
||||
\end{example}
|
||||
|
||||
\begin{theorem}
|
||||
With different base rates, it is impossible to achieve all fairness criteria through thresholding.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.45\linewidth]{./img/pasmoc2_thresholds.png}
|
||||
\end{figure}
|
||||
\end{theorem}
|
||||
@ -137,7 +137,7 @@ Processing of personal data is lawful if at least one of the following condition
|
||||
As a rule of thumb, legitimate interests of the controller can be pursued if only a reasonably limited amount of personal data is used.
|
||||
\end{remark}
|
||||
\begin{example}
|
||||
The gym one is subscribed in can send (contextual) advertisements by email to pursue economic interests.
|
||||
The gym one is subscribed in can send (contextual) advertisement by email to pursue economic interests.
|
||||
\end{example}
|
||||
\begin{remark}
|
||||
Targeted advertising is in principle prohibited. However, companies commonly pair legitimate interest with the request for consent.
|
||||
@ -407,7 +407,7 @@ There are two main opinions on AI systems:
|
||||
Agreement of the data subject that allows to process its personal data. Consent should be:
|
||||
\begin{descriptionlist}
|
||||
\item[Freely given]
|
||||
The data subject have the choice to give consent for profiling
|
||||
The data subject has the choice to give consent for profiling.
|
||||
|
||||
\begin{remark}
|
||||
A common practice is the ``take-or-leave'' approach, which is illegal.
|
||||
@ -432,7 +432,7 @@ There are two main opinions on AI systems:
|
||||
\end{remark}
|
||||
|
||||
\item[Unambiguously provided]
|
||||
Consent should be explicitly provided by the data subject through a statement of affirmative action.
|
||||
Consent should be explicitly provided by the data subject through a statement or affirmative action.
|
||||
\begin{remark}
|
||||
An illegal practice in many privacy policies is to state that there can be changes and continuing using the service implies an implicit acceptance of the new terms.
|
||||
\end{remark}
|
||||
@ -465,7 +465,7 @@ When personal data is collected, the controller should provide the data subject
|
||||
\begin{itemize}
|
||||
\item The identity of the controller, its representative (when applicable), and its contact details should be available.
|
||||
\item Contact details of the data officer (referee of the company that ensures that the GDPR is respected) should be available.
|
||||
\item Purposes and legal basis of the processing.
|
||||
\item Purposes and legal basis of processing.
|
||||
\item Categories of data collected.
|
||||
\item Recipients or categories of recipients.
|
||||
\item Period of time or the criteria to determine how long the data is stored.
|
||||
@ -486,7 +486,7 @@ Moreover, in case of automated decision-making, the following information should
|
||||
|
||||
\subsection{Right to access (article 15)} \marginnote{Right to access}
|
||||
|
||||
Data subjects have the right to have confirmation from the controller on whether their data has been processed and access both input and inferred personal data.
|
||||
Data subjects have the right to have confirmation from the controller on whether their data has been processed and can access both input and inferred personal data.
|
||||
|
||||
This right is limited if it affects the rights or freedoms of others.
|
||||
|
||||
@ -512,7 +512,7 @@ Data subjects have the right to have their own personal data erased without dela
|
||||
\begin{itemize}
|
||||
\item The data is no longer necessary for the purpose it was collected for.
|
||||
\begin{example}
|
||||
An e-shop cannot delete the address until the order is arrived.
|
||||
An e-shop cannot delete the address until the order has arrived.
|
||||
\end{example}
|
||||
|
||||
\item The data subject has withdrawn its consent, unless there are other legal basis.
|
||||
|
||||
8
src/year2/ethics-in-ai/module2/sections/_gen_ai.tex
Normal file
@ -0,0 +1,8 @@
|
||||
\begin{remark}
|
||||
Transformative rule: Two purposes of a work:
|
||||
\begin{itemize}
|
||||
\item Original of the work (e.g., creative work)
|
||||
\item Training
|
||||
\end{itemize}
|
||||
It is allowed if the original and training reason is different.
|
||||
\end{remark}
|
||||