import{s as Ds,o as Rs,n as os}from"../chunks/scheduler.c3dfb84c.js";import{S as xs,i as Vs,e as w,s as a,c as U,h as ks,a as e,d as M,b as n,f as ds,g as J,j as t,k as Ys,l as Fs,m as T,n as y,t as j,o as p,p as I}from"../chunks/index.47c20be5.js";import{T as zs}from"../chunks/Tip.34d6f74f.js";import{C as Qs,H as js,E as Zs}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.423d8c15.js";import{C as i}from"../chunks/CodeBlock.6375aab7.js";function Bs(el){let C,r="In practice, we found <code>num_epochs</code>, <code>max_steps</code>, and <code>body_learning_rate</code> to be the most important hyperparameters for the contrastive learning process.";return{c(){C=w("p"),C.innerHTML=r},l(c){C=e(c,"P",{"data-svelte-h":!0}),t(C)!=="svelte-21oc50"&&(C.innerHTML=r)},m(c,il){T(c,C,il)},p:os,d(c){c&&M(C)}}}function Ws(el){let C,r,c,il,g,Cl,A,tl,h,ps="SetFit models are often very quick to train, making them very suitable for hyperparameter optimization (HPO) to select the best hyperparameters.",cl,m,Is="This guide will show you how to apply HPO for SetFit.",Ol,b,rl,N,is="To use HPO, first install the <code>optuna</code> backend:",gl,u,Al,d,ws="To use this method, you need to define two functions:",hl,Y,es="<li><code>model_init()</code>: A function that instantiates the model to be used. If provided, each call to <code>train()</code> will start from a new instance of the model as given by this function.</li> <li><code>hp_space()</code>: A function that defines the hyperparameter search space.</li>",ml,D,Cs="Here is an example of a <code>model_init()</code> function that we’ll use to scan over the hyperparameters associated with the classification head in <code>SetFitModel</code>:",bl,R,Nl,o,ts="Then, to scan over hyperparameters associated with the SetFit training process, we can define a <code>hp_space(trial)</code> function as follows:",ul,x,dl,O,Yl,V,cs="The next step is to prepare a dataset.",Dl,k,Rl,F,Os='After which we can instantiate a <a href="/docs/setfit/main/en/reference/trainer#setfit.Trainer">Trainer</a> and commence HPO via <a href="/docs/setfit/main/en/reference/trainer#setfit.Trainer.hyperparameter_search">Trainer.hyperparameter_search()</a>. I’ve split up the logs from each trial into separate codeblocks for readability:',ol,z,xl,Q,Vl,Z,kl,B,Fl,W,zl,X,Ql,E,Zl,G,Bl,_,Wl,f,Xl,S,El,v,rs="Let’s observe the best found hyperparameters:",Gl,$,_l,H,fl,q,gs=`Finally, you can apply the hyperparameters you found to the trainer, and lock in the optimal model, before training for
a final time.`,Sl,L,vl,K,$l,P,As="For peace of mind, we can evaluate this model once more:",Hl,ll,ql,sl,Ll,Ml,hs="As expected, the accuracy matches that of the best run.",Kl,Tl,Pl,al,ms="As a comparison, let’s observe the same metrics for the same setup but with the default training arguments:",ls,nl,ss,Ul,Ms,Jl,bs="42.35% versus 47.85%! Quite a big difference for just a few minutes of hyperparameter searching.",Ts,yl,as,jl,Ns="This snippet shows the entire hyperparameter optimization strategy in an end-to-end example:",ns,pl,Us,Il,Js,wl,ys;return g=new Qs({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),A=new js({props:{title:"Hyperparameter Optimization",local:"hyperparameter-optimization",headingTag:"h1"}}),b=new js({props:{title:"Requirements",local:"requirements",headingTag:"h2"}}),u=new i({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdHVuYQ==",highlighted:"pip install optuna",wrap:!1}}),R=new i({props:{code:"ZnJvbSUyMHNldGZpdCUyMGltcG9ydCUyMFNldEZpdE1vZGVsJTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyMERpY3QlMkMlMjBBbnklMEElMEFkZWYlMjBtb2RlbF9pbml0KHBhcmFtcyUzQSUyMERpY3QlNUJzdHIlMkMlMjBBbnklNUQpJTIwLSUzRSUyMFNldEZpdE1vZGVsJTNBJTBBJTIwJTIwJTIwJTIwcGFyYW1zJTIwJTNEJTIwcGFyYW1zJTIwb3IlMjAlN0IlN0QlMEElMjAlMjAlMjAlMjBtYXhfaXRlciUyMCUzRCUyMHBhcmFtcy5nZXQoJTIybWF4X2l0ZXIlMjIlMkMlMjAxMDApJTBBJTIwJTIwJTIwJTIwc29sdmVyJTIwJTNEJTIwcGFyYW1zLmdldCglMjJzb2x2ZXIlMjIlMkMlMjAlMjJsaWJsaW5lYXIlMjIpJTBBJTIwJTIwJTIwJTIwcGFyYW1zJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyaGVhZF9wYXJhbXMlMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJtYXhfaXRlciUyMiUzQSUyMG1heF9pdGVyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyc29sdmVyJTIyJTNBJTIwc29sdmVyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwU2V0Rml0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkJBQUklMkZiZ2Utc21hbGwtZW4tdjEuNSUyMiUyQyUyMCoqcGFyYW1zKQ==",highlighted:`<span class="hljs-keyword">from</span> setfit <span class="hljs-keyword">import</span> SetFitModel
<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">Dict</span>, <span class="hljs-type">Any</span>

<span class="hljs-keyword">def</span> <span class="hljs-title function_">model_init</span>(<span class="hljs-params">params: <span class="hljs-type">Dict</span>[<span class="hljs-built_in">str</span>, <span class="hljs-type">Any</span>]</span>) -&gt; SetFitModel:
    params = params <span class="hljs-keyword">or</span> {}
    max_iter = params.get(<span class="hljs-string">&quot;max_iter&quot;</span>, <span class="hljs-number">100</span>)
    solver = params.get(<span class="hljs-string">&quot;solver&quot;</span>, <span class="hljs-string">&quot;liblinear&quot;</span>)
    params = {
        <span class="hljs-string">&quot;head_params&quot;</span>: {
            <span class="hljs-string">&quot;max_iter&quot;</span>: max_iter,
            <span class="hljs-string">&quot;solver&quot;</span>: solver,
        }
    }
    <span class="hljs-keyword">return</span> S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oJTIybWF4X2l0ZXIlMjIlMkMlMjA1MCUyQyUyMDMwMCklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJzb2x2ZXIlMjIlM0ElMjB0cmlhbC5zdWdnZXN0X2NhdGVnb3JpY2FsKCUyMnNvbHZlciUyMiUyQyUyMCU1QiUyMm5ld3Rvbi1jZyUyMiUyQyUyMCUyMmxiZmdzJTIyJTJDJTIwJTIybGlibGluZWFyJTIyJTVEKSUyQyUwQSUyMCUyMCUyMCUyMCU3RA==",highlighted:`<span class="hljs-keyword">from</span> optuna <span class="hljs-keyword">import</span> Trial
<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">Dict</span>, <span class="hljs-type">Union</span>

<span class="hljs-keyword">def</span> <span class="hljs-title function_">hp_space</span>(<span class="hljs-params">trial: Trial</span>) -&gt; <span class="hljs-type">Dict</span>[<span class="hljs-built_in">str</span>, <span class="hljs-type">Union</span>[<span class="hljs-built_in">float</span>, <span class="hljs-built_in">int</span>, <span class="hljs-built_in">str</span>]]:
    <span class="hljs-keyword">return</span> {
        <span class="hljs-string">&quot;body_learning_rate&quot;</span>: trial.suggest_float(<span class="hljs-string">&quot;body_learning_rate&quot;</span>, <span class="hljs-number">1e-6</span>, <span class="hljs-number">1e-3</span>, log=<span class="hljs-literal">True</span>),
        <span class="hljs-string">&quot;num_epochs&quot;</span>: trial.suggest_int(<span class="hljs-string">&quot;num_epochs&quot;</span>, <span class="hljs-number">1</span>, <span class="hljs-number">3</span>),
        <span class="hljs-string">&quot;batch_size&quot;</span>: trial.suggest_categorical(<span class="hljs-string">&quot;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-string">&quot;seed&quot;</span>: trial.suggest_int(<span class="hljs-string">&quot;seed&quot;</span>, <span class="hljs-number">1</span>, <span class="hljs-number">40</span>),
        <span class="hljs-string">&quot;max_iter&quot;</span>: trial.suggest_int(<span class="hljs-string">&quot;max_iter&quot;</span>, <span class="hljs-number">50</span>, <span class="hljs-number">300</span>),
        <span class="hljs-string">&quot;solver&quot;</span>: trial.suggest_categorical(<span class="hljs-string">&quot;solver&quot;</span>, [<span class="hljs-string">&quot;newton-cg&quot;</span>, <span class="hljs-string">&quot;lbfgs&quot;</span>, <span class="hljs-string">&quot;liblinear&quot;</span>]),
    }`,wrap:!1}}),O=new zs({props:{$$slots:{default:[Bs]},$$scope:{ctx:el}}}),k=new i({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBZnJvbSUyMHNldGZpdCUyMGltcG9ydCUyMFRyYWluZXIlMkMlMjBzYW1wbGVfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyU2V0Rml0JTJGZW1vdGlvbiUyMiklMEF0cmFpbl9kYXRhc2V0JTIwJTNEJTIwc2FtcGxlX2RhdGFzZXQoZGF0YXNldCU1QiUyMnRyYWluJTIyJTVEJTJDJTIwbGFiZWxfY29sdW1uJTNEJTIybGFiZWwlMjIlMkMlMjBudW1fc2FtcGxlcyUzRDgpJTBBdGVzdF9kYXRhc2V0JTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQ=",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-keyword">from</span> setfit <span class="hljs-keyword">import</span> Trainer, sample_dataset

dataset = load_dataset(<span class="hljs-string">&quot;SetFit/emotion&quot;</span>)
train_dataset = sample_dataset(dataset[<span class="hljs-string">&quot;train&quot;</span>], label_column=<span class="hljs-string">&quot;label&quot;</span>, num_samples=<span class="hljs-number">8</span>)
test_dataset = dataset[<span class="hljs-string">&quot;test&quot;</span>]`,wrap:!1}}),z=new i({props:{code:"dHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRHRyYWluX2RhdGFzZXQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0R0ZXN0X2RhdGFzZXQlMkMlMEElMjAlMjAlMjAlMjBtb2RlbF9pbml0JTNEbW9kZWxfaW5pdCUyQyUwQSklMEFiZXN0X3J1biUyMCUzRCUyMHRyYWluZXIuaHlwZXJwYXJhbWV0ZXJfc2VhcmNoKGRpcmVjdGlvbiUzRCUyMm1heGltaXplJTIyJTJDJTIwaHBfc3BhY2UlM0RocF9zcGFjZSUyQyUyMG5fdHJpYWxzJTNEMTAp",highlighted:`trainer = Trainer(
    train_dataset=train_dataset,
    eval_dataset=test_dataset,
    model_init=model_init,
)
best_run = trainer.hyperparameter_search(direction=<span class="hljs-string">&quot;maximize&quot;</span>, hp_space=hp_space, n_trials=<span class="hljs-number">10</span>)`,wrap:!1}}),Q=new i({props:{code:" ",highlighted:`[I <span class="hljs-number">2023</span><span class="hljs-number">-11</span><span class="hljs-number">-14</span> <span class="hljs-number">20</span>:<span class="hljs-number">36</span>:<span class="hljs-number">55</span>,<span class="hljs-number">736</span>] A <span class="hljs-built_in">new</span> study created <span class="hljs-keyword">in</span> memory <span class="hljs-keyword">with</span> <span class="hljs-type">name</span>: <span class="hljs-keyword">no</span>-<span class="hljs-type">name</span>-d9c6ec29-c5d8<span class="hljs-number">-48</span>a2<span class="hljs-number">-8</span>f09<span class="hljs-number">-299</span>b1f3740f1
Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">1.937397586885703e-06</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">223</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;newton-cg&#x27;</span>}
model_head.pkl <span class="hljs-keyword">not</span> <span class="hljs-built_in">found</span> <span class="hljs-keyword">on</span> HuggingFace Hub, initialising classification head <span class="hljs-keyword">with</span> random weights. You should TRAIN this model <span class="hljs-keyword">on</span> a downstream task <span class="hljs-keyword">to</span> use it <span class="hljs-keyword">for</span> predictions <span class="hljs-keyword">and</span> inference.
***** Running training *****
  Num examples = <span class="hljs-number">60</span>
  Num epochs = <span class="hljs-number">3</span>
  Total optimization steps = <span class="hljs-number">180</span>
  Total train batch size = <span class="hljs-number">32</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.26</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.0763319927142795e-07</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.02</span>}                                                                                   
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2069</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.5547017672539594e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2145</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">9.567395490793595e-07</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.67</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2236</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">3.587773309047598e-07</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">2.5</span>}                                                                                   
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">36.1299</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">159.425</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">4.982</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">3.0</span>}                                                     
<span class="hljs-number">100</span>%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">180</span>/<span class="hljs-number">180</span> [<span class="hljs-number">00</span>:<span class="hljs-number">29</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">6.02</span>it/s] 
***** Running evaluation *****
[I <span class="hljs-number">2023</span><span class="hljs-number">-11</span><span class="hljs-number">-14</span> <span class="hljs-number">20</span>:<span class="hljs-number">37</span>:<span class="hljs-number">33</span>,<span class="hljs-number">895</span>] Trial <span class="hljs-number">0</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.44</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">1.937397586885703e-06</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">223</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;newton-cg&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">0</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.44</span>.`,wrap:!1}}),Z=new i({props:{code:" ",highlighted:`Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.000946449838705604</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">8</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">60</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;liblinear&#x27;</span>}
model_head.pkl <span class="hljs-keyword">not</span> found <span class="hljs-keyword">on</span> HuggingFace Hub, initialising classification head <span class="hljs-keyword">with</span> random weights. You should TRAIN <span class="hljs-keyword">this</span> model <span class="hljs-keyword">on</span> a downstream task to use it <span class="hljs-keyword">for</span> predictions <span class="hljs-keyword">and</span> inference.
***** Running training *****
  Num examples = <span class="hljs-number">120</span>
  Num epochs = <span class="hljs-number">2</span>
  Total optimization steps = <span class="hljs-number">240</span>
  Total train batch size = <span class="hljs-number">16</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2354</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">3.943540994606683e-05</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.01</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2419</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.0008325253210836332</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.42</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.3601</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.0006134397102721508</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2694</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.00039435409946066835</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.25</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2496</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.0001752684886491859</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.67</span>}                                                                                  
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">33.5015</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">114.622</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">7.164</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">2.0</span>}                                                     
<span class="hljs-number">100</span>%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">240</span>/<span class="hljs-number">240</span> [<span class="hljs-number">00</span>:<span class="hljs-number">33</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">7.16</span>it/s] 
***** Running evaluation *****
[<span class="hljs-meta">I 2023-11-14 20:38:09,485</span>] Trial <span class="hljs-number">1</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.207</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.000946449838705604</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">8</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">60</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;liblinear&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">0</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.44</span>.`,wrap:!1}}),B=new i({props:{code:" ",highlighted:`Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">8.050718146495058e-06</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">20</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">260</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;lbfgs&#x27;</span>}
model_head.pkl <span class="hljs-keyword">not</span> found <span class="hljs-keyword">on</span> HuggingFace Hub, initialising classification head <span class="hljs-keyword">with</span> random weights. You should TRAIN <span class="hljs-keyword">this</span> model <span class="hljs-keyword">on</span> a downstream task to use it <span class="hljs-keyword">for</span> predictions <span class="hljs-keyword">and</span> inference.
***** Running training *****
  Num examples = <span class="hljs-number">60</span>
  Num epochs = <span class="hljs-number">1</span>
  Total optimization steps = <span class="hljs-number">60</span>
  Total train batch size = <span class="hljs-number">32</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2499</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.3417863577491763e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.02</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1714</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.490873730832418e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                  
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">9.5338</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">201.388</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">6.293</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.0</span>}                                                      
<span class="hljs-number">100</span>%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">60</span>/<span class="hljs-number">60</span> [<span class="hljs-number">00</span>:<span class="hljs-number">09</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">6.30</span>it/s] 
***** Running evaluation *****
[<span class="hljs-meta">I 2023-11-14 20:38:21,069</span>] Trial <span class="hljs-number">2</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.436</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">8.050718146495058e-06</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">20</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">260</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;lbfgs&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">0</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.44</span>.`,wrap:!1}}),W=new i({props:{code:" ",highlighted:`Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.000995585414046506</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">29</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">105</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;lbfgs&#x27;</span>}
model_head.pkl <span class="hljs-keyword">not</span> found <span class="hljs-keyword">on</span> HuggingFace Hub, initialising classification head <span class="hljs-keyword">with</span> random weights. You should TRAIN <span class="hljs-keyword">this</span> model <span class="hljs-keyword">on</span> a downstream task to use it <span class="hljs-keyword">for</span> predictions <span class="hljs-keyword">and</span> inference.
***** Running training *****
  Num examples = <span class="hljs-number">60</span>
  Num epochs = <span class="hljs-number">1</span>
  Total optimization steps = <span class="hljs-number">60</span>
  Total train batch size = <span class="hljs-number">32</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2556</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.00016593090234108434</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.02</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.0625</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.0001843676692678715</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                  
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">9.5629</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">200.776</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">6.274</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.0</span>}                                                      
<span class="hljs-number">100</span>%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">60</span>/<span class="hljs-number">60</span> [<span class="hljs-number">00</span>:<span class="hljs-number">09</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">6.28</span>it/s] 
***** Running evaluation *****
[<span class="hljs-meta">I 2023-11-14 20:38:32,890</span>] Trial <span class="hljs-number">3</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.283</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.000995585414046506</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">29</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">105</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;lbfgs&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">0</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.44</span>.`,wrap:!1}}),X=new i({props:{code:" ",highlighted:`Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">8.541092571911196e-06</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">223</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;newton-cg&#x27;</span>}
model_head.pkl <span class="hljs-keyword">not</span> found <span class="hljs-keyword">on</span> HuggingFace Hub, initialising classification head <span class="hljs-keyword">with</span> random weights. You should TRAIN <span class="hljs-keyword">this</span> model <span class="hljs-keyword">on</span> a downstream task to use it <span class="hljs-keyword">for</span> predictions <span class="hljs-keyword">and</span> inference.
***** Running training *****
  Num examples = <span class="hljs-number">60</span>
  Num epochs = <span class="hljs-number">3</span>
  Total optimization steps = <span class="hljs-number">180</span>
  Total train batch size = <span class="hljs-number">32</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2578</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">4.745051428839553e-07</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.02</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1725</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">6.8539631749904665e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1589</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">4.217823492301825e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.67</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1153</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.5816838096131844e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">2.5</span>}                                                                                  
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">28.3099</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">203.462</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">6.358</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">3.0</span>}                                                     
<span class="hljs-number">100</span>%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">180</span>/<span class="hljs-number">180</span> [<span class="hljs-number">00</span>:<span class="hljs-number">28</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">6.36</span>it/s] 
***** Running evaluation *****
[<span class="hljs-meta">I 2023-11-14 20:39:03,196</span>] Trial <span class="hljs-number">4</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4415</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">8.541092571911196e-06</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">223</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;newton-cg&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">4</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4415</span>.`,wrap:!1}}),E=new i({props:{code:"VHJpYWwlM0ElMjAlN0InYm9keV9sZWFybmluZ19yYXRlJyUzQSUyMDIuMzkxNjc4MjQxNzc5MjY1N2UtMDUlMkMlMjAnbnVtX2Vwb2NocyclM0ElMjAxJTJDJTIwJ2JhdGNoX3NpemUnJTNBJTIwNjQlMkMlMjAnc2VlZCclM0ElMjAyMyUyQyUyMCdtYXhfaXRlciclM0ElMjAyNTglMkMlMjAnc29sdmVyJyUzQSUyMCdsaWJsaW5lYXInJTdEJTBBbW9kZWxfaGVhZC5wa2wlMjBub3QlMjBmb3VuZCUyMG9uJTIwSHVnZ2luZ0ZhY2UlMjBIdWIlMkMlMjBpbml0aWFsaXNpbmclMjBjbGFzc2lmaWNhdGlvbiUyMGhlYWQlMjB3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cy4lMjBZb3UlMjBzaG91bGQlMjBUUkFJTiUyMHRoaXMlMjBtb2RlbCUyMG9uJTIwYSUyMGRvd25zdHJlYW0lMjB0YXNrJTIwdG8lMjB1c2UlMjBpdCUyMGZvciUyMHByZWRpY3Rpb25zJTIwYW5kJTIwaW5mZXJlbmNlLiUwQSoqKioqJTIwUnVubmluZyUyMHRyYWluaW5nJTIwKioqKiolMEElMjAlMjBOdW0lMjBleGFtcGxlcyUyMCUzRCUyMDMwJTBBJTIwJTIwTnVtJTIwZXBvY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yMGlzJTIwdHJpYWwlMjA0JTIwd2l0aCUyMHZhbHVlJTNBJTIwMC40NDE1Lg==",highlighted:`Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">2.3916782417792657e-05</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">64</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">23</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">258</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;liblinear&#x27;</span>}
model_head.pkl <span class="hljs-keyword">not</span> found <span class="hljs-keyword">on</span> HuggingFace Hub, initialising classification head <span class="hljs-keyword">with</span> random weights. You should TRAIN <span class="hljs-keyword">this</span> model <span class="hljs-keyword">on</span> a downstream task to use it <span class="hljs-keyword">for</span> predictions <span class="hljs-keyword">and</span> inference.
***** Running training *****
  Num examples = <span class="hljs-number">30</span>
  Num epochs = <span class="hljs-number">1</span>
  Total optimization steps = <span class="hljs-number">30</span>
  Total train batch size = <span class="hljs-number">64</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2478</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">7.972260805930886e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.03</span>}                                                                                  
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">6.4905</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">295.818</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">4.622</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.0</span>}                                                      
<span class="hljs-number">100</span>%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">30</span>/<span class="hljs-number">30</span> [<span class="hljs-number">00</span>:<span class="hljs-number">06</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">4.62</span>it/s] 
***** Running evaluation *****
[<span class="hljs-meta">I 2023-11-14 20:39:12,024</span>] Trial <span class="hljs-number">5</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4345</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">2.3916782417792657e-05</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">64</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">23</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">258</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;liblinear&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">4</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4415</span>.`,wrap:!1}}),G=new i({props:{code:"VHJpYWwlM0ElMjAlN0InYm9keV9sZWFybmluZ19yYXRlJyUzQSUyMDAuMDAwMTI4NTY0MzE0OTMxMjI5MzglMkMlMjAnbnVtX2Vwb2NocyclM0ElMjAxJTJDJTIwJ2JhdGNoX3NpemUnJTNBJTIwMzIlMkMlMjAnc2VlZCclM0ElMjAyOSUyQyUyMCdtYXhfaXRlciclM0ElMjA5NyUyQyUyMCdzb2x2ZXInJTNBJTIwJ2xpYmxpbmVhciclN0QlMEFtb2RlbF9oZWFkLnBrbCUyMG5vdCUyMGZvdW5kJTIwb24lMjBIdWdnaW5nRmFjZSUyMEh1YiUyQyUyMGluaXRpYWxpc2luZyUyMGNsYXNzaWZpY2F0aW9uJTIwaGVhZCUyMHdpdGglMjByYW5kb20lMjB3Z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MjAqKioqKiUwQSU1QkklMjAyMDIzLTExLTE0JTIwMjAlM0EzOSUzQTIzJTJDMzAyJTVEJTIwVHJpYWwlMjA2JTIwZmluaXNoZWQlMjB3aXRoJTIwdmFsdWUlM0ElMjAwLjQ2NzUlMjBhbmQlMjBwYXJhbWV0ZXJzJTNBJTIwJTdCJ2JvZHlfbGVhcm5pbmdfcmF0ZSclM0ElMjAwLjAwMDEyODU2NDMxNDkzMTIyOTM4JTJDJTIwJ251bV9lcG9jaHMnJTNBJTIwMSUyQyUyMCdiYXRjaF9zaXplJyUzQSUyMDMyJTJDJTIwJ3NlZWQnJTNBJTIwMjklMkMlMjAnbWF4X2l0ZXInJTNBJTIwOTclMkMlMjAnc29sdmVyJyUzQSUyMCdsaWJsaW5lYXInJTdELiUyMEJlc3QlMjBpcyUyMHRyaWFsJTIwNiUyMHdpdGglMjB2YWx1ZSUzQSUyMDAuNDY3NS4=",highlighted:`Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.00012856431493122938</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">29</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">97</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;liblinear&#x27;</span>}
model_head.pkl <span class="hljs-keyword">not</span> found <span class="hljs-keyword">on</span> HuggingFace Hub, initialising classification head <span class="hljs-keyword">with</span> random weights. You should TRAIN <span class="hljs-keyword">this</span> model <span class="hljs-keyword">on</span> a downstream task to use it <span class="hljs-keyword">for</span> predictions <span class="hljs-keyword">and</span> inference.
***** Running training *****
  Num examples = <span class="hljs-number">60</span>
  Num epochs = <span class="hljs-number">1</span>
  Total optimization steps = <span class="hljs-number">60</span>
  Total train batch size = <span class="hljs-number">32</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2556</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">2.1427385821871562e-05</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.02</span>}
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.023</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">2.380820646874618e-05</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                   
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">9.2295</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">208.029</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">6.501</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.0</span>}                                                      
<span class="hljs-number">100</span>%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">60</span>/<span class="hljs-number">60</span> [<span class="hljs-number">00</span>:<span class="hljs-number">09</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">6.50</span>it/s] 
***** Running evaluation *****
[<span class="hljs-meta">I 2023-11-14 20:39:23,302</span>] Trial <span class="hljs-number">6</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4675</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.00012856431493122938</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">29</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">97</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;liblinear&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">6</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4675</span>.`,wrap:!1}}),_=new i({props:{code:" ",highlighted:`Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">3.839168294105717e-06</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">297</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;newton-cg&#x27;</span>}
***** Running training *****
  Num examples = <span class="hljs-number">120</span>
  Num epochs = <span class="hljs-number">3</span>
  Total optimization steps = <span class="hljs-number">360</span>
  Total train batch size = <span class="hljs-number">16</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2357</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.066435637251588e-07</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.01</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2268</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">3.6732783060888037e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.42</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1308</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">3.0808140631712545e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2032</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">2.4883498202537057e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.25</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1617</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.8958855773361567e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.67</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1363</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.3034213344186077e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">2.08</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1559</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">7.109570915010587e-07</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">2.5</span>}                                                                                   
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1761</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.1849284858350979e-07</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">2.92</span>}                                                                                 
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">49.8712</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">115.497</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">7.219</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">3.0</span>}                                                     
<span class="hljs-number">100</span>%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">360</span>/<span class="hljs-number">360</span> [<span class="hljs-number">00</span>:<span class="hljs-number">49</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">7.22</span>it/s] 
***** Running evaluation *****
[<span class="hljs-meta">I 2023-11-14 20:40:15,350</span>] Trial <span class="hljs-number">7</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.442</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">3.839168294105717e-06</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">297</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;newton-cg&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">6</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4675</span>.`,wrap:!1}}),f=new i({props:{code:"VHJpYWwlM0ElMjAlN0InYm9keV9sZWFybmluZ19yYXRlJyUzQSUyMDAuMDAwNTU3NTYzMTE3OTM5NjgyNCUyQyUyMCdudW1fZXBvY2hzJyUzQSUyMDElMkMlMjAnYmF0Y2hfc2l6ZSclM0ElMjAzMiUyQyUyMCdzZWVkJyUzQSUyMDMxJTJDJTIwJ21heF9pdGVyJyUzQSUyMDI2NCUyQyUyMCdzb2x2ZXInJTNBJTIwJ25ld3Rvbi1jZyclN0QlMEEqKioqKiUyMFJ1bm5pbmclMjB0cmFpbmluZyUyMCoqKioqJTBBJTIwJTIwTnVtJTIwZXhhbXBsZXMlMjAlM0QlMjA2MCUwQSUyMCUyME51bSUyMGVwb2NocyUyMCUzRCUyMDElMEElMjAlMjBUb3RhbCUyMG9wdGltaXphdGlv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MjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEExMDAlMjUlN0MlRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglN0MlMjA2MCUyRjYwJTIwJTVCMDAlM0EwOSUzQzAwJTNBMDAlMkMlMjAlMjA2LjM0aXQlMkZzJTVEJTIwJTBBKioqKiolMjBSdW5uaW5nJTIwZXZhbHVhdGlvbiUyMCoqKioqJTBBJTVCSSUyMDIwMjMtMTEtMTQlMjAyMCUzQTQwJTNBMjYlMkM4ODYlNUQlMjBUcmlhbCUyMDglMjBmaW5pc2hlZCUyMHdpdGglMjB2YWx1ZSUzQSUyMDAuNDc4NSUyMGFuZCUyMHBhcmFtZXRlcnMlM0ElMjAlN0InYm9keV9sZWFybmluZ19yYXRlJyUzQSUyMDAuMDAwNTU3NTYzMTE3OTM5NjgyNCUyQyUyMCdudW1fZXBvY2hzJyUzQSUyMDElMkMlMjAnYmF0Y2hfc2l6ZSclM0ElMjAzMiUyQyUyMCdzZWVkJyUzQSUyMDMxJTJDJTIwJ21heF9pdGVyJyUzQSUyMDI2NCUyQyUyMCdzb2x2ZXInJTNBJTIwJ25ld3Rvbi1jZyclN0QuJTIwQmVzdCUyMGlzJTIwdHJpYWwlMjA4JTIwd2l0aCUyMHZhbHVlJTNBJTIwMC40Nzg1Lg==",highlighted:`Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.0005575631179396824</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">31</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">264</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;newton-cg&#x27;</span>}
***** Running training *****
  Num examples = <span class="hljs-number">60</span>
  Num epochs = <span class="hljs-number">1</span>
  Total optimization steps = <span class="hljs-number">60</span>
  Total train batch size = <span class="hljs-number">32</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2588</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">9.29271863232804e-05</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.02</span>}
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.0025</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.00010325242924808932</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                 
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">9.4608</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">202.942</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">6.342</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.0</span>}                                                      
<span class="hljs-number">100</span>%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">60</span>/<span class="hljs-number">60</span> [<span class="hljs-number">00</span>:<span class="hljs-number">09</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">6.34</span>it/s] 
***** Running evaluation *****
[<span class="hljs-meta">I 2023-11-14 20:40:26,886</span>] Trial <span class="hljs-number">8</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4785</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.0005575631179396824</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">32</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">31</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">264</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;newton-cg&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">8</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4785</span>.`,wrap:!1}}),S=new i({props:{code:" ",highlighted:`Trial: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.00021830594983845785</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">38</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">267</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;lbfgs&#x27;</span>}
***** Running training *****
  Num examples = <span class="hljs-number">120</span>
  Num epochs = <span class="hljs-number">2</span>
  Total optimization steps = <span class="hljs-number">240</span>
  Total train batch size = <span class="hljs-number">16</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2356</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">9.096081243269076e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.01</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.071</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.00019202838180234718</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.42</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.0021</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.000141494597117519</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                   
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.0018</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">9.096081243269078e-05</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.25</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.0012</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">4.0427027747862565e-05</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.67</span>}                                                                                 
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">32.7462</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">117.265</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">7.329</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">2.0</span>}                                                     
<span class="hljs-number">100</span>%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">240</span>/<span class="hljs-number">240</span> [<span class="hljs-number">00</span>:<span class="hljs-number">32</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">7.33</span>it/s] 
***** Running evaluation *****
[<span class="hljs-meta">I 2023-11-14 20:41:01,722</span>] Trial <span class="hljs-number">9</span> finished <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4615</span> <span class="hljs-keyword">and</span> parameters: {<span class="hljs-string">&#x27;body_learning_rate&#x27;</span>: <span class="hljs-number">0.00021830594983845785</span>, <span class="hljs-string">&#x27;num_epochs&#x27;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&#x27;batch_size&#x27;</span>: <span class="hljs-number">16</span>, <span class="hljs-string">&#x27;seed&#x27;</span>: <span class="hljs-number">38</span>, <span class="hljs-string">&#x27;max_iter&#x27;</span>: <span class="hljs-number">267</span>, <span class="hljs-string">&#x27;solver&#x27;</span>: <span class="hljs-string">&#x27;lbfgs&#x27;</span>}. Best <span class="hljs-keyword">is</span> trial <span class="hljs-number">8</span> <span class="hljs-keyword">with</span> <span class="hljs-keyword">value</span>: <span class="hljs-number">0.4785</span>.`,wrap:!1}}),$=new i({props:{code:"cHJpbnQoYmVzdF9ydW4p",highlighted:'<span class="hljs-built_in">print</span>(best_run)',wrap:!1}}),H=new i({props:{code:"QmVzdFJ1bihydW5faWQlM0QnOCclMkMlMjBvYmplY3RpdmUlM0QwLjQ3ODUlMkMlMjBoeXBlcnBhcmFtZXRlcnMlM0QlN0InYm9keV9sZWFybmluZ19yYXRlJyUzQSUyMDAuMDAwNTU3NTYzMTE3OTM5NjgyNCUyQyUyMCdudW1fZXBvY2hzJyUzQSUyMDElMkMlMjAnYmF0Y2hfc2l6ZSclM0ElMjAzMiUyQyUyMCdzZWVkJyUzQSUyMDMxJTJDJTIwJ21heF9pdGVyJyUzQSUyMDI2NCUyQyUyMCdzb2x2ZXInJTNBJTIwJ25ld3Rvbi1jZyclN0QlMkMlMjBiYWNrZW5kJTNEJTNDb3B0dW5hLnN0dWR5LnN0dWR5LlN0dWR5JTIwb2JqZWN0JTIwYXQlMjAweDAwMDAwMUUwODhCOEMzMTAlM0Up",highlighted:'<span class="hljs-constructor">BestRun(<span class="hljs-params">run_id</span>=&#x27;8&#x27;, <span class="hljs-params">objective</span>=0.4785, <span class="hljs-params">hyperparameters</span>={&#x27;<span class="hljs-params">body_learning_rate</span>&#x27;: 0.0005575631179396824, &#x27;<span class="hljs-params">num_epochs</span>&#x27;: 1, &#x27;<span class="hljs-params">batch_size</span>&#x27;: 32, &#x27;<span class="hljs-params">seed</span>&#x27;: 31, &#x27;<span class="hljs-params">max_iter</span>&#x27;: 264, &#x27;<span class="hljs-params">solver</span>&#x27;: &#x27;<span class="hljs-params">newton</span>-<span class="hljs-params">cg</span>&#x27;}, <span class="hljs-params">backend</span>=&lt;<span class="hljs-params">optuna</span>.<span class="hljs-params">study</span>.<span class="hljs-params">study</span>.Study <span class="hljs-params">object</span> <span class="hljs-params">at</span> 0x000001E088B8C310&gt;)</span>',wrap:!1}}),L=new i({props:{code:"dHJhaW5lci5hcHBseV9oeXBlcnBhcmFtZXRlcnMoYmVzdF9ydW4uaHlwZXJwYXJhbWV0ZXJzJTJDJTIwZmluYWxfbW9kZWwlM0RUcnVlKSUwQXRyYWluZXIudHJhaW4oKQ==",highlighted:`trainer.apply_hyperparameters(best_run.hyperparameters, final_model=<span class="hljs-literal">True</span>)
trainer.train()`,wrap:!1}}),K=new i({props:{code:"KioqKiolMjBSdW5uaW5nJTIwdHJhaW5pbmclMjAqKioqKiUwQSUyMCUyME51bSUyMGV4YW1wbGVzJTIwJTNEJTIwNjAlMEElMjAlMjBOdW0lMjBlcG9jaHMlMjAlM0QlMjAxJTBBJTIwJTIwVG90YWwlMjBvcHRpbWl6YXRpb24lMjBzdGVwcyUyMCUzRCUyMDYwJTBBJTIwJTIwVG90YWwlMjB0cmFpbiUyMGJhdGNoJTIwc2l6ZSUyMCUzRCUyMDMyJTBBJTdCJ2VtYmVkZGluZ19sb3NzJyUzQSUyMDAuMjU4OCUyQyUyMCdsZWFybmluZ19yYXRlJyUzQSUyMDkuMjkyNzE4NjMyMzI4MDRlLTA1JTJDJTIwJ2Vwb2NoJyUzQSUyMDAuMDIlN0QlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlM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lMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEExMDAlMjUlN0MlRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglRTIlOTYlODglN0MlMjA2MCUyRjYwJTIwJTVCMDAlM0EwOSUzQzAwJTNBMDAlMkMlMjAlMjA2LjM2aXQlMkZzJTVEJTIw",highlighted:`***** Running training *****
  <span class="hljs-type">Num</span> <span class="hljs-variable">examples</span> <span class="hljs-operator">=</span> <span class="hljs-number">60</span>
  <span class="hljs-type">Num</span> <span class="hljs-variable">epochs</span> <span class="hljs-operator">=</span> <span class="hljs-number">1</span>
  Total <span class="hljs-type">optimization</span> <span class="hljs-variable">steps</span> <span class="hljs-operator">=</span> <span class="hljs-number">60</span>
  Total train <span class="hljs-type">batch</span> <span class="hljs-variable">size</span> <span class="hljs-operator">=</span> <span class="hljs-number">32</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.2588</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">9.29271863232804e-05</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.02</span>}                                                                                   
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.0025</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">0.00010325242924808932</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                 
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">9.4331</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">203.54</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">6.361</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.0</span>}                                                       
<span class="hljs-number">100</span>%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">60</span>/<span class="hljs-number">60</span> [<span class="hljs-number">00</span>:09&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">6.</span>36it/s] `,wrap:!1}}),ll=new i({props:{code:"bWV0cmljcyUyMCUzRCUyMHRyYWluZXIuZXZhbHVhdGUoKSUwQXByaW50KG1ldHJpY3Mp",highlighted:`metrics = trainer.evaluate()
<span class="hljs-built_in">print</span>(metrics)`,wrap:!1}}),sl=new i({props:{code:"KioqKiolMjBSdW5uaW5nJTIwZXZhbHVhdGlvbiUyMCoqKioqJTBBJTdCJ2FjY3VyYWN5JyUzQSUyMDAuNDc4NSU3RA==",highlighted:`<span class="hljs-bullet">***** </span>Running evaluation <span class="hljs-strong">*****</span>
{<span class="hljs-emphasis">&#x27;accuracy&#x27;</span>: 0.4785}`,wrap:!1}}),Tl=new js({props:{title:"Baseline",local:"baseline",headingTag:"h2"}}),nl=new i({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBZnJvbSUyMHNldGZpdCUyMGltcG9ydCUyMFNldEZpdE1vZGVsJTJDJTIwVHJhaW5lciUyQyUyMHNhbXBsZV9kYXRhc2V0JTBBJTBBbW9kZWwlMjAlM0QlMjBTZXRGaXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyQkFBSSUyRmJnZS1zbWFsbC1lbi12MS41JTIyKSUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyU2V0Rml0JTJGZW1vdGlvbiUyMiklMEF0cmFpbl9kYXRhc2V0JTIwJTNEJTIwc2FtcGxlX2RhdGFzZXQoZGF0YXNldCU1QiUyMnRyYWluJTIyJTVEJTJDJTIwbGFiZWxfY29sdW1uJTNEJTIybGFiZWwlMjIlMkMlMjBudW1fc2FtcGxlcyUzRDgpJTBBdGVzdF9kYXRhc2V0JTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRHRyYWluX2RhdGFzZXQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0R0ZXN0X2RhdGFzZXQlMkMlMEEpJTBBdHJhaW5lci50cmFpbigpJTBBJTBBbWV0cmljcyUyMCUzRCUyMHRyYWluZXIuZXZhbHVhdGUoKSUwQXByaW50KG1ldHJpY3Mp",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-keyword">from</span> setfit <span class="hljs-keyword">import</span> SetFitModel, Trainer, sample_dataset

model = SetFitModel.from_pretrained(<span class="hljs-string">&quot;BAAI/bge-small-en-v1.5&quot;</span>)

dataset = load_dataset(<span class="hljs-string">&quot;SetFit/emotion&quot;</span>)
train_dataset = sample_dataset(dataset[<span class="hljs-string">&quot;train&quot;</span>], label_column=<span class="hljs-string">&quot;label&quot;</span>, num_samples=<span class="hljs-number">8</span>)
test_dataset = dataset[<span class="hljs-string">&quot;test&quot;</span>]

trainer = Trainer(
    model=model,
    train_dataset=train_dataset,
    eval_dataset=test_dataset,
)
trainer.train()

metrics = trainer.evaluate()
<span class="hljs-built_in">print</span>(metrics)`,wrap:!1}}),Ul=new i({props:{code:"KioqKiolMjBSdW5uaW5nJTIwdHJhaW5pbmclMjAqKioqKiUwQSUyMCUyME51bSUyMGV4YW1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JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JUUyJTk2JTg4JTdDJTIwMTIwJTJGMTIwJTIwJTVCMDAlM0ExNyUzQzAwJTNBMDAlMkMlMjAlMjA2LjgzaXQlMkZzJTVEJTIwJTBBKioqKiolMjBSdW5uaW5nJTIwZXZhbHVhdGlvbiUyMCoqKioqJTBBJTdCJ2FjY3VyYWN5JyUzQSUyMDAuNDIzNSU3RA==",highlighted:`***** Running training *****
  <span class="hljs-type">Num</span> <span class="hljs-variable">examples</span> <span class="hljs-operator">=</span> <span class="hljs-number">120</span>
  <span class="hljs-type">Num</span> <span class="hljs-variable">epochs</span> <span class="hljs-operator">=</span> <span class="hljs-number">1</span>
  Total <span class="hljs-type">optimization</span> <span class="hljs-variable">steps</span> <span class="hljs-operator">=</span> <span class="hljs-number">120</span>
  Total train <span class="hljs-type">batch</span> <span class="hljs-variable">size</span> <span class="hljs-operator">=</span> <span class="hljs-number">16</span>
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.246</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.6666666666666667e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.01</span>}                                                                                  
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.1734</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">1.2962962962962964e-05</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.42</span>}                                                                                 
{<span class="hljs-string">&#x27;embedding_loss&#x27;</span>: <span class="hljs-number">0.0411</span>, <span class="hljs-string">&#x27;learning_rate&#x27;</span>: <span class="hljs-number">3.7037037037037037e-06</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">0.83</span>}                                                                                 
{<span class="hljs-string">&#x27;train_runtime&#x27;</span>: <span class="hljs-number">23.8184</span>, <span class="hljs-string">&#x27;train_samples_per_second&#x27;</span>: <span class="hljs-number">80.61</span>, <span class="hljs-string">&#x27;train_steps_per_second&#x27;</span>: <span class="hljs-number">5.038</span>, <span class="hljs-string">&#x27;epoch&#x27;</span>: <span class="hljs-number">1.0</span>}                                                       
<span class="hljs-number">100</span>%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| <span class="hljs-number">120</span>/<span class="hljs-number">120</span> [<span class="hljs-number">00</span>:<span class="hljs-number">17</span>&lt;<span class="hljs-number">00</span>:<span class="hljs-number">00</span>,  <span class="hljs-number">6.</span>83it/s] 
***** Running evaluation *****
{<span class="hljs-string">&#x27;accuracy&#x27;</span>: <span class="hljs-number">0.4235</span>}`,wrap:!1}}),yl=new js({props:{title:"End-to-end",local:"end-to-end",headingTag:"h2"}}),pl=new i({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBZnJvbSUyMHNldGZpdCUyMGltcG9ydCUyMFNldEZpdE1vZGVsJTJDJTIwVHJhaW5lciUyQyUyMHNhbXBsZV9kYXRhc2V0JTBBZnJvbSUyMG9wdHVuYSUyMGltcG9ydCUyMFRyaWFsJTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyMERpY3QlMkMlMjBVbmlvb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QXRyYWluX2RhdGFzZXQlMjAlM0QlMjBzYW1wbGVfZGF0YXNldChkYXRhc2V0JTVCJTIydHJhaW4lMjIlNUQlMkMlMjBsYWJlbF9jb2x1bW4lM0QlMjJsYWJlbCUyMiUyQyUyMG51bV9zYW1wbGVzJTNEOCklMEF0ZXN0X2RhdGFzZXQlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0R0cmFpbl9kYXRhc2V0JTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEdGVzdF9kYXRhc2V0JTJDJTBBJTIwJTIwJTIwJTIwbW9kZWxfaW5pdCUzRG1vZGVsX2luaXQlMkMlMEEpJTBBYmVzdF9ydW4lMjAlM0QlMjB0cmFpbmVyLmh5cGVycGFyYW1ldGVyX3NlYXJjaChkaXJlY3Rpb24lM0QlMjJtYXhpbWl6ZSUyMiUyQyUyMGhwX3NwYWNlJTNEaHBfc3BhY2UlMkMlMjBuX3RyaWFscyUzRDEwKSUwQXByaW50KGJlc3RfcnVuKSUwQSUwQXRyYWluZXIuYXBwbHlfaHlwZXJwYXJhbWV0ZXJzKGJlc3RfcnVuLmh5cGVycGFyYW1ldGVycyUyQyUyMGZpbmFsX21vZGVsJTNEVHJ1ZSklMEF0cmFpbmVyLnRyYWluKCklMEElMEFtZXRyaWNzJTIwJTNEJTIwdHJhaW5lci5ldmFsdWF0ZSgpJTBBcHJpbnQobWV0cmljcyklMEElMjMlMjAlM0QlM0UlMjAlN0InYWNjdXJhY3knJTNBJTIwMC40Nzg1JTdE",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-keyword">from</span> setfit <span class="hljs-keyword">import</span> SetFitModel, Trainer, sample_dataset
<span class="hljs-keyword">from</span> optuna <span class="hljs-keyword">import</span> Trial
<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">Dict</span>, <span class="hljs-type">Union</span>, <span class="hljs-type">Any</span>

<span class="hljs-keyword">def</span> <span class="hljs-title function_">model_init</span>(<span class="hljs-params">params: <span class="hljs-type">Dict</span>[<span class="hljs-built_in">str</span>, <span class="hljs-type">Any</span>]</span>) -&gt; SetFitModel:
    params = params <span class="hljs-keyword">or</span> {}
    max_iter = params.get(<span class="hljs-string">&quot;max_iter&quot;</span>, <span class="hljs-number">100</span>)
    solver = params.get(<span class="hljs-string">&quot;solver&quot;</span>, <span class="hljs-string">&quot;liblinear&quot;</span>)
    params = {
        <span class="hljs-string">&quot;head_params&quot;</span>: {
            <span class="hljs-string">&quot;max_iter&quot;</span>: max_iter,
            <span class="hljs-string">&quot;solver&quot;</span>: solver,
        }
    }
    <span class="hljs-keyword">return</span> SetFitModel.from_pretrained(<span class="hljs-string">&quot;BAAI/bge-small-en-v1.5&quot;</span>, **params)

<span class="hljs-keyword">def</span> <span class="hljs-title function_">hp_space</span>(<span class="hljs-params">trial: Trial</span>) -&gt; <span class="hljs-type">Dict</span>[<span class="hljs-built_in">str</span>, <span class="hljs-type">Union</span>[<span class="hljs-built_in">float</span>, <span class="hljs-built_in">int</span>, <span class="hljs-built_in">str</span>]]:
    <span class="hljs-keyword">return</span> {
        <span class="hljs-string">&quot;body_learning_rate&quot;</span>: trial.suggest_float(<span class="hljs-string">&quot;body_learning_rate&quot;</span>, <span class="hljs-number">1e-6</span>, <span class="hljs-number">1e-3</span>, log=<span class="hljs-literal">True</span>),
        <span class="hljs-string">&quot;num_epochs&quot;</span>: trial.suggest_int(<span class="hljs-string">&quot;num_epochs&quot;</span>, <span class="hljs-number">1</span>, <span class="hljs-number">3</span>),
        <span class="hljs-string">&quot;batch_size&quot;</span>: trial.suggest_categorical(<span class="hljs-string">&quot;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-string">&quot;seed&quot;</span>: trial.suggest_int(<span class="hljs-string">&quot;seed&quot;</span>, <span class="hljs-number">1</span>, <span class="hljs-number">40</span>),
        <span class="hljs-string">&quot;max_iter&quot;</span>: trial.suggest_int(<span class="hljs-string">&quot;max_iter&quot;</span>, <span class="hljs-number">50</span>, <span class="hljs-number">300</span>),
        <span class="hljs-string">&quot;solver&quot;</span>: trial.suggest_categorical(<span class="hljs-string">&quot;solver&quot;</span>, [<span class="hljs-string">&quot;newton-cg&quot;</span>, <span class="hljs-string">&quot;lbfgs&quot;</span>, <span class="hljs-string">&quot;liblinear&quot;</span>]),
    }

dataset = load_dataset(<span class="hljs-string">&quot;SetFit/emotion&quot;</span>)
train_dataset = sample_dataset(dataset[<span class="hljs-string">&quot;train&quot;</span>], label_column=<span class="hljs-string">&quot;label&quot;</span>, num_samples=<span class="hljs-number">8</span>)
test_dataset = dataset[<span class="hljs-string">&quot;test&quot;</span>]

trainer = Trainer(
    train_dataset=train_dataset,
    eval_dataset=test_dataset,
    model_init=model_init,
)
best_run = trainer.hyperparameter_search(direction=<span class="hljs-string">&quot;maximize&quot;</span>, hp_space=hp_space, n_trials=<span class="hljs-number">10</span>)
<span class="hljs-built_in">print</span>(best_run)

trainer.apply_hyperparameters(best_run.hyperparameters, final_model=<span class="hljs-literal">True</span>)
trainer.train()

metrics = trainer.evaluate()
<span class="hljs-built_in">print</span>(metrics)
<span class="hljs-comment"># =&gt; {&#x27;accuracy&#x27;: 0.4785}</span>`,wrap:!1}}),Il=new Zs({props:{source:"https://github.com/huggingface/setfit/blob/main/docs/source/en/how_to/hyperparameter_optimization.mdx"}}),{c(){C=w("meta"),r=a(),c=w("p"),il=a(),U(g.$$.fragment),Cl=a(),U(A.$$.fragment),tl=a(),h=w("p"),h.textContent=ps,cl=a(),m=w("p"),m.textContent=Is,Ol=a(),U(b.$$.fragment),rl=a(),N=w("p"),N.innerHTML=is,gl=a(),U(u.$$.fragment),Al=a(),d=w("p"),d.textContent=ws,hl=a(),Y=w("ul"),Y.innerHTML=es,ml=a(),D=w("p"),D.innerHTML=Cs,bl=a(),U(R.$$.fragment),Nl=a(),o=w("p"),o.innerHTML=ts,ul=a(),U(x.$$.fragment),dl=a(),U(O.$$.fragment),Yl=a(),V=w("p"),V.textContent=cs,Dl=a(),U(k.$$.fragment),Rl=a(),F=w("p"),F.innerHTML=Os,ol=a(),U(z.$$.fragment),xl=a(),U(Q.$$.fragment),Vl=a(),U(Z.$$.fragment),kl=a(),U(B.$$.fragment),Fl=a(),U(W.$$.fragment),zl=a(),U(X.$$.fragment),Ql=a(),U(E.$$.fragment),Zl=a(),U(G.$$.fragment),Bl=a(),U(_.$$.fragment),Wl=a(),U(f.$$.fragment),Xl=a(),U(S.$$.fragment),El=a(),v=w("p"),v.textContent=rs,Gl=a(),U($.$$.fragment),_l=a(),U(H.$$.fragment),fl=a(),q=w("p"),q.textContent=gs,Sl=a(),U(L.$$.fragment),vl=a(),U(K.$$.fragment),$l=a(),P=w("p"),P.textContent=As,Hl=a(),U(ll.$$.fragment),ql=a(),U(sl.$$.fragment),Ll=a(),Ml=w("p"),Ml.textContent=hs,Kl=a(),U(Tl.$$.fragment),Pl=a(),al=w("p"),al.textContent=ms,ls=a(),U(nl.$$.fragment),ss=a(),U(Ul.$$.fragment),Ms=a(),Jl=w("p"),Jl.textContent=bs,Ts=a(),U(yl.$$.fragment),as=a(),jl=w("p"),jl.textContent=Ns,ns=a(),U(pl.$$.fragment),Us=a(),U(Il.$$.fragment),Js=a(),wl=w("p"),this.h()},l(l){const s=ks("svelte-u9bgzb",document.head);C=e(s,"META",{name:!0,content:!0}),s.forEach(M),r=n(l),c=e(l,"P",{}),ds(c).forEach(M),il=n(l),J(g.$$.fragment,l),Cl=n(l),J(A.$$.fragment,l),tl=n(l),h=e(l,"P",{"data-svelte-h":!0}),t(h)!=="svelte-gyfj2q"&&(h.textContent=ps),cl=n(l),m=e(l,"P",{"data-svelte-h":!0}),t(m)!=="svelte-1ywkflw"&&(m.textContent=Is),Ol=n(l),J(b.$$.fragment,l),rl=n(l),N=e(l,"P",{"data-svelte-h":!0}),t(N)!=="svelte-113p5ez"&&(N.innerHTML=is),gl=n(l),J(u.$$.fragment,l),Al=n(l),d=e(l,"P",{"data-svelte-h":!0}),t(d)!=="svelte-1h1g3w1"&&(d.textContent=ws),hl=n(l),Y=e(l,"UL",{"data-svelte-h":!0}),t(Y)!=="svelte-16e6dsc"&&(Y.innerHTML=es),ml=n(l),D=e(l,"P",{"data-svelte-h":!0}),t(D)!=="svelte-gq9zgk"&&(D.innerHTML=Cs),bl=n(l),J(R.$$.fragment,l),Nl=n(l),o=e(l,"P",{"data-svelte-h":!0}),t(o)!=="svelte-ke50ct"&&(o.innerHTML=ts),ul=n(l),J(x.$$.fragment,l),dl=n(l),J(O.$$.fragment,l),Yl=n(l),V=e(l,"P",{"data-svelte-h":!0}),t(V)!=="svelte-1qtg42h"&&(V.textContent=cs),Dl=n(l),J(k.$$.fragment,l),Rl=n(l),F=e(l,"P",{"data-svelte-h":!0}),t(F)!=="svelte-1nao7bm"&&(F.innerHTML=Os),ol=n(l),J(z.$$.fragment,l),xl=n(l),J(Q.$$.fragment,l),Vl=n(l),J(Z.$$.fragment,l),kl=n(l),J(B.$$.fragment,l),Fl=n(l),J(W.$$.fragment,l),zl=n(l),J(X.$$.fragment,l),Ql=n(l),J(E.$$.fragment,l),Zl=n(l),J(G.$$.fragment,l),Bl=n(l),J(_.$$.fragment,l),Wl=n(l),J(f.$$.fragment,l),Xl=n(l),J(S.$$.fragment,l),El=n(l),v=e(l,"P",{"data-svelte-h":!0}),t(v)!=="svelte-18cskto"&&(v.textContent=rs),Gl=n(l),J($.$$.fragment,l),_l=n(l),J(H.$$.fragment,l),fl=n(l),q=e(l,"P",{"data-svelte-h":!0}),t(q)!=="svelte-p8mtac"&&(q.textContent=gs),Sl=n(l),J(L.$$.fragment,l),vl=n(l),J(K.$$.fragment,l),$l=n(l),P=e(l,"P",{"data-svelte-h":!0}),t(P)!=="svelte-1d2j42g"&&(P.textContent=As),Hl=n(l),J(ll.$$.fragment,l),ql=n(l),J(sl.$$.fragment,l),Ll=n(l),Ml=e(l,"P",{"data-svelte-h":!0}),t(Ml)!=="svelte-1r9h9t7"&&(Ml.textContent=hs),Kl=n(l),J(Tl.$$.fragment,l),Pl=n(l),al=e(l,"P",{"data-svelte-h":!0}),t(al)!=="svelte-1eprbbz"&&(al.textContent=ms),ls=n(l),J(nl.$$.fragment,l),ss=n(l),J(Ul.$$.fragment,l),Ms=n(l),Jl=e(l,"P",{"data-svelte-h":!0}),t(Jl)!=="svelte-1vsfg9a"&&(Jl.textContent=bs),Ts=n(l),J(yl.$$.fragment,l),as=n(l),jl=e(l,"P",{"data-svelte-h":!0}),t(jl)!=="svelte-3wos3z"&&(jl.textContent=Ns),ns=n(l),J(pl.$$.fragment,l),Us=n(l),J(Il.$$.fragment,l),Js=n(l),wl=e(l,"P",{}),ds(wl).forEach(M),this.h()},h(){Ys(C,"name","hf:doc:metadata"),Ys(C,"content",Xs)},m(l,s){Fs(document.head,C),T(l,r,s),T(l,c,s),T(l,il,s),y(g,l,s),T(l,Cl,s),y(A,l,s),T(l,tl,s),T(l,h,s),T(l,cl,s),T(l,m,s),T(l,Ol,s),y(b,l,s),T(l,rl,s),T(l,N,s),T(l,gl,s),y(u,l,s),T(l,Al,s),T(l,d,s),T(l,hl,s),T(l,Y,s),T(l,ml,s),T(l,D,s),T(l,bl,s),y(R,l,s),T(l,Nl,s),T(l,o,s),T(l,ul,s),y(x,l,s),T(l,dl,s),y(O,l,s),T(l,Yl,s),T(l,V,s),T(l,Dl,s),y(k,l,s),T(l,Rl,s),T(l,F,s),T(l,ol,s),y(z,l,s),T(l,xl,s),y(Q,l,s),T(l,Vl,s),y(Z,l,s),T(l,kl,s),y(B,l,s),T(l,Fl,s),y(W,l,s),T(l,zl,s),y(X,l,s),T(l,Ql,s),y(E,l,s),T(l,Zl,s),y(G,l,s),T(l,Bl,s),y(_,l,s),T(l,Wl,s),y(f,l,s),T(l,Xl,s),y(S,l,s),T(l,El,s),T(l,v,s),T(l,Gl,s),y($,l,s),T(l,_l,s),y(H,l,s),T(l,fl,s),T(l,q,s),T(l,Sl,s),y(L,l,s),T(l,vl,s),y(K,l,s),T(l,$l,s),T(l,P,s),T(l,Hl,s),y(ll,l,s),T(l,ql,s),y(sl,l,s),T(l,Ll,s),T(l,Ml,s),T(l,Kl,s),y(Tl,l,s),T(l,Pl,s),T(l,al,s),T(l,ls,s),y(nl,l,s),T(l,ss,s),y(Ul,l,s),T(l,Ms,s),T(l,Jl,s),T(l,Ts,s),y(yl,l,s),T(l,as,s),T(l,jl,s),T(l,ns,s),y(pl,l,s),T(l,Us,s),y(Il,l,s),T(l,Js,s),T(l,wl,s),ys=!0},p(l,[s]){const us={};s&2&&(us.$$scope={dirty:s,ctx:l}),O.$set(us)},i(l){ys||(j(g.$$.fragment,l),j(A.$$.fragment,l),j(b.$$.fragment,l),j(u.$$.fragment,l),j(R.$$.fragment,l),j(x.$$.fragment,l),j(O.$$.fragment,l),j(k.$$.fragment,l),j(z.$$.fragment,l),j(Q.$$.fragment,l),j(Z.$$.fragment,l),j(B.$$.fragment,l),j(W.$$.fragment,l),j(X.$$.fragment,l),j(E.$$.fragment,l),j(G.$$.fragment,l),j(_.$$.fragment,l),j(f.$$.fragment,l),j(S.$$.fragment,l),j($.$$.fragment,l),j(H.$$.fragment,l),j(L.$$.fragment,l),j(K.$$.fragment,l),j(ll.$$.fragment,l),j(sl.$$.fragment,l),j(Tl.$$.fragment,l),j(nl.$$.fragment,l),j(Ul.$$.fragment,l),j(yl.$$.fragment,l),j(pl.$$.fragment,l),j(Il.$$.fragment,l),ys=!0)},o(l){p(g.$$.fragment,l),p(A.$$.fragment,l),p(b.$$.fragment,l),p(u.$$.fragment,l),p(R.$$.fragment,l),p(x.$$.fragment,l),p(O.$$.fragment,l),p(k.$$.fragment,l),p(z.$$.fragment,l),p(Q.$$.fragment,l),p(Z.$$.fragment,l),p(B.$$.fragment,l),p(W.$$.fragment,l),p(X.$$.fragment,l),p(E.$$.fragment,l),p(G.$$.fragment,l),p(_.$$.fragment,l),p(f.$$.fragment,l),p(S.$$.fragment,l),p($.$$.fragment,l),p(H.$$.fragment,l),p(L.$$.fragment,l),p(K.$$.fragment,l),p(ll.$$.fragment,l),p(sl.$$.fragment,l),p(Tl.$$.fragment,l),p(nl.$$.fragment,l),p(Ul.$$.fragment,l),p(yl.$$.fragment,l),p(pl.$$.fragment,l),p(Il.$$.fragment,l),ys=!1},d(l){l&&(M(r),M(c),M(il),M(Cl),M(tl),M(h),M(cl),M(m),M(Ol),M(rl),M(N),M(gl),M(Al),M(d),M(hl),M(Y),M(ml),M(D),M(bl),M(Nl),M(o),M(ul),M(dl),M(Yl),M(V),M(Dl),M(Rl),M(F),M(ol),M(xl),M(Vl),M(kl),M(Fl),M(zl),M(Ql),M(Zl),M(Bl),M(Wl),M(Xl),M(El),M(v),M(Gl),M(_l),M(fl),M(q),M(Sl),M(vl),M($l),M(P),M(Hl),M(ql),M(Ll),M(Ml),M(Kl),M(Pl),M(al),M(ls),M(ss),M(Ms),M(Jl),M(Ts),M(as),M(jl),M(ns),M(Us),M(Js),M(wl)),M(C),I(g,l),I(A,l),I(b,l),I(u,l),I(R,l),I(x,l),I(O,l),I(k,l),I(z,l),I(Q,l),I(Z,l),I(B,l),I(W,l),I(X,l),I(E,l),I(G,l),I(_,l),I(f,l),I(S,l),I($,l),I(H,l),I(L,l),I(K,l),I(ll,l),I(sl,l),I(Tl,l),I(nl,l),I(Ul,l),I(yl,l),I(pl,l),I(Il,l)}}}const Xs='{"title":"Hyperparameter Optimization","local":"hyperparameter-optimization","sections":[{"title":"Requirements","local":"requirements","sections":[],"depth":2},{"title":"Baseline","local":"baseline","sections":[],"depth":2},{"title":"End-to-end","local":"end-to-end","sections":[],"depth":2}],"depth":1}';function Es(el){return Rs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $s extends xs{constructor(C){super(),Vs(this,C,Es,Ws,Ds,{})}}export{$s as component};
