# Automatic Initialization Methods for Photonic Components on a Silicon-Based Optical Switch
## 3 Optimization Method
### Probabilistic Restarts  
To avoid the optimal solution from being trapped into a local attraction basin of the target function, we could execute multiple NM searches in sequence and choose the best output among the convergence points. More efficiently, the GBNM method keeps the past convergence pathways in memory and pushes new local searches far from the already sampled points of the search domain. To do so, the GBNM bases on a probability density function, which is computed at each restart.  
The probability of having already sampled a point \(\mathbf{x}\) is:  
\[p(\mathbf{x})=\frac{1}{N}\sum\limits_{g=1}^{N}p_{g}(\mathbf{x}); \tag{6}\]  
where \(N\) is the number of already sampled points [31]. In the previous equation, \(p_{g}\) is the normal bi-dimensional probability density function, defined as:  
\[p_{g}(\mathbf{x})=\frac{1}{2\pi\sigma_{i}\sigma_{j}}exp\left(-\frac{1}{2}\left( \left(\frac{x_{i}-x_{ig}}{\sigma_{i}}\right)^{2}+\left(\frac{x_{j}-x_{ig}}{ \sigma_{j}}\right)^{2}\right)\right); \tag{7}\]  
where \(x_{ig}\) and \(x_{ig}\) are the coordinates of one of the already sampled points and:  
\[\sigma_{i,j}=\sqrt{\alpha}\left(x_{i,j}\text{ \emph{upper bound} }-x_{i,j}\text{ \emph{lower bound}}\right); \tag{8}\]  
where we set \(\alpha=0.01\) to make sure that the standard deviations \(\sigma_{i,j}\) from the Gaussian mean cover \(10\%\) of the domain If the optimization problem has a bounded domain \(\Omega\), we need to introduce bounded probability as:  
\[\rho(\mathbf{x})=\frac{p(\mathbf{x})}{M},\ \ \ \text{where}\ \ \ M=\ \int_{\Omega}p(\mathbf{x})\mathbf{x}; \tag{9}\]  
Now, the probability density of having not sampled a point \(\mathbf{x}\) before is  
\[\Phi(\mathbf{x})=\frac{\rho(\mathbf{x_{h}})-\rho(\mathbf{x})}{\int_{\Omega}(\rho(\mathbf{x_{h}  
where \(x_{h}\) is the domain point with the highest value of \(\rho(x)\). This way, \(x_{h}\) has zero probability of having not been sampled before.  
In most implementations, the GBNM does not go for a precise maximization of \(\varPhi(x)\) within the search domain. This is because of the computational effort needed to accomplish this task. Instead, \(N_{r}\) points are randomly pulled at each restart, and the one with the highest value of \(\varPhi\) is selected as the starting point for the next NM search. The flow-chart of Figure 3 shows how the GBNM algorithm links the probabilistic restarts to a pure NM search.  
In our implementation of the GBNM method, the maximum number of restarts is not fixed, as the cost of each single local search is a priori unknown. Instead, we set a limit in the total NM iterations, so that, if a local search is taking too long, it is terminated after a while. Moreover, we compute the probability function only over the local convergence points and not over all of the already sampled points. In fact, this last option is memory- and time-consuming and shows degraded performances. Of course, the probability of having found the global optimum increases with the number of probabilistic restarts.  
In the following section, we will detail the choice of the algorithm parameters, as they have been used for aligning the photonic components on the IRIS chip.