import { QBreadcrumbs, QBreadcrumbsEl } from './QBreadcrumbs-d508f268.js';
import { QSeparator } from './QSeparator-f2beec84.js';
import { QItem, QItemSection } from './QItem-1f9e6dcc.js';
import { QList } from './QList-5be5d7fb.js';
import { MarkdownViewer } from './MarkdownViewer-d011cacb.js';
import { _export_sfc } from './_plugin-vue_export-helper-e9a2c33e.js';
import { createElementBlock, createBaseVNode, createVNode, withCtx, resolveComponent, openBlock, createTextVNode, pushScopeId, popScopeId } from './__federation_expose_Modules-a9c6a6fc.js';

const content = `

##### **Overview of Optimization Algorithms**

In this section, we will explore a variety of hyperparameter tuning algorithms supported by D2.

The list of algorithms supported by D2:
- Grid Search
- Random Search
- Bayesian optimization
- Hyperband 
- Tree of Parzen Estimation (TPE)
- Multivariate TPE
- Covoriance Matrix Adaptation Evolution Strategy (CMA-ES)

By default, D2 ultilizes *Random Search* as optimization algorithm for hyperparameters tunning.

##### **Algorithms Details**

###### ***Grid Search***

*Grid search* is beneficial when dealing with discrete variables exclusively (as opposed to continuous variables) and the number of potential combinations is limited. A grid search conducts a thorough exploration of all possible parameter combinations, resulting in a significantly time-consuming search process, even for moderately sized problems.

###### ***Random Search***

*Random search* is a viable alternative to grid search and is particularly useful when dealing with a large number of discrete variables to optimize and lengthy evaluation times for each parameter setting. When all parameters are discrete, random search employs sampling without replacement. As a result, random search is the preferred algorithm when combinatorial exploration is not feasible. On the other hand, if there is a significant number of continuous variables, it is advisable to employ quasi-random sampling instead.

###### ***Bayesian optimization***

The *Bayesian optimization* method utilizes Gaussian process regression to create a model of the search space. This approach provides estimates of the loss function and the corresponding uncertainty at each point within the search space. Bayesian optimization is particularly effective when dealing with low-dimensional search spaces. By modeling both the expected loss and the uncertainty, the search algorithm can converge quickly, making it a suitable choice when evaluating a parameter configuration is time-consuming.

###### ***Hyperband***

*Hyperband*, in contrast to Bayesian optimization, prioritizes early stopping as a means to optimize resource allocation and maximize the number of configurations that can be evaluated. By emphasizing the speed of the search process, Hyperband aims to efficiently explore a wide range of configurations.

More details of *Hyperband* can be found at their original [paper](https://arxiv.org/pdf/1603.06560.pdf).

###### ***The Tree of Parzen Estimators (TPE)***

The *Tree of Parzen Estimators (TPE)* algorithm is a Bayesian optimization approach for hyperparameter optimization. 
  
It divides the search process into two components: exploration and exploitation. It maintains two probability density functions (PDFs): one for the configurations that have produced good results (exploitation) and another for the configurations that are expected to lead to better results (exploration). These PDFs are constructed iteratively based on the evaluation of different hyperparameter configurations.
  
During each iteration, the TPE algorithm samples new configurations from the exploration PDF, guided by the expected improvement in performance. The sampled configurations are then evaluated using a performance metric on a validation set. The evaluation results are used to update the PDFs and refine the estimates of the hyperparameter space.

More details of *Tree of Parzen Estimators (TPE)* algorithm can be found at their original [paper](https://arxiv.org/pdf/1703.01785.pdf).

###### ***Multivariate TPE***

The *Multivariate Tree of Parzen Estimators (Multivariate TPE)* algorithm is an extension of the Tree of Parzen Estimators (TPE) approach.
  
Similar to TPE, the Multivariate TPE algorithm maintains probability density functions (PDFs) for the explored hyperparameter space. However, instead of modeling each hyperparameter independently, Multivariate TPE models the joint distribution of multiple hyperparameters.
  
By jointly modeling the hyperparameters, Multivariate TPE takes into account the interactions and dependencies between them, leading to more efficient exploration and better convergence towards optimal configurations. As a result, it is particularly useful when optimizing hyperparameters that have dependencies or when dealing with high-dimensional search spaces. 
  
More details of *Multivariate TPE* algorithm can be found at [here](https://tech.preferred.jp/en/blog/multivariate-tpe-makes-optuna-even-more-powerful).

###### ***Covariance Matrix Adaptation Evolution Strategy (CMA-ES)***

*CMA-ES* employs an evolutionary search strategy that mimics natural evolution to iteratively improve hyperparameter configurations. It maintains a population of candidate solutions and adapts the covariance matrix to guide the search towards promising regions of the hyperparameter space.
  
During each iteration, CMA-ES generates new candidate solutions by sampling from a multivariate normal distribution. The mean vector and covariance matrix of the distribution are updated based on the performance of the candidate solutions. The algorithm seeks to optimize an objective function by iteratively adjusting the distribution parameters to explore and exploit the hyperparameter space effectively.

More details of *CMA-ES* algorithm can be found at [here](https://en.wikipedia.org/wiki/CMA-ES).
`;

const algorithm_vue_vue_type_style_index_0_scoped_4ee91ca0_lang = '';

const _sfc_main = {
  components: {
    MarkdownViewer
  },
  data() {
    return {
      value: content,
      activeOverviewOptimizationAlgorithm: true,
      activeAlgorithmDetails: false,
      activeGridSearch: false,
      activeRandomSearch: false,
      activeBayesianOptimization: false,
      activeHyperband: false,
      activeTPE: false,
      activeMultivariateTPE: false,
      activeCMAES: false
    };
  },
  methods: {
    setActive(section) {
      this.activeOverviewOptimizationAlgorithm = false;
      this.activeAlgorithmDetails = false;
      this.activeGridSearch = false;
      this.activeRandomSearch = false;
      this.activeBayesianOptimization = false;
      this.activeHyperband = false;
      this.activeTPE = false;
      this.activeMultivariateTPE = false;
      this.activeCMAES = false;
      if (section == 'activeOverviewOptimizationAlgorithm') {
        this.activeOverviewOptimizationAlgorithm = true;
      } else if (section == 'activeAlgorithmDetails') {
        this.activeAlgorithmDetails = true;
      } else if (section == 'activeGridSearch') {
        this.activeGridSearch = true;
      } else if (section == 'activeRandomSearch') {
        this.activeRandomSearch = true;
      } else if (section == 'activeBayesianOptimization') {
        this.activeBayesianOptimization = true;
      } else if (section == 'activeHyperband') {
        this.activeHyperband = true;
      } else if (section == 'activeTPE') {
        this.activeTPE = true;
      } else if (section == 'activeMultivariateTPE') {
        this.activeMultivariateTPE = true;
      } else if (section == 'activeCMAES') {
        this.activeCMAES = true;
      }
    }
  },
  mounted() {
    window.scrollTo(0, 0);
  }
};
const _withScopeId = n => (pushScopeId("data-v-4ee91ca0"), n = n(), popScopeId(), n);
const _hoisted_1 = {
  class: "row",
  style: {
    "column-gap": "10px"
  }
};
const _hoisted_2 = {
  class: "col"
};
const _hoisted_3 = {
  class: "row nav-text"
};
const _hoisted_4 = {
  class: "col"
};
const _hoisted_5 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/createBaseVNode("span", null, "Docs", -1));
const _hoisted_6 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/createBaseVNode("span", null, "Components", -1));
const _hoisted_7 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/createBaseVNode("span", null, "Hyperparameters Optimization", -1));
const _hoisted_8 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/createBaseVNode("span", null, "Optimization Algorithms", -1));
const _hoisted_9 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/createBaseVNode("div", {
  class: "title"
}, [/*#__PURE__*/createBaseVNode("span", null, "Optimization Algorithms")], -1));
const _hoisted_10 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/createBaseVNode("div", {
  class: "subtitle"
}, [/*#__PURE__*/createBaseVNode("span", null, "The details of hyperparameters optimization algorithms")], -1));
const _hoisted_11 = {
  class: "col-3"
};
const _hoisted_12 = {
  style: {
    "position": "sticky",
    "top": "20px",
    "color": "#888888"
  }
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_markdown_viewer = resolveComponent("markdown-viewer");
  return openBlock(), createElementBlock("div", _hoisted_1, [createBaseVNode("div", _hoisted_2, [createBaseVNode("div", _hoisted_3, [createBaseVNode("div", _hoisted_4, [createVNode(QBreadcrumbs, null, {
    default: withCtx(() => [createVNode(QBreadcrumbsEl, {
      to: "/docs"
    }, {
      default: withCtx(() => [_hoisted_5]),
      _: 1
    }), createVNode(QBreadcrumbsEl, {
      to: "/docs/components"
    }, {
      default: withCtx(() => [_hoisted_6]),
      _: 1
    }), createVNode(QBreadcrumbsEl, {
      to: "/docs/components/hpo/"
    }, {
      default: withCtx(() => [_hoisted_7]),
      _: 1
    }), createVNode(QBreadcrumbsEl, {
      to: "/docs/components/hpo/algorithms"
    }, {
      default: withCtx(() => [_hoisted_8]),
      _: 1
    })]),
    _: 1
  })])]), _hoisted_9, _hoisted_10, createVNode(QSeparator), createBaseVNode("div", null, [createVNode(_component_markdown_viewer, {
    value: $data.value
  }, null, 8, ["value"])])]), createBaseVNode("div", _hoisted_11, [createBaseVNode("div", _hoisted_12, [createVNode(QList, {
    dense: ""
  }, {
    default: withCtx(() => [createVNode(QItem, {
      active: $data.activeOverviewOptimizationAlgorithm,
      "active-class": "text-bold",
      "manual-focus": "",
      dense: "",
      clickable: "",
      to: {
        hash: '#overview-of-optimization-algorithms'
      },
      onClick: _cache[0] || (_cache[0] = $event => $options.setActive('activeOverviewOptimizationAlgorithm'))
    }, {
      default: withCtx(() => [createVNode(QItemSection, {
        class: "q-item-text"
      }, {
        default: withCtx(() => [createTextVNode("Overview of Optimization Algorithms")]),
        _: 1
      })]),
      _: 1
    }, 8, ["active"]), createVNode(QItem, {
      active: $data.activeAlgorithmDetails,
      "active-class": "text-bold",
      "manual-focus": "",
      dense: "",
      clickable: "",
      to: {
        hash: '#algorithms-details'
      },
      onClick: _cache[1] || (_cache[1] = $event => $options.setActive('activeAlgorithmDetails'))
    }, {
      default: withCtx(() => [createVNode(QItemSection, {
        class: "q-item-text"
      }, {
        default: withCtx(() => [createTextVNode("Algorithms Details")]),
        _: 1
      })]),
      _: 1
    }, 8, ["active"]), createVNode(QItem, {
      "inset-level": 0.5
    }, {
      default: withCtx(() => [createVNode(QList, {
        dense: ""
      }, {
        default: withCtx(() => [createVNode(QItem, {
          active: $data.activeGridSearch,
          "active-class": "text-bold",
          "manual-focus": "",
          dense: "",
          clickable: "",
          to: {
            hash: '#grid-search'
          },
          onClick: _cache[2] || (_cache[2] = $event => $options.setActive('activeGridSearch'))
        }, {
          default: withCtx(() => [createVNode(QItemSection, {
            class: "q-item-text"
          }, {
            default: withCtx(() => [createTextVNode("Grid Search")]),
            _: 1
          })]),
          _: 1
        }, 8, ["active"]), createVNode(QItem, {
          active: $data.activeRandomSearch,
          "active-class": "text-bold",
          "manual-focus": "",
          dense: "",
          clickable: "",
          to: {
            hash: '#random-search'
          },
          onClick: _cache[3] || (_cache[3] = $event => $options.setActive('activeRandomSearch'))
        }, {
          default: withCtx(() => [createVNode(QItemSection, {
            class: "q-item-text"
          }, {
            default: withCtx(() => [createTextVNode("Random Search")]),
            _: 1
          })]),
          _: 1
        }, 8, ["active"]), createVNode(QItem, {
          active: $data.activeBayesianOptimization,
          "active-class": "text-bold",
          "manual-focus": "",
          dense: "",
          clickable: "",
          to: {
            hash: '#bayesian-optimization'
          },
          onClick: _cache[4] || (_cache[4] = $event => $options.setActive('activeBayesianOptimization'))
        }, {
          default: withCtx(() => [createVNode(QItemSection, {
            class: "q-item-text"
          }, {
            default: withCtx(() => [createTextVNode("Bayesian optimization")]),
            _: 1
          })]),
          _: 1
        }, 8, ["active"]), createVNode(QItem, {
          active: $data.activeHyperband,
          "active-class": "text-bold",
          "manual-focus": "",
          dense: "",
          clickable: "",
          to: {
            hash: '#hyperband'
          },
          onClick: _cache[5] || (_cache[5] = $event => $options.setActive('activeHyperband'))
        }, {
          default: withCtx(() => [createVNode(QItemSection, {
            class: "q-item-text"
          }, {
            default: withCtx(() => [createTextVNode("Hyperband")]),
            _: 1
          })]),
          _: 1
        }, 8, ["active"]), createVNode(QItem, {
          active: $data.activeTPE,
          "active-class": "text-bold",
          "manual-focus": "",
          dense: "",
          clickable: "",
          to: {
            hash: '#the-tree-of-parzen-estimators-(tpe)'
          },
          onClick: _cache[6] || (_cache[6] = $event => $options.setActive('activeTPE'))
        }, {
          default: withCtx(() => [createVNode(QItemSection, {
            class: "q-item-text"
          }, {
            default: withCtx(() => [createTextVNode("The Tree of Parzen Estimators (TPE)")]),
            _: 1
          })]),
          _: 1
        }, 8, ["active", "to"]), createVNode(QItem, {
          active: $data.activeMultivariateTPE,
          "active-class": "text-bold",
          "manual-focus": "",
          dense: "",
          clickable: "",
          to: {
            hash: '#multivariate-tpe'
          },
          onClick: _cache[7] || (_cache[7] = $event => $options.setActive('activeMultivariateTPE'))
        }, {
          default: withCtx(() => [createVNode(QItemSection, {
            class: "q-item-text"
          }, {
            default: withCtx(() => [createTextVNode("Multivariate TPE")]),
            _: 1
          })]),
          _: 1
        }, 8, ["active"]), createVNode(QItem, {
          active: $data.activeCMAES,
          "active-class": "text-bold",
          "manual-focus": "",
          dense: "",
          clickable: "",
          to: {
            hash: '#covariance-matrix-adaptation-evolution-strategy-(cma-es)'
          },
          onClick: _cache[8] || (_cache[8] = $event => $options.setActive('activeCMAES'))
        }, {
          default: withCtx(() => [createVNode(QItemSection, {
            class: "q-item-text"
          }, {
            default: withCtx(() => [createTextVNode("Covariance Matrix Adaptation Evolution Strategy (CMA-ES)")]),
            _: 1
          })]),
          _: 1
        }, 8, ["active", "to"])]),
        _: 1
      })]),
      _: 1
    }, 8, ["inset-level"])]),
    _: 1
  })])])]);
}
const algorithm = /*#__PURE__*/_export_sfc(_sfc_main, [['render', _sfc_render], ['__scopeId', "data-v-4ee91ca0"]]);

export { algorithm as default };
