import{s as Ns,n as Rs,o as Ss}from"../chunks/scheduler.9bc65507.js";import{S as Fs,i as xs,g as p,s as l,r as i,A as zs,h as r,f as e,c as n,j as As,u as M,x as m,k as Gs,y as Es,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,z,F,E,j,D,U,gs='🤗 Transformersは、🤗 Transformersモデルのトレーニングを最適化する<a href="/docs/transformers/pr_30079/ja/main_classes/trainer#transformers.Trainer">Trainer</a>クラスを提供し、独自のトレーニングループを手動で記述せずにトレーニングを開始するのが簡単になります。<a href="/docs/transformers/pr_30079/ja/main_classes/trainer#transformers.Trainer">Trainer</a>はハイパーパラメーター検索のAPIも提供しています。このドキュメントでは、それを例示します。',L,u,P,w,_s=`<a href="/docs/transformers/pr_30079/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,I,$s="これらを使用する前に、ハイパーパラメーター検索バックエンドをインストールする必要があります。",O,d,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,_,Xs='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,Bs='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,X,Ys='Ray Tuneに関して、<a href="https://docs.ray.io/en/latest/tune/api/search_space.html" rel="nofollow">object_parameter</a>を参照してください。以下のようになります：',Ms,B,ms,Y,Zs='Wandbについては、<a href="https://docs.wandb.ai/guides/sweeps/configuration" rel="nofollow">object_parameter</a>をご覧ください。これは以下のようになります：',ys,Z,cs,V,Vs='<code>model_init</code> 関数を定義し、それを <a href="/docs/transformers/pr_30079/ja/main_classes/trainer#transformers.Trainer">Trainer</a> に渡す例を示します：',Js,v,os,H,vs='<a href="/docs/transformers/pr_30079/ja/main_classes/trainer#transformers.Trainer">Trainer</a> を <code>model_init</code> 関数、トレーニング引数、トレーニングデータセット、テストデータセット、および評価関数と共に作成してください:',Ts,Q,hs,k,Hs="ハイパーパラメーターの探索を呼び出し、最良のトライアル パラメーターを取得します。バックエンドは <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,G,us,N,ws,R,ks="現在、DDP（Distributed Data Parallel）のためのハイパーパラメーター検索は、Optuna と SigOpt に対して有効になっています。ランクゼロプロセスのみが検索トライアルを生成し、他のランクに引数を渡します。",Is,S,ds,x,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"}}),d=new h({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdHVuYSUyRnNpZ29wdCUyRndhbmRiJTJGcmF5JTVCdHVuZSU1RCUyMA==",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}}),B=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:"dHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0ROb25lJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEc21hbGxfdHJhaW5fZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRHNtYWxsX2V2YWxfZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfbWV0cmljcyUzRGNvbXB1dGVfbWV0cmljcyUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRHRva2VuaXplciUyQyUwQSUyMCUyMCUyMCUyMG1vZGVsX2luaXQlM0Rtb2RlbF9pbml0JTJDJTBBJTIwJTIwJTIwJTIwZGF0YV9jb2xsYXRvciUzRGRhdGFfY29sbGF0b3IlMkMlMEEp",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>    tokenizer=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}}),G=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}}),N=new Cs({props:{title:"Hyperparameter search For DDP finetune",local:"hyperparameter-search-for-ddp-finetune",headingTag:"h2"}}),S=new Ds({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ja/hpo_train.md"}}),{c(){T=p("meta"),z=l(),F=p("p"),E=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(),I=p("p"),I.textContent=$s,O=l(),i(d.$$.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=Xs,ns=l(),i($.$$.fragment),ps=l(),q=p("p"),q.innerHTML=Bs,rs=l(),i(W.$$.fragment),is=l(),X=p("p"),X.innerHTML=Ys,Ms=l(),i(B.$$.fragment),ms=l(),Y=p("p"),Y.innerHTML=Zs,ys=l(),i(Z.$$.fragment),cs=l(),V=p("p"),V.innerHTML=Vs,Js=l(),i(v.$$.fragment),os=l(),H=p("p"),H.innerHTML=vs,Ts=l(),i(Q.$$.fragment),hs=l(),k=p("p"),k.innerHTML=Hs,js=l(),A=p("p"),A.innerHTML=Qs,Us=l(),i(G.$$.fragment),us=l(),i(N.$$.fragment),ws=l(),R=p("p"),R.textContent=ks,Is=l(),i(S.$$.fragment),ds=l(),x=p("p"),this.h()},l(s){const a=zs("svelte-u9bgzb",document.head);T=r(a,"META",{name:!0,content:!0}),a.forEach(e),z=n(s),F=r(s,"P",{}),As(F).forEach(e),E=n(s),M(j.$$.fragment,s),D=n(s),U=r(s,"P",{"data-svelte-h":!0}),m(U)!=="svelte-12w7wya"&&(U.innerHTML=gs),L=n(s),M(u.$$.fragment,s),P=n(s),w=r(s,"P",{"data-svelte-h":!0}),m(w)!=="svelte-ufa1og"&&(w.innerHTML=_s),K=n(s),I=r(s,"P",{"data-svelte-h":!0}),m(I)!=="svelte-1rdjjrk"&&(I.textContent=$s),O=n(s),M(d.$$.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=Xs),ns=n(s),M($.$$.fragment,s),ps=n(s),q=r(s,"P",{"data-svelte-h":!0}),m(q)!=="svelte-pz664g"&&(q.innerHTML=Bs),rs=n(s),M(W.$$.fragment,s),is=n(s),X=r(s,"P",{"data-svelte-h":!0}),m(X)!=="svelte-1jqrfse"&&(X.innerHTML=Ys),Ms=n(s),M(B.$$.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),V=r(s,"P",{"data-svelte-h":!0}),m(V)!=="svelte-ze0wme"&&(V.innerHTML=Vs),Js=n(s),M(v.$$.fragment,s),os=n(s),H=r(s,"P",{"data-svelte-h":!0}),m(H)!=="svelte-3sto6q"&&(H.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=Hs),js=n(s),A=r(s,"P",{"data-svelte-h":!0}),m(A)!=="svelte-1dpfob5"&&(A.innerHTML=Qs),Us=n(s),M(G.$$.fragment,s),us=n(s),M(N.$$.fragment,s),ws=n(s),R=r(s,"P",{"data-svelte-h":!0}),m(R)!=="svelte-thou6i"&&(R.textContent=ks),Is=n(s),M(S.$$.fragment,s),ds=n(s),x=r(s,"P",{}),As(x).forEach(e),this.h()},h(){Gs(T,"name","hf:doc:metadata"),Gs(T,"content",Ps)},m(s,a){Es(document.head,T),t(s,z,a),t(s,F,a),t(s,E,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,I,a),t(s,O,a),y(d,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,X,a),t(s,Ms,a),y(B,s,a),t(s,ms,a),t(s,Y,a),t(s,ys,a),y(Z,s,a),t(s,cs,a),t(s,V,a),t(s,Js,a),y(v,s,a),t(s,os,a),t(s,H,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(G,s,a),t(s,us,a),y(N,s,a),t(s,ws,a),t(s,R,a),t(s,Is,a),y(S,s,a),t(s,ds,a),t(s,x,a),fs=!0},p:Rs,i(s){fs||(c(j.$$.fragment,s),c(u.$$.fragment,s),c(d.$$.fragment,s),c(f.$$.fragment,s),c(g.$$.fragment,s),c($.$$.fragment,s),c(W.$$.fragment,s),c(B.$$.fragment,s),c(Z.$$.fragment,s),c(v.$$.fragment,s),c(Q.$$.fragment,s),c(G.$$.fragment,s),c(N.$$.fragment,s),c(S.$$.fragment,s),fs=!0)},o(s){J(j.$$.fragment,s),J(u.$$.fragment,s),J(d.$$.fragment,s),J(f.$$.fragment,s),J(g.$$.fragment,s),J($.$$.fragment,s),J(W.$$.fragment,s),J(B.$$.fragment,s),J(Z.$$.fragment,s),J(v.$$.fragment,s),J(Q.$$.fragment,s),J(G.$$.fragment,s),J(N.$$.fragment,s),J(S.$$.fragment,s),fs=!1},d(s){s&&(e(z),e(F),e(E),e(D),e(U),e(L),e(P),e(w),e(K),e(I),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(X),e(Ms),e(ms),e(Y),e(ys),e(cs),e(V),e(Js),e(os),e(H),e(Ts),e(hs),e(k),e(js),e(A),e(Us),e(us),e(ws),e(R),e(Is),e(ds),e(x)),e(T),o(j,s),o(u,s),o(d,s),o(f,s),o(g,s),o($,s),o(W,s),o(B,s),o(Z,s),o(v,s),o(Q,s),o(G,s),o(N,s),o(S,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 Ss(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ta extends Fs{constructor(T){super(),xs(this,T,Ks,Ls,Ns,{})}}export{ta as component};
