import{s as Gs,n as Ss,o as Rs}from"../chunks/scheduler.9bc65507.js";import{S as xs,i as Fs,g as p,s as l,r as i,A as Es,h as r,f as e,c as n,j as As,u as M,x as m,k as Ns,y as zs,a as t,v as y,d as c,t as J,w as o}from"../chunks/index.707bf1b6.js";import{C as h}from"../chunks/CodeBlock.54a9f38d.js";import{H as Cs,E as Ds}from"../chunks/EditOnGithub.922df6ba.js";function Ls(bs){let T,E,x,z,j,D,U,gs='🤗 Transformersは、🤗 Transformersモデルのトレーニングを最適化する<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a>クラスを提供し、独自のトレーニングループを手動で記述せずにトレーニングを開始するのが簡単になります。<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a>はハイパーパラメーター検索のAPIも提供しています。このドキュメントでは、それを例示します。',L,u,P,w,_s=`<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a>は現在、4つのハイパーパラメーター検索バックエンドをサポートしています：
<a href="https://optuna.org/" rel="nofollow">optuna</a>、<a href="https://sigopt.com/" rel="nofollow">sigopt</a>、<a href="https://docs.ray.io/en/latest/tune/index.html" rel="nofollow">raytune</a>、および<a href="https://wandb.ai/site/sweeps" rel="nofollow">wandb</a>。`,K,d,$s="これらを使用する前に、ハイパーパラメーター検索バックエンドをインストールする必要があります。",O,I,ss,f,as,C,qs="ハイパーパラメータの検索スペースを定義し、異なるバックエンドには異なるフォーマットが必要です。",es,b,Ws='Sigoptの場合、sigopt <a href="https://docs.sigopt.com/ai-module-api-references/api_reference/objects/object_parameter" rel="nofollow">object_parameter</a> を参照してください。それは以下のようなものです：',ts,g,ls,_,Bs='Optunaに関しては、<a href="https://optuna.readthedocs.io/en/stable/tutorial/10_key_features/002_configurations.html#sphx-glr-tutorial-10-key-features-002-configurations-py" rel="nofollow">object_parameter</a>をご覧ください。以下のようになります：',ns,$,ps,q,Xs='Optunaは、多目的のハイパーパラメータ最適化（HPO）を提供しています。 <code>hyperparameter_search</code> で <code>direction</code> を渡し、複数の目的関数値を返すための独自の <code>compute_objective</code> を定義することができます。 Pareto Front（<code>List[BestRun]</code>）は <code>hyperparameter_search</code> で返され、<a href="https://github.com/huggingface/transformers/blob/main/tests/trainer/test_trainer.py" rel="nofollow">test_trainer</a> のテストケース <code>TrainerHyperParameterMultiObjectOptunaIntegrationTest</code> を参照する必要があります。これは以下のようになります。',rs,W,is,B,Ys='Ray Tuneに関して、<a href="https://docs.ray.io/en/latest/tune/api/search_space.html" rel="nofollow">object_parameter</a>を参照してください。以下のようになります：',Ms,X,ms,Y,Zs='Wandbについては、<a href="https://docs.wandb.ai/guides/sweeps/configuration" rel="nofollow">object_parameter</a>をご覧ください。これは以下のようになります：',ys,Z,cs,H,Hs='<code>model_init</code> 関数を定義し、それを <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a> に渡す例を示します：',Js,V,os,v,Vs='<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a> を <code>model_init</code> 関数、トレーニング引数、トレーニングデータセット、テストデータセット、および評価関数と共に作成してください:',Ts,Q,hs,k,vs="ハイパーパラメーターの探索を呼び出し、最良のトライアル パラメーターを取得します。バックエンドは <code>&quot;optuna&quot;</code> / <code>&quot;sigopt&quot;</code> / <code>&quot;wandb&quot;</code> / <code>&quot;ray&quot;</code> である可能性があります。方向は <code>&quot;minimize&quot;</code> または <code>&quot;maximize&quot;</code> であり、目標をより大きくするか小さくするかを示します。",js,A,Qs="<code>compute_objective</code> 関数を独自に定義することもできます。定義されていない場合、デフォルトの <code>compute_objective</code> が呼び出され、F1などの評価メトリックの合計が目標値として返されます。",Us,N,us,G,ws,S,ks="現在、DDP（Distributed Data Parallel）のためのハイパーパラメーター検索は、Optuna と SigOpt に対して有効になっています。ランクゼロプロセスのみが検索トライアルを生成し、他のランクに引数を渡します。",ds,R,Is,F,fs;return j=new Cs({props:{title:"Hyperparameter Search using Trainer API",local:"hyperparameter-search-using-trainer-api",headingTag:"h1"}}),u=new Cs({props:{title:"Hyperparameter Search backend",local:"hyperparameter-search-backend",headingTag:"h2"}}),I=new h({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdHVuYSUyRnNpZ29wdCUyRndhbmRiJTJGcmF5JTVCdHVuZSU1RA==",highlighted:"pip install optuna/sigopt/wandb/ray[tune]",wrap:!1}}),f=new Cs({props:{title:"How to enable Hyperparameter search in example",local:"how-to-enable-hyperparameter-search-in-example",headingTag:"h2"}}),g=new h({props:{code:"ZGVmJTIwc2lnb3B0X2hwX3NwYWNlKHRyaWFsKSUzQSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMmJvdW5kcyUyMiUzQSUyMCU3QiUyMm1pbiUyMiUzQSUyMDFlLTYlMkMlMjAlMjJtYXglMjIlM0ElMjAxZS00JTdEJTJDJTIwJTIybmFtZSUyMiUzQSUyMCUyMmxlYXJuaW5nX3JhdGUlMjIlMkMlMjAlMjJ0eXBlJTIyJTNBJTIwJTIyZG91YmxlJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY2F0ZWdvcmljYWxfdmFsdWVzJTIyJTNBJTIwJTVCJTIyMTYlMjIlMkMlMjAlMjIzMiUyMiUyQyUyMCUyMjY0JTIyJTJDJTIwJTIyMTI4JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybmFtZSUyMiUzQSUyMCUyMnBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnR5cGUlMjIlM0ElMjAlMjJjYXRlZ29yaWNhbCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">sigopt_hp_space</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> [
<span class="hljs-meta">... </span>        {<span class="hljs-string">&quot;bounds&quot;</span>: {<span class="hljs-string">&quot;min&quot;</span>: <span class="hljs-number">1e-6</span>, <span class="hljs-string">&quot;max&quot;</span>: <span class="hljs-number">1e-4</span>}, <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;learning_rate&quot;</span>, <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;double&quot;</span>},
<span class="hljs-meta">... </span>        {
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;categorical_values&quot;</span>: [<span class="hljs-string">&quot;16&quot;</span>, <span class="hljs-string">&quot;32&quot;</span>, <span class="hljs-string">&quot;64&quot;</span>, <span class="hljs-string">&quot;128&quot;</span>],
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>,
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;categorical&quot;</span>,
<span class="hljs-meta">... </span>        },
<span class="hljs-meta">... </span>    ]`,wrap:!1}}),$=new h({props:{code:"ZGVmJTIwb3B0dW5hX2hwX3NwYWNlKHRyaWFsKSUzQSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmxlYXJuaW5nX3JhdGUlMjIlM0ElMjB0cmlhbC5zdWdnZXN0X2Zsb2F0KCUyMmxlYXJuaW5nX3JhdGUlMjIlMkMlMjAxZS02JTJDJTIwMWUtNCUyQyUyMGxvZyUzRFRydWUpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIyJTNBJTIwdHJpYWwuc3VnZ2VzdF9jYXRlZ29yaWNhbCglMjJwZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlMjIlMkMlMjAlNUIxNiUyQyUyMDMyJTJDJTIwNjQlMkMlMjAxMjglNUQpJTJDJTBBJTIwJTIwJTIwJTIwJTdE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">optuna_hp_space</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;learning_rate&quot;</span>: trial.suggest_float(<span class="hljs-string">&quot;learning_rate&quot;</span>, <span class="hljs-number">1e-6</span>, <span class="hljs-number">1e-4</span>, log=<span class="hljs-literal">True</span>),
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>: trial.suggest_categorical(<span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>, [<span class="hljs-number">16</span>, <span class="hljs-number">32</span>, <span class="hljs-number">64</span>, <span class="hljs-number">128</span>]),
<span class="hljs-meta">... </span>    }`,wrap:!1}}),W=new h({props:{code:"YmVzdF90cmlhbHMlMjAlM0QlMjB0cmFpbmVyLmh5cGVycGFyYW1ldGVyX3NlYXJjaCglMEElMjAlMjAlMjAlMjBkaXJlY3Rpb24lM0QlNUIlMjJtaW5pbWl6ZSUyMiUyQyUyMCUyMm1heGltaXplJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwYmFja2VuZCUzRCUyMm9wdHVuYSUyMiUyQyUwQSUyMCUyMCUyMCUyMGhwX3NwYWNlJTNEb3B0dW5hX2hwX3NwYWNlJTJDJTBBJTIwJTIwJTIwJTIwbl90cmlhbHMlM0QyMCUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfb2JqZWN0aXZlJTNEY29tcHV0ZV9vYmplY3RpdmUlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>best_trials = trainer.hyperparameter_search(
<span class="hljs-meta">... </span>    direction=[<span class="hljs-string">&quot;minimize&quot;</span>, <span class="hljs-string">&quot;maximize&quot;</span>],
<span class="hljs-meta">... </span>    backend=<span class="hljs-string">&quot;optuna&quot;</span>,
<span class="hljs-meta">... </span>    hp_space=optuna_hp_space,
<span class="hljs-meta">... </span>    n_trials=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    compute_objective=compute_objective,
<span class="hljs-meta">... </span>)`,wrap:!1}}),X=new h({props:{code:"ZGVmJTIwcmF5X2hwX3NwYWNlKHRyaWFsKSUzQSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmxlYXJuaW5nX3JhdGUlMjIlM0ElMjB0dW5lLmxvZ3VuaWZvcm0oMWUtNiUyQyUyMDFlLTQpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIyJTNBJTIwdHVuZS5jaG9pY2UoJTVCMTYlMkMlMjAzMiUyQyUyMDY0JTJDJTIwMTI4JTVEKSUyQyUwQSUyMCUyMCUyMCUyMCU3RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">ray_hp_space</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;learning_rate&quot;</span>: tune.loguniform(<span class="hljs-number">1e-6</span>, <span class="hljs-number">1e-4</span>),
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>: tune.choice([<span class="hljs-number">16</span>, <span class="hljs-number">32</span>, <span class="hljs-number">64</span>, <span class="hljs-number">128</span>]),
<span class="hljs-meta">... </span>    }`,wrap:!1}}),Z=new h({props:{code:"ZGVmJTIwd2FuZGJfaHBfc3BhY2UodHJpYWwpJTNBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybWV0aG9kJTIyJTNBJTIwJTIycmFuZG9tJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybWV0cmljJTIyJTNBJTIwJTdCJTIybmFtZSUyMiUzQSUyMCUyMm9iamVjdGl2ZSUyMiUyQyUyMCUyMmdvYWwlMjIlM0ElMjAlMjJtaW5pbWl6ZSUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnBhcmFtZXRlcnMlMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJsZWFybmluZ19yYXRlJTIyJTNBJTIwJTdCJTIyZGlzdHJpYnV0aW9uJTIyJTNBJTIwJTIydW5pZm9ybSUyMiUyQyUyMCUyMm1pbiUyMiUzQSUyMDFlLTYlMkMlMjAlMjJtYXglMjIlM0ElMjAxZS00JTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIyJTNBJTIwJTdCJTIydmFsdWVzJTIyJTNBJTIwJTVCMTYlMkMlMjAzMiUyQyUyMDY0JTJDJTIwMTI4JTVEJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">wandb_hp_space</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;method&quot;</span>: <span class="hljs-string">&quot;random&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;metric&quot;</span>: {<span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;objective&quot;</span>, <span class="hljs-string">&quot;goal&quot;</span>: <span class="hljs-string">&quot;minimize&quot;</span>},
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;parameters&quot;</span>: {
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;learning_rate&quot;</span>: {<span class="hljs-string">&quot;distribution&quot;</span>: <span class="hljs-string">&quot;uniform&quot;</span>, <span class="hljs-string">&quot;min&quot;</span>: <span class="hljs-number">1e-6</span>, <span class="hljs-string">&quot;max&quot;</span>: <span class="hljs-number">1e-4</span>},
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>: {<span class="hljs-string">&quot;values&quot;</span>: [<span class="hljs-number">16</span>, <span class="hljs-number">32</span>, <span class="hljs-number">64</span>, <span class="hljs-number">128</span>]},
<span class="hljs-meta">... </span>        },
<span class="hljs-meta">... </span>    }`,wrap:!1}}),V=new h({props:{code:"ZGVmJTIwbW9kZWxfaW5pdCh0cmlhbCklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtb2RlbF9hcmdzLm1vZGVsX25hbWVfb3JfcGF0aCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZyb21fdGYlM0Rib29sKCUyMi5ja3B0JTIyJTIwaW4lMjBtb2RlbF9hcmdzLm1vZGVsX25hbWVfb3JfcGF0aCklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjb25maWclM0Rjb25maWclMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjYWNoZV9kaXIlM0Rtb2RlbF9hcmdzLmNhY2hlX2RpciUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldmlzaW9uJTNEbW9kZWxfYXJncy5tb2RlbF9yZXZpc2lvbiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRva2VuJTNEVHJ1ZSUyMGlmJTIwbW9kZWxfYXJncy51c2VfYXV0aF90b2tlbiUyMGVsc2UlMjBOb25lJTJDJTBBJTIwJTIwJTIwJTIwKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">model_init</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> AutoModelForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>        model_args.model_name_or_path,
<span class="hljs-meta">... </span>        from_tf=<span class="hljs-built_in">bool</span>(<span class="hljs-string">&quot;.ckpt&quot;</span> <span class="hljs-keyword">in</span> model_args.model_name_or_path),
<span class="hljs-meta">... </span>        config=config,
<span class="hljs-meta">... </span>        cache_dir=model_args.cache_dir,
<span class="hljs-meta">... </span>        revision=model_args.model_revision,
<span class="hljs-meta">... </span>        token=<span class="hljs-literal">True</span> <span class="hljs-keyword">if</span> model_args.use_auth_token <span class="hljs-keyword">else</span> <span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>    )`,wrap:!1}}),Q=new h({props:{code:"dHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0ROb25lJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEc21hbGxfdHJhaW5fZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRHNtYWxsX2V2YWxfZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfbWV0cmljcyUzRGNvbXB1dGVfbWV0cmljcyUyQyUwQSUyMCUyMCUyMCUyMHByb2Nlc3NpbmdfY2xhc3MlM0R0b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBtb2RlbF9pbml0JTNEbW9kZWxfaW5pdCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=<span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=small_train_dataset,
<span class="hljs-meta">... </span>    eval_dataset=small_eval_dataset,
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>    processing_class=tokenizer,
<span class="hljs-meta">... </span>    model_init=model_init,
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>)`,wrap:!1}}),N=new h({props:{code:"YmVzdF90cmlhbCUyMCUzRCUyMHRyYWluZXIuaHlwZXJwYXJhbWV0ZXJfc2VhcmNoKCUwQSUyMCUyMCUyMCUyMGRpcmVjdGlvbiUzRCUyMm1heGltaXplJTIyJTJDJTBBJTIwJTIwJTIwJTIwYmFja2VuZCUzRCUyMm9wdHVuYSUyMiUyQyUwQSUyMCUyMCUyMCUyMGhwX3NwYWNlJTNEb3B0dW5hX2hwX3NwYWNlJTJDJTBBJTIwJTIwJTIwJTIwbl90cmlhbHMlM0QyMCUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfb2JqZWN0aXZlJTNEY29tcHV0ZV9vYmplY3RpdmUlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>best_trial = trainer.hyperparameter_search(
<span class="hljs-meta">... </span>    direction=<span class="hljs-string">&quot;maximize&quot;</span>,
<span class="hljs-meta">... </span>    backend=<span class="hljs-string">&quot;optuna&quot;</span>,
<span class="hljs-meta">... </span>    hp_space=optuna_hp_space,
<span class="hljs-meta">... </span>    n_trials=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    compute_objective=compute_objective,
<span class="hljs-meta">... </span>)`,wrap:!1}}),G=new Cs({props:{title:"Hyperparameter search For DDP finetune",local:"hyperparameter-search-for-ddp-finetune",headingTag:"h2"}}),R=new Ds({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ja/hpo_train.md"}}),{c(){T=p("meta"),E=l(),x=p("p"),z=l(),i(j.$$.fragment),D=l(),U=p("p"),U.innerHTML=gs,L=l(),i(u.$$.fragment),P=l(),w=p("p"),w.innerHTML=_s,K=l(),d=p("p"),d.textContent=$s,O=l(),i(I.$$.fragment),ss=l(),i(f.$$.fragment),as=l(),C=p("p"),C.textContent=qs,es=l(),b=p("p"),b.innerHTML=Ws,ts=l(),i(g.$$.fragment),ls=l(),_=p("p"),_.innerHTML=Bs,ns=l(),i($.$$.fragment),ps=l(),q=p("p"),q.innerHTML=Xs,rs=l(),i(W.$$.fragment),is=l(),B=p("p"),B.innerHTML=Ys,Ms=l(),i(X.$$.fragment),ms=l(),Y=p("p"),Y.innerHTML=Zs,ys=l(),i(Z.$$.fragment),cs=l(),H=p("p"),H.innerHTML=Hs,Js=l(),i(V.$$.fragment),os=l(),v=p("p"),v.innerHTML=Vs,Ts=l(),i(Q.$$.fragment),hs=l(),k=p("p"),k.innerHTML=vs,js=l(),A=p("p"),A.innerHTML=Qs,Us=l(),i(N.$$.fragment),us=l(),i(G.$$.fragment),ws=l(),S=p("p"),S.textContent=ks,ds=l(),i(R.$$.fragment),Is=l(),F=p("p"),this.h()},l(s){const a=Es("svelte-u9bgzb",document.head);T=r(a,"META",{name:!0,content:!0}),a.forEach(e),E=n(s),x=r(s,"P",{}),As(x).forEach(e),z=n(s),M(j.$$.fragment,s),D=n(s),U=r(s,"P",{"data-svelte-h":!0}),m(U)!=="svelte-62nnyw"&&(U.innerHTML=gs),L=n(s),M(u.$$.fragment,s),P=n(s),w=r(s,"P",{"data-svelte-h":!0}),m(w)!=="svelte-1qu3cpb"&&(w.innerHTML=_s),K=n(s),d=r(s,"P",{"data-svelte-h":!0}),m(d)!=="svelte-1rdjjrk"&&(d.textContent=$s),O=n(s),M(I.$$.fragment,s),ss=n(s),M(f.$$.fragment,s),as=n(s),C=r(s,"P",{"data-svelte-h":!0}),m(C)!=="svelte-1r6943w"&&(C.textContent=qs),es=n(s),b=r(s,"P",{"data-svelte-h":!0}),m(b)!=="svelte-gv3yto"&&(b.innerHTML=Ws),ts=n(s),M(g.$$.fragment,s),ls=n(s),_=r(s,"P",{"data-svelte-h":!0}),m(_)!=="svelte-1aualad"&&(_.innerHTML=Bs),ns=n(s),M($.$$.fragment,s),ps=n(s),q=r(s,"P",{"data-svelte-h":!0}),m(q)!=="svelte-pz664g"&&(q.innerHTML=Xs),rs=n(s),M(W.$$.fragment,s),is=n(s),B=r(s,"P",{"data-svelte-h":!0}),m(B)!=="svelte-1jqrfse"&&(B.innerHTML=Ys),Ms=n(s),M(X.$$.fragment,s),ms=n(s),Y=r(s,"P",{"data-svelte-h":!0}),m(Y)!=="svelte-ewosm3"&&(Y.innerHTML=Zs),ys=n(s),M(Z.$$.fragment,s),cs=n(s),H=r(s,"P",{"data-svelte-h":!0}),m(H)!=="svelte-ksrfb3"&&(H.innerHTML=Hs),Js=n(s),M(V.$$.fragment,s),os=n(s),v=r(s,"P",{"data-svelte-h":!0}),m(v)!=="svelte-uaxhh9"&&(v.innerHTML=Vs),Ts=n(s),M(Q.$$.fragment,s),hs=n(s),k=r(s,"P",{"data-svelte-h":!0}),m(k)!=="svelte-wgkw6g"&&(k.innerHTML=vs),js=n(s),A=r(s,"P",{"data-svelte-h":!0}),m(A)!=="svelte-1dpfob5"&&(A.innerHTML=Qs),Us=n(s),M(N.$$.fragment,s),us=n(s),M(G.$$.fragment,s),ws=n(s),S=r(s,"P",{"data-svelte-h":!0}),m(S)!=="svelte-thou6i"&&(S.textContent=ks),ds=n(s),M(R.$$.fragment,s),Is=n(s),F=r(s,"P",{}),As(F).forEach(e),this.h()},h(){Ns(T,"name","hf:doc:metadata"),Ns(T,"content",Ps)},m(s,a){zs(document.head,T),t(s,E,a),t(s,x,a),t(s,z,a),y(j,s,a),t(s,D,a),t(s,U,a),t(s,L,a),y(u,s,a),t(s,P,a),t(s,w,a),t(s,K,a),t(s,d,a),t(s,O,a),y(I,s,a),t(s,ss,a),y(f,s,a),t(s,as,a),t(s,C,a),t(s,es,a),t(s,b,a),t(s,ts,a),y(g,s,a),t(s,ls,a),t(s,_,a),t(s,ns,a),y($,s,a),t(s,ps,a),t(s,q,a),t(s,rs,a),y(W,s,a),t(s,is,a),t(s,B,a),t(s,Ms,a),y(X,s,a),t(s,ms,a),t(s,Y,a),t(s,ys,a),y(Z,s,a),t(s,cs,a),t(s,H,a),t(s,Js,a),y(V,s,a),t(s,os,a),t(s,v,a),t(s,Ts,a),y(Q,s,a),t(s,hs,a),t(s,k,a),t(s,js,a),t(s,A,a),t(s,Us,a),y(N,s,a),t(s,us,a),y(G,s,a),t(s,ws,a),t(s,S,a),t(s,ds,a),y(R,s,a),t(s,Is,a),t(s,F,a),fs=!0},p:Ss,i(s){fs||(c(j.$$.fragment,s),c(u.$$.fragment,s),c(I.$$.fragment,s),c(f.$$.fragment,s),c(g.$$.fragment,s),c($.$$.fragment,s),c(W.$$.fragment,s),c(X.$$.fragment,s),c(Z.$$.fragment,s),c(V.$$.fragment,s),c(Q.$$.fragment,s),c(N.$$.fragment,s),c(G.$$.fragment,s),c(R.$$.fragment,s),fs=!0)},o(s){J(j.$$.fragment,s),J(u.$$.fragment,s),J(I.$$.fragment,s),J(f.$$.fragment,s),J(g.$$.fragment,s),J($.$$.fragment,s),J(W.$$.fragment,s),J(X.$$.fragment,s),J(Z.$$.fragment,s),J(V.$$.fragment,s),J(Q.$$.fragment,s),J(N.$$.fragment,s),J(G.$$.fragment,s),J(R.$$.fragment,s),fs=!1},d(s){s&&(e(E),e(x),e(z),e(D),e(U),e(L),e(P),e(w),e(K),e(d),e(O),e(ss),e(as),e(C),e(es),e(b),e(ts),e(ls),e(_),e(ns),e(ps),e(q),e(rs),e(is),e(B),e(Ms),e(ms),e(Y),e(ys),e(cs),e(H),e(Js),e(os),e(v),e(Ts),e(hs),e(k),e(js),e(A),e(Us),e(us),e(ws),e(S),e(ds),e(Is),e(F)),e(T),o(j,s),o(u,s),o(I,s),o(f,s),o(g,s),o($,s),o(W,s),o(X,s),o(Z,s),o(V,s),o(Q,s),o(N,s),o(G,s),o(R,s)}}}const Ps='{"title":"Hyperparameter Search using Trainer API","local":"hyperparameter-search-using-trainer-api","sections":[{"title":"Hyperparameter Search backend","local":"hyperparameter-search-backend","sections":[],"depth":2},{"title":"How to enable Hyperparameter search in example","local":"how-to-enable-hyperparameter-search-in-example","sections":[],"depth":2},{"title":"Hyperparameter search For DDP finetune","local":"hyperparameter-search-for-ddp-finetune","sections":[],"depth":2}],"depth":1}';function Ks(bs){return Rs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ta extends xs{constructor(T){super(),Fs(this,T,Ks,Ls,Gs,{})}}export{ta as component};
