import{s as ma,n as Ta,o as ua}from"../chunks/scheduler.56730f09.js";import{S as wa,i as Ua,g as l,s as p,u as h,m as ja,A as da,h as n,f as a,c as r,j as y,v as M,y as c,n as Ia,k as i,o,a as e,w as J,d as m,t as T,x as u}from"../chunks/index.ba464511.js";import{I as Ys}from"../chunks/IconCopyLink.89bde88e.js";import{C as g}from"../chunks/CodeBlock.2302fd0d.js";function fa(Gs){let w,is,ts,os,U,f,es,v,Ns,K,Es="Trainer API를 사용한 하이퍼파라미터 탐색",cs,q,Hs="🤗 Transformers에서는 🤗 Transformers 모델을 학습시키는데 최적화된 <code>Trainer</code> 클래스를 제공하기 때문에, 사용자는 직접 훈련 루프를 작성할 필요 없이 더욱 간편하게 학습을 시킬 수 있습니다. 또한, <code>Trainer</code>는 하이퍼파라미터 탐색을 위한 API를 제공합니다. 이 문서에서 이 API를 활용하는 방법을 예시와 함께 보여드리겠습니다.",ys,j,C,ls,$,Qs,O,zs="하이퍼파라미터 탐색 백엔드",hs,X,Fs=`<code>Trainer</code>는 현재 아래 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> 입니다.`,Ms,k,Ds="하이퍼파라미터 탐색 백엔드로 사용하기 전에 아래의 명령어를 사용하여 라이브러리들을 설치하세요.",Js,W,ms,d,b,ns,A,Ss,ss,Ps="예제에서 하이퍼파라미터 탐색을 활성화하는 방법",Ts,Z,Ls="하이퍼파라미터 탐색 공간을 정의하세요. 하이퍼파라미터 탐색 백엔드마다 서로 다른 형식이 필요합니다.",us,x,Ks='sigopt의 경우, 해당 <a href="https://docs.sigopt.com/ai-module-api-references/api_reference/objects/object_parameter" rel="nofollow">object_parameter</a> 문서를 참조하여 아래와 같이 작성하세요:',ws,B,Us,V,Os='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> 문서를 참조하여 아래와 같이 작성하세요:',js,Y,ds,N,sa='raytune의 경우, 해당 <a href="https://docs.ray.io/en/latest/tune/api/search_space.html" rel="nofollow">object_parameter</a> 문서를 참조하여 아래와 같이 작성하세요:',Is,Q,fs,S,aa='wandb의 경우, 해당 <a href="https://docs.wandb.ai/guides/sweeps/configuration" rel="nofollow">object_parameter</a> 문서를 참조하여 아래와 같이 작성하세요:',Cs,R,bs,G,ta="<code>model_init</code> 함수를 정의하고 이를 <code>Trainer</code>에 전달하세요. 아래는 그 예시입니다.",_s,E,gs,H,ea="아래와 같이 <code>model_init</code> 함수, 훈련 인수, 훈련 및 테스트 데이터셋, 그리고 평가 함수를 사용하여 <code>Trainer</code>를 생성하세요:",vs,z,qs,F,la="하이퍼파라미터 탐색을 호출하고, 최적의 시험 매개변수를 가져오세요. 백엔드는 <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> 중 선택하며, 목표를 최소화할 것인지 최대화할 것인지를 결정합니다.",$s,D,na="자신만의 compute_objective 함수를 정의할 수 있습니다. 만약 이 함수를 정의하지 않으면, 기본 compute_objective가 호출되고, f1과 같은 평가 지표의 합이 목푯값으로 반환됩니다.",Xs,P,ks,I,_,ps,L,Rs,as,pa="DDP 미세 조정을 위한 하이퍼파라미터 탐색",Ws,rs,As;return v=new Ys({}),$=new Ys({}),W=new g({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdHVuYSUyRnNpZ29wdCUyRndhbmRiJTJGcmF5JTVCdHVuZSU1RCUyMA==",highlighted:"pip install optuna/sigopt/wandb/ray[tune] ",wrap:!1}}),A=new Ys({}),B=new g({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}}),Y=new g({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}}),Q=new g({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}}),R=new g({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}}),E=new g({props:{code:"ZGVmJTIwbW9kZWxfaW5pdCh0cmlhbCklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtb2RlbF9hcmdzLm1vZGVsX25hbWVfb3JfcGF0aCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZyb21fdGYlM0Rib29sKCUyMi5ja3B0JTIyJTIwaW4lMjBtb2RlbF9hcmdzLm1vZGVsX25hbWVfb3JfcGF0aCklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjb25maWclM0Rjb25maWclMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjYWNoZV9kaXIlM0Rtb2RlbF9hcmdzLmNhY2hlX2RpciUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldmlzaW9uJTNEbW9kZWxfYXJncy5tb2RlbF9yZXZpc2lvbiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHVzZV9hdXRoX3Rva2VuJTNEVHJ1ZSUyMGlmJTIwbW9kZWxfYXJncy51c2VfYXV0aF90b2tlbiUyMGVsc2UlMjBOb25lJTJDJTBBJTIwJTIwJTIwJTIwKQ==",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>        use_auth_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}}),z=new g({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}}),P=new g({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}}),L=new Ys({}),{c(){w=l("meta"),is=p(),ts=l("p"),os=p(),U=l("h1"),f=l("a"),es=l("span"),h(v.$$.fragment),Ns=p(),K=l("span"),K.textContent=Es,cs=p(),q=l("p"),q.innerHTML=Hs,ys=p(),j=l("h2"),C=l("a"),ls=l("span"),h($.$$.fragment),Qs=p(),O=l("span"),O.textContent=zs,hs=p(),X=l("p"),X.innerHTML=Fs,Ms=p(),k=l("p"),k.textContent=Ds,Js=p(),h(W.$$.fragment),ms=p(),d=l("h2"),b=l("a"),ns=l("span"),h(A.$$.fragment),Ss=p(),ss=l("span"),ss.textContent=Ps,Ts=p(),Z=l("p"),Z.textContent=Ls,us=p(),x=l("p"),x.innerHTML=Ks,ws=p(),h(B.$$.fragment),Us=p(),V=l("p"),V.innerHTML=Os,js=p(),h(Y.$$.fragment),ds=p(),N=l("p"),N.innerHTML=sa,Is=p(),h(Q.$$.fragment),fs=p(),S=l("p"),S.innerHTML=aa,Cs=p(),h(R.$$.fragment),bs=p(),G=l("p"),G.innerHTML=ta,_s=p(),h(E.$$.fragment),gs=p(),H=l("p"),H.innerHTML=ea,vs=p(),h(z.$$.fragment),qs=p(),F=l("p"),F.innerHTML=la,$s=p(),D=l("p"),D.textContent=na,Xs=p(),h(P.$$.fragment),ks=p(),I=l("h2"),_=l("a"),ps=l("span"),h(L.$$.fragment),Rs=p(),as=l("span"),as.textContent=pa,Ws=ja(`


현재, DDP(Distributed Data Parallelism; 분산 데이터 병렬처리)를 위한 하이퍼파라미터 탐색은 optuna와 sigopt에서 가능합니다. 최상위 프로세스가 하이퍼파라미터 탐색 과정을 시작하고 그 결과를 다른 프로세스에 전달합니다.

`),rs=l("p"),this.h()},l(s){const t=da("svelte-1phssyn",document.head);w=n(t,"META",{name:!0,content:!0}),t.forEach(a),is=r(s),ts=n(s,"P",{}),y(ts).forEach(a),os=r(s),U=n(s,"H1",{class:!0});var Zs=y(U);f=n(Zs,"A",{id:!0,class:!0,href:!0});var ra=y(f);es=n(ra,"SPAN",{});var ia=y(es);M(v.$$.fragment,ia),ia.forEach(a),ra.forEach(a),Ns=r(Zs),K=n(Zs,"SPAN",{"data-svelte-h":!0}),c(K)!=="svelte-1y9c4c"&&(K.textContent=Es),Zs.forEach(a),cs=r(s),q=n(s,"P",{"data-svelte-h":!0}),c(q)!=="svelte-1wpadea"&&(q.innerHTML=Hs),ys=r(s),j=n(s,"H2",{class:!0});var xs=y(j);C=n(xs,"A",{id:!0,class:!0,href:!0});var oa=y(C);ls=n(oa,"SPAN",{});var ca=y(ls);M($.$$.fragment,ca),ca.forEach(a),oa.forEach(a),Qs=r(xs),O=n(xs,"SPAN",{"data-svelte-h":!0}),c(O)!=="svelte-5rgs83"&&(O.textContent=zs),xs.forEach(a),hs=r(s),X=n(s,"P",{"data-svelte-h":!0}),c(X)!=="svelte-14yr5bp"&&(X.innerHTML=Fs),Ms=r(s),k=n(s,"P",{"data-svelte-h":!0}),c(k)!=="svelte-1n3obee"&&(k.textContent=Ds),Js=r(s),M(W.$$.fragment,s),ms=r(s),d=n(s,"H2",{class:!0});var Bs=y(d);b=n(Bs,"A",{id:!0,class:!0,href:!0});var ya=y(b);ns=n(ya,"SPAN",{});var ha=y(ns);M(A.$$.fragment,ha),ha.forEach(a),ya.forEach(a),Ss=r(Bs),ss=n(Bs,"SPAN",{"data-svelte-h":!0}),c(ss)!=="svelte-qry50v"&&(ss.textContent=Ps),Bs.forEach(a),Ts=r(s),Z=n(s,"P",{"data-svelte-h":!0}),c(Z)!=="svelte-1aiezuq"&&(Z.textContent=Ls),us=r(s),x=n(s,"P",{"data-svelte-h":!0}),c(x)!=="svelte-wifdo4"&&(x.innerHTML=Ks),ws=r(s),M(B.$$.fragment,s),Us=r(s),V=n(s,"P",{"data-svelte-h":!0}),c(V)!=="svelte-15tcz6x"&&(V.innerHTML=Os),js=r(s),M(Y.$$.fragment,s),ds=r(s),N=n(s,"P",{"data-svelte-h":!0}),c(N)!=="svelte-1q8ydvq"&&(N.innerHTML=sa),Is=r(s),M(Q.$$.fragment,s),fs=r(s),S=n(s,"P",{"data-svelte-h":!0}),c(S)!=="svelte-1a9peeq"&&(S.innerHTML=aa),Cs=r(s),M(R.$$.fragment,s),bs=r(s),G=n(s,"P",{"data-svelte-h":!0}),c(G)!=="svelte-1q7kvtf"&&(G.innerHTML=ta),_s=r(s),M(E.$$.fragment,s),gs=r(s),H=n(s,"P",{"data-svelte-h":!0}),c(H)!=="svelte-17wxp1q"&&(H.innerHTML=ea),vs=r(s),M(z.$$.fragment,s),qs=r(s),F=n(s,"P",{"data-svelte-h":!0}),c(F)!=="svelte-ikq9mj"&&(F.innerHTML=la),$s=r(s),D=n(s,"P",{"data-svelte-h":!0}),c(D)!=="svelte-1k38imx"&&(D.textContent=na),Xs=r(s),M(P.$$.fragment,s),ks=r(s),I=n(s,"H2",{class:!0});var Vs=y(I);_=n(Vs,"A",{id:!0,class:!0,href:!0});var Ma=y(_);ps=n(Ma,"SPAN",{});var Ja=y(ps);M(L.$$.fragment,Ja),Ja.forEach(a),Ma.forEach(a),Rs=r(Vs),as=n(Vs,"SPAN",{"data-svelte-h":!0}),c(as)!=="svelte-1f2wqi9"&&(as.textContent=pa),Vs.forEach(a),Ws=Ia(s,`


현재, DDP(Distributed Data Parallelism; 분산 데이터 병렬처리)를 위한 하이퍼파라미터 탐색은 optuna와 sigopt에서 가능합니다. 최상위 프로세스가 하이퍼파라미터 탐색 과정을 시작하고 그 결과를 다른 프로세스에 전달합니다.

`),rs=n(s,"P",{}),y(rs).forEach(a),this.h()},h(){i(w,"name","hf:doc:metadata"),i(w,"content",JSON.stringify(Ca)),i(f,"id","hyperparameter-search-using-trainer-api"),i(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(f,"href","#hyperparameter-search-using-trainer-api"),i(U,"class","relative group"),i(C,"id","hyperparameter-search-backend"),i(C,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(C,"href","#hyperparameter-search-backend"),i(j,"class","relative group"),i(b,"id","how-to-enable-hyperparameter-search-in-example"),i(b,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(b,"href","#how-to-enable-hyperparameter-search-in-example"),i(d,"class","relative group"),i(_,"id","hyperparameter-search-for-ddp-finetune"),i(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(_,"href","#hyperparameter-search-for-ddp-finetune"),i(I,"class","relative group")},m(s,t){o(document.head,w),e(s,is,t),e(s,ts,t),e(s,os,t),e(s,U,t),o(U,f),o(f,es),J(v,es,null),o(U,Ns),o(U,K),e(s,cs,t),e(s,q,t),e(s,ys,t),e(s,j,t),o(j,C),o(C,ls),J($,ls,null),o(j,Qs),o(j,O),e(s,hs,t),e(s,X,t),e(s,Ms,t),e(s,k,t),e(s,Js,t),J(W,s,t),e(s,ms,t),e(s,d,t),o(d,b),o(b,ns),J(A,ns,null),o(d,Ss),o(d,ss),e(s,Ts,t),e(s,Z,t),e(s,us,t),e(s,x,t),e(s,ws,t),J(B,s,t),e(s,Us,t),e(s,V,t),e(s,js,t),J(Y,s,t),e(s,ds,t),e(s,N,t),e(s,Is,t),J(Q,s,t),e(s,fs,t),e(s,S,t),e(s,Cs,t),J(R,s,t),e(s,bs,t),e(s,G,t),e(s,_s,t),J(E,s,t),e(s,gs,t),e(s,H,t),e(s,vs,t),J(z,s,t),e(s,qs,t),e(s,F,t),e(s,$s,t),e(s,D,t),e(s,Xs,t),J(P,s,t),e(s,ks,t),e(s,I,t),o(I,_),o(_,ps),J(L,ps,null),o(I,Rs),o(I,as),e(s,Ws,t),e(s,rs,t),As=!0},p:Ta,i(s){As||(m(v.$$.fragment,s),m($.$$.fragment,s),m(W.$$.fragment,s),m(A.$$.fragment,s),m(B.$$.fragment,s),m(Y.$$.fragment,s),m(Q.$$.fragment,s),m(R.$$.fragment,s),m(E.$$.fragment,s),m(z.$$.fragment,s),m(P.$$.fragment,s),m(L.$$.fragment,s),As=!0)},o(s){T(v.$$.fragment,s),T($.$$.fragment,s),T(W.$$.fragment,s),T(A.$$.fragment,s),T(B.$$.fragment,s),T(Y.$$.fragment,s),T(Q.$$.fragment,s),T(R.$$.fragment,s),T(E.$$.fragment,s),T(z.$$.fragment,s),T(P.$$.fragment,s),T(L.$$.fragment,s),As=!1},d(s){s&&(a(is),a(ts),a(os),a(U),a(cs),a(q),a(ys),a(j),a(hs),a(X),a(Ms),a(k),a(Js),a(ms),a(d),a(Ts),a(Z),a(us),a(x),a(ws),a(Us),a(V),a(js),a(ds),a(N),a(Is),a(fs),a(S),a(Cs),a(bs),a(G),a(_s),a(gs),a(H),a(vs),a(qs),a(F),a($s),a(D),a(Xs),a(ks),a(I),a(Ws),a(rs)),a(w),u(v),u($),u(W,s),u(A),u(B,s),u(Y,s),u(Q,s),u(R,s),u(E,s),u(z,s),u(P,s),u(L)}}}const Ca={local:"hyperparameter-search-using-trainer-api",sections:[{local:"hyperparameter-search-backend",title:"하이퍼파라미터 탐색 백엔드 "},{local:"how-to-enable-hyperparameter-search-in-example",title:"예제에서 하이퍼파라미터 탐색을 활성화하는 방법 "},{local:"hyperparameter-search-for-ddp-finetune",title:"DDP 미세 조정을 위한 하이퍼파라미터 탐색 "}],title:"Trainer API를 사용한 하이퍼파라미터 탐색 "};function ba(Gs){return ua(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $a extends wa{constructor(w){super(),Ua(this,w,ba,fa,ma,{})}}export{$a as component};
