Buckets:

rtrm's picture
download
raw
46.8 kB
import{s as Ki,o as es,n as Sn}from"../chunks/scheduler.37c15a92.js";import{S as ts,i as ns,g as a,s,r as u,A as is,h as r,f as n,c as l,j as Di,u as m,x as o,k as Oi,y as ss,a as i,v as h,d as g,t as d,w as f}from"../chunks/index.7cb9c9b8.js";import{T as Fn}from"../chunks/Tip.d10b3fc9.js";import{C as Yn}from"../chunks/CodeBlock.abae2786.js";import{C as ls}from"../chunks/CourseFloatingBanner.df82c153.js";import{Q as rt}from"../chunks/Question.7e41e492.js";import{H as M,E as as}from"../chunks/getInferenceSnippets.f9350a3f.js";function rs(C){let p,$="💡 <strong>Why Accuracy Curves Are “Steppy”</strong>: Unlike loss, which is continuous, accuracy is calculated by comparing discrete predictions to true labels. Small improvements in model confidence might not change the final prediction, causing accuracy to remain flat until a threshold is crossed.";return{c(){p=a("p"),p.innerHTML=$},l(w){p=r(w,"P",{"data-svelte-h":!0}),o(p)!=="svelte-18uqxu2"&&(p.innerHTML=$)},m(w,y){i(w,p,y)},p:Sn,d(w){w&&n(p)}}}function os(C){let p,$="<strong>Characteristics of healthy curves:</strong>",w,y,b="<li><strong>Smooth decline in loss</strong>: Both training and validation loss decrease steadily</li> <li><strong>Close training/validation performance</strong>: Small gap between training and validation metrics</li> <li><strong>Convergence</strong>: Curves level off, indicating the model has learned the patterns</li>";return{c(){p=a("p"),p.innerHTML=$,w=s(),y=a("ul"),y.innerHTML=b},l(T){p=r(T,"P",{"data-svelte-h":!0}),o(p)!=="svelte-q6j789"&&(p.innerHTML=$),w=l(T),y=r(T,"UL",{"data-svelte-h":!0}),o(y)!=="svelte-vcjo68"&&(y.innerHTML=b)},m(T,v){i(T,p,v),i(T,w,v),i(T,y,v)},p:Sn,d(T){T&&(n(p),n(w),n(y))}}}function ps(C){let p,$="🔍 <strong>W&amp;B Dashboard Features</strong>: Weights &amp; Biases automatically creates beautiful, interactive plots of your learning curves. You can:",w,y,b="<li>Compare multiple runs side by side</li> <li>Add custom metrics and visualizations</li> <li>Set up alerts for anomalous behavior</li> <li>Share results with your team</li>",T,v,x='Learn more in the <a href="https://docs.wandb.ai/" rel="nofollow">Weights &amp; Biases documentation</a>.';return{c(){p=a("p"),p.innerHTML=$,w=s(),y=a("ul"),y.innerHTML=b,T=s(),v=a("p"),v.innerHTML=x},l(c){p=r(c,"P",{"data-svelte-h":!0}),o(p)!=="svelte-sx55dj"&&(p.innerHTML=$),w=l(c),y=r(c,"UL",{"data-svelte-h":!0}),o(y)!=="svelte-1k0ojjk"&&(y.innerHTML=b),T=l(c),v=r(c,"P",{"data-svelte-h":!0}),o(v)!=="svelte-1cr9t1l"&&(v.innerHTML=x)},m(c,J){i(c,p,J),i(c,w,J),i(c,y,J),i(c,T,J),i(c,v,J)},p:Sn,d(c){c&&(n(p),n(w),n(y),n(T),n(v))}}}function cs(C){let p,$="💡 <strong>Key Takeaways:</strong>",w,y,b="<li>Learning curves are essential tools for understanding model training progress</li> <li>Monitor both loss and accuracy curves, but remember they have different characteristics</li> <li>Overfitting shows as diverging training/validation performance</li> <li>Underfitting shows as poor performance on both training and validation data</li> <li>Tools like Weights &amp; Biases make it easy to track and analyze learning curves</li> <li>Early stopping and proper regularization can address most common training issues</li>",T,v,x="🔬 <strong>Next Steps</strong>: Practice analyzing learning curves on your own fine-tuning experiments. Try different hyperparameters and observe how they affect the curve shapes. This hands-on experience is the best way to develop intuition for reading training progress.";return{c(){p=a("p"),p.innerHTML=$,w=s(),y=a("ul"),y.innerHTML=b,T=s(),v=a("p"),v.innerHTML=x},l(c){p=r(c,"P",{"data-svelte-h":!0}),o(p)!=="svelte-l314m0"&&(p.innerHTML=$),w=l(c),y=r(c,"UL",{"data-svelte-h":!0}),o(y)!=="svelte-yy8x0e"&&(y.innerHTML=b),T=l(c),v=r(c,"P",{"data-svelte-h":!0}),o(v)!=="svelte-1qylnyf"&&(v.innerHTML=x)},m(c,J){i(c,p,J),i(c,w,J),i(c,y,J),i(c,T,J),i(c,v,J)},p:Sn,d(c){c&&(n(p),n(w),n(y),n(T),n(v))}}}function us(C){let p,$,w,y,b,T,v,x,c,J="Now that you’ve learned how to implement fine-tuning using both the <code>Trainer</code> API and custom training loops, it’s crucial to understand how to interpret the results. Learning curves are invaluable tools that help you evaluate your model’s performance during training and identify potential issues before they reduce performance.",ot,H,Qn="In this section, we’ll explore how to read and interpret accuracy and loss curves, understand what different curve shapes tell us about our model’s behavior, and learn how to address common training issues.",pt,L,ct,W,Pn="Learning curves are visual representations of your model’s performance metrics over time during training. The two most important curves to monitor are:",ut,k,Nn="<li><strong>Loss curves</strong>: Show how the model’s error (loss) changes over training steps or epochs</li> <li><strong>Accuracy curves</strong>: Show the percentage of correct predictions over training steps or epochs</li>",mt,z,qn='These curves help us understand whether our model is learning effectively and can guide us in making adjustments to improve performance. In Transformers, these metrics are individually computed for each batch and then logged to the disk. We can then use libraries like <a href="https://wandb.ai/" rel="nofollow">Weights &amp; Biases</a> to visualize these curves and track our model’s performance over time.',ht,B,gt,Z,Dn="The loss curve shows how the model’s error decreases over time. In a typical successful training run, you’ll see a curve similar to the one below:",dt,R,On='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter3/1.png" alt="Loss Curve"/>',ft,X,Kn="<li><strong>High initial loss</strong>: The model starts without optimization, so predictions are initially poor</li> <li><strong>Decreasing loss</strong>: As training progresses, the loss should generally decrease</li> <li><strong>Convergence</strong>: Eventually, the loss stabilizes at a low value, indicating that the model has learned the patterns in the data</li>",yt,E,ei="As in previous chapters, we can use the <code>Trainer</code> API to track these metrics and visualize them in a dashboard. Below is an example of how to do this with Weights &amp; Biases.",vt,A,wt,G,Tt,V,ti="The accuracy curve shows the percentage of correct predictions over time. Unlike loss curves, accuracy curves should generally increase as the model learns and can typically include more steps than the loss curve.",Mt,F,ni='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter3/2.png" alt="Accuracy Curve"/>',$t,Y,ii="<li><strong>Start low</strong>: Initial accuracy should be low, as the model has not yet learned the patterns in the data</li> <li><strong>Increase with training</strong>: Accuracy should generally improve as the model learns if it is able to learn the patterns in the data</li> <li><strong>May show plateaus</strong>: Accuracy often increases in discrete jumps rather than smoothly, as the model makes predictions that are close to the true labels</li>",bt,U,Jt,S,Ct,Q,si="Convergence occurs when the model’s performance stabilizes and the loss and accuracy curves level off. This is a sign that the model has learned the patterns in the data and is ready to be used. In simple terms, we are aiming for the model to converge to a stable performance every time we train it.",xt,P,li='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter3/4.png" alt="Convergence"/>',Ut,N,ai="Once models have converged, we can use them to make predictions on new data and refer to evaluation metrics to understand how well the model is performing.",_t,q,jt,D,ri="Different curve shapes reveal different aspects of your model’s training. Let’s examine the most common patterns and what they mean.",It,O,Ht,K,oi="A well-behaved training run typically shows curve shapes similar to the one below:",Lt,ee,pi='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter3/5.png" alt="Healthy Loss Curve"/>',Wt,te,ci="Let’s look at the illustration above. It displays both the loss curve (on the left) and the corresponding accuracy curve (on the right). These curves have distinct characteristics.",kt,ne,ui="The loss curve shows the value of the model’s loss over time. Initially, the loss is high and then it gradually decreases, indicating that the model is improving. A decrease in the loss value suggests that the model is making better predictions, as the loss represents the error between the predicted output and the true output.",zt,ie,mi="Now let’s shift our focus to the accuracy curve. It represents the model’s accuracy over time. The accuracy curve begins at a low value and increases as training progresses. Accuracy measures the proportion of correctly classified instances. So, as the accuracy curve rises, it signifies that the model is making more correct predictions.",Bt,se,hi="One notable difference between the curves is the smoothness and the presence of “plateaus” on the accuracy curve. While the loss decreases smoothly, the plateaus on the accuracy curve indicate discrete jumps in accuracy instead of a continuous increase. This behavior is attributed to how accuracy is measured. The loss can improve if the model’s output gets closer to the target, even if the final prediction is still incorrect. Accuracy, however, only improves when the prediction crosses the threshold to be correct.",Zt,le,gi="For example, in a binary classifier distinguishing cats (0) from dogs (1), if the model predicts 0.3 for an image of a dog (true value 1), this is rounded to 0 and is an incorrect classification. If in the next step it predicts 0.4, it’s still incorrect. The loss will have decreased because 0.4 is closer to 1 than 0.3, but the accuracy remains unchanged, creating a plateau. The accuracy will only jump up when the model predicts a value greater than 0.5 that gets rounded to 1.",Rt,_,Xt,ae,Et,re,di="Let’s work through some practical examples of learning curves. First, we will highlight some approaches to monitor the learning curves during training. Below, we will break down the different patterns that can be observed in the learning curves.",At,oe,Gt,pe,fi="During the training process (after you’ve hit <code>trainer.train()</code>), you can monitor these key indicators:",Vt,ce,yi="<li><strong>Loss convergence</strong>: Is the loss still decreasing or has it plateaued?</li> <li><strong>Overfitting signs</strong>: Is validation loss starting to increase while training loss decreases?</li> <li><strong>Learning rate</strong>: Are the curves too erratic (LR too high) or too flat (LR too low)?</li> <li><strong>Stability</strong>: Are there sudden spikes or drops that indicate problems?</li>",Ft,ue,Yt,me,vi="After the training process is complete, you can analyze the complete curves to understand the model’s performance.",St,he,wi="<li><strong>Final performance</strong>: Did the model reach acceptable performance levels?</li> <li><strong>Efficiency</strong>: Could the same performance be achieved with fewer epochs?</li> <li><strong>Generalization</strong>: How close are training and validation performance?</li> <li><strong>Trends</strong>: Would additional training likely improve performance?</li>",Qt,j,Pt,ge,Nt,de,Ti="Overfitting occurs when the model learns too much from the training data and is unable to generalize to different data (represented by the validation set).",qt,fe,Mi='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter3/10.png" alt="Overfitting"/>',Dt,ye,$i="<strong>Symptoms:</strong>",Ot,ve,bi="<li>Training loss continues to decrease while validation loss increases or plateaus</li> <li>Large gap between training and validation accuracy</li> <li>Training accuracy much higher than validation accuracy</li>",Kt,we,Ji="<strong>Solutions for overfitting:</strong>",en,Te,Ci="<li><strong>Regularization</strong>: Add dropout, weight decay, or other regularization techniques</li> <li><strong>Early stopping</strong>: Stop training when validation performance stops improving</li> <li><strong>Data augmentation</strong>: Increase training data diversity</li> <li><strong>Reduce model complexity</strong>: Use a smaller model or fewer parameters</li>",tn,Me,xi="In the sample below, we use early stopping to prevent overfitting. We set the <code>early_stopping_patience</code> to 3, which means that if the validation loss does not improve for 3 consecutive epochs, the training will be stopped.",nn,$e,sn,be,ln,Je,Ui="Underfitting occurs when the model is too simple to capture the underlying patterns in the data. This can happen for several reasons:",an,Ce,_i="<li>The model is too small or lacks capacity to learn the patterns</li> <li>The learning rate is too low, causing slow learning</li> <li>The dataset is too small or not representative of the problem</li> <li>The model is not properly regularized</li>",rn,xe,ji='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter3/7.png" alt="Underfitting"/>',on,Ue,Ii="<strong>Symptoms:</strong>",pn,_e,Hi="<li>Both training and validation loss remain high</li> <li>Model performance plateaus early in training</li> <li>Training accuracy is lower than expected</li>",cn,je,Li="<strong>Solutions for underfitting:</strong>",un,Ie,Wi="<li><strong>Increase model capacity</strong>: Use a larger model or more parameters</li> <li><strong>Train longer</strong>: Increase the number of epochs</li> <li><strong>Adjust learning rate</strong>: Try different learning rates</li> <li><strong>Check data quality</strong>: Ensure your data is properly preprocessed</li>",mn,He,ki="In the sample below, we train for more epochs to see if the model can learn the patterns in the data.",hn,Le,gn,We,dn,ke,zi="Erratic learning curves occur when the model is not learning effectively. This can happen for several reasons:",fn,ze,Bi="<li>The learning rate is too high, causing the model to overshoot the optimal parameters</li> <li>The batch size is too small, causing the model to learn slowly</li> <li>The model is not properly regularized, causing it to overfit to the training data</li> <li>The dataset is not properly preprocessed, causing the model to learn from noise</li>",yn,Be,Zi='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter3/3.png" alt="Erratic Learning Curves"/>',vn,Ze,Ri="<strong>Symptoms:</strong>",wn,Re,Xi="<li>Frequent fluctuations in loss or accuracy</li> <li>Curves show high variance or instability</li> <li>Performance oscillates without clear trend</li>",Tn,Xe,Ei="Both training and validation curves show erratic behavior.",Mn,Ee,Ai='<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter3/9.png" alt="Erratic Learning Curves"/>',$n,Ae,Gi="<strong>Solutions for erratic curves:</strong>",bn,Ge,Vi="<li><strong>Lower learning rate</strong>: Reduce step size for more stable training</li> <li><strong>Increase batch size</strong>: Larger batches provide more stable gradients</li> <li><strong>Gradient clipping</strong>: Prevent exploding gradients</li> <li><strong>Better data preprocessing</strong>: Ensure consistent data quality</li>",Jn,Ve,Fi="In the sample below, we lower the learning rate and increase the batch size.",Cn,Fe,xn,Ye,Un,Se,Yi="Understanding learning curves is crucial for becoming an effective machine learning practitioner. These visual tools provide immediate feedback about your model’s training progress and help you make informed decisions about when to stop training, adjust hyperparameters, or try different approaches. With practice, you’ll develop an intuitive understanding of what healthy learning curves look like and how to address issues when they arise.",_n,I,jn,Qe,In,Pe,Si="Test your understanding of learning curves and training analysis:",Hn,Ne,Ln,qe,Wn,De,kn,Oe,zn,Ke,Bn,et,Zn,tt,Rn,nt,Xn,it,En,st,An,lt,Gn,at,Vn;return b=new M({props:{title:"Understanding Learning Curves",local:"understanding-learning-curves",headingTag:"h1"}}),v=new ls({props:{chapter:3,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter3/section7.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter3/section7.ipynb"}]}}),L=new M({props:{title:"What are Learning Curves?",local:"what-are-learning-curves",headingTag:"h2"}}),B=new M({props:{title:"Loss Curves",local:"loss-curves",headingTag:"h3"}}),A=new Yn({props:{code:"JTIzJTIwRXhhbXBsZSUyMG9mJTIwdHJhY2tpbmclMjBsb3NzJTIwZHVyaW5nJTIwdHJhaW5pbmclMjB3aXRoJTIwdGhlJTIwVHJhaW5lciUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBUcmFpbmVyJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMEFpbXBvcnQlMjB3YW5kYiUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjBXZWlnaHRzJTIwJTI2JTIwQmlhc2VzJTIwZm9yJTIwZXhwZXJpbWVudCUyMHRyYWNraW5nJTBBd2FuZGIuaW5pdChwcm9qZWN0JTNEJTIydHJhbnNmb3JtZXItZmluZS10dW5pbmclMjIlMkMlMjBuYW1lJTNEJTIyYmVydC1tcnBjLWFuYWx5c2lzJTIyKSUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBUcmFpbmluZ0FyZ3VtZW50cyglMEElMjAlMjAlMjAlMjBvdXRwdXRfZGlyJTNEJTIyLiUyRnJlc3VsdHMlMjIlMkMlMEElMjAlMjAlMjAlMjBldmFsX3N0cmF0ZWd5JTNEJTIyc3RlcHMlMjIlMkMlMEElMjAlMjAlMjAlMjBldmFsX3N0ZXBzJTNENTAlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0ZXBzJTNEMTAwJTJDJTBBJTIwJTIwJTIwJTIwbG9nZ2luZ19zdGVwcyUzRDEwJTJDJTIwJTIwJTIzJTIwTG9nJTIwbWV0cmljcyUyMGV2ZXJ5JTIwMTAlMjBzdGVwcyUwQSUyMCUyMCUyMCUyMG51bV90cmFpbl9lcG9jaHMlM0QzJTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwcmVwb3J0X3RvJTNEJTIyd2FuZGIlMjIlMkMlMjAlMjAlMjMlMjBTZW5kJTIwbG9ncyUyMHRvJTIwV2VpZ2h0cyUyMCUyNiUyMEJpYXNlcyUwQSklMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEdG9rZW5pemVkX2RhdGFzZXRzJTVCJTIydHJhaW4lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0R0b2tlbml6ZWRfZGF0YXNldHMlNUIlMjJ2YWxpZGF0aW9uJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZGF0YV9jb2xsYXRvciUzRGRhdGFfY29sbGF0b3IlMkMlMEElMjAlMjAlMjAlMjBwcm9jZXNzaW5nX2NsYXNzJTNEdG9rZW5pemVyJTJDJTBBJTIwJTIwJTIwJTIwY29tcHV0ZV9tZXRyaWNzJTNEY29tcHV0ZV9tZXRyaWNzJTJDJTBBKSUwQSUwQSUyMyUyMFRyYWluJTIwYW5kJTIwYXV0b21hdGljYWxseSUyMGxvZyUyMG1ldHJpY3MlMEF0cmFpbmVyLnRyYWluKCk=",highlighted:`<span class="hljs-comment"># Example of tracking loss during training with the Trainer</span>
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Trainer, TrainingArguments
<span class="hljs-keyword">import</span> wandb
<span class="hljs-comment"># Initialize Weights &amp; Biases for experiment tracking</span>
wandb.init(project=<span class="hljs-string">&quot;transformer-fine-tuning&quot;</span>, name=<span class="hljs-string">&quot;bert-mrpc-analysis&quot;</span>)
training_args = TrainingArguments(
output_dir=<span class="hljs-string">&quot;./results&quot;</span>,
eval_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
eval_steps=<span class="hljs-number">50</span>,
save_steps=<span class="hljs-number">100</span>,
logging_steps=<span class="hljs-number">10</span>, <span class="hljs-comment"># Log metrics every 10 steps</span>
num_train_epochs=<span class="hljs-number">3</span>,
per_device_train_batch_size=<span class="hljs-number">16</span>,
per_device_eval_batch_size=<span class="hljs-number">16</span>,
report_to=<span class="hljs-string">&quot;wandb&quot;</span>, <span class="hljs-comment"># Send logs to Weights &amp; Biases</span>
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>],
eval_dataset=tokenized_datasets[<span class="hljs-string">&quot;validation&quot;</span>],
data_collator=data_collator,
processing_class=tokenizer,
compute_metrics=compute_metrics,
)
<span class="hljs-comment"># Train and automatically log metrics</span>
trainer.train()`,wrap:!1}}),G=new M({props:{title:"Accuracy Curves",local:"accuracy-curves",headingTag:"h3"}}),U=new Fn({props:{$$slots:{default:[rs]},$$scope:{ctx:C}}}),S=new M({props:{title:"Convergence",local:"convergence",headingTag:"h3"}}),q=new M({props:{title:"Interpreting Learning Curve Patterns",local:"interpreting-learning-curve-patterns",headingTag:"h2"}}),O=new M({props:{title:"Healthy Learning Curves",local:"healthy-learning-curves",headingTag:"h3"}}),_=new Fn({props:{$$slots:{default:[os]},$$scope:{ctx:C}}}),ae=new M({props:{title:"Practical Examples",local:"practical-examples",headingTag:"h3"}}),oe=new M({props:{title:"During Training",local:"during-training",headingTag:"h4"}}),ue=new M({props:{title:"After Training",local:"after-training",headingTag:"h4"}}),j=new Fn({props:{$$slots:{default:[ps]},$$scope:{ctx:C}}}),ge=new M({props:{title:"Overfitting",local:"overfitting",headingTag:"h4"}}),$e=new Yn({props:{code:"JTIzJTIwRXhhbXBsZSUyMG9mJTIwZGV0ZWN0aW5nJTIwb3ZlcmZpdHRpbmclMjB3aXRoJTIwZWFybHklMjBzdG9wcGluZyUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBFYXJseVN0b3BwaW5nQ2FsbGJhY2slMEElMEF0cmFpbmluZ19hcmdzJTIwJTNEJTIwVHJhaW5pbmdBcmd1bWVudHMoJTBBJTIwJTIwJTIwJTIwb3V0cHV0X2RpciUzRCUyMi4lMkZyZXN1bHRzJTIyJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdHJhdGVneSUzRCUyMnN0ZXBzJTIyJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdGVwcyUzRDEwMCUyQyUwQSUyMCUyMCUyMCUyMHNhdmVfc3RyYXRlZ3klM0QlMjJzdGVwcyUyMiUyQyUwQSUyMCUyMCUyMCUyMHNhdmVfc3RlcHMlM0QxMDAlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMG1ldHJpY19mb3JfYmVzdF9tb2RlbCUzRCUyMmV2YWxfbG9zcyUyMiUyQyUwQSUyMCUyMCUyMCUyMGdyZWF0ZXJfaXNfYmV0dGVyJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNEMTAlMkMlMjAlMjAlMjMlMjBTZXQlMjBoaWdoJTJDJTIwYnV0JTIwd2UnbGwlMjBzdG9wJTIwZWFybHklMEEpJTBBJTBBJTIzJTIwQWRkJTIwZWFybHklMjBzdG9wcGluZyUyMHRvJTIwcHJldmVudCUyMG92ZXJmaXR0aW5nJTBBdHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRHRva2VuaXplZF9kYXRhc2V0cyU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEdG9rZW5pemVkX2RhdGFzZXRzJTVCJTIydmFsaWRhdGlvbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBJTIwJTIwJTIwJTIwcHJvY2Vzc2luZ19jbGFzcyUzRHRva2VuaXplciUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfbWV0cmljcyUzRGNvbXB1dGVfbWV0cmljcyUyQyUwQSUyMCUyMCUyMCUyMGNhbGxiYWNrcyUzRCU1QkVhcmx5U3RvcHBpbmdDYWxsYmFjayhlYXJseV9zdG9wcGluZ19wYXRpZW5jZSUzRDMpJTVEJTJDJTBBKQ==",highlighted:`<span class="hljs-comment"># Example of detecting overfitting with early stopping</span>
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> EarlyStoppingCallback
training_args = TrainingArguments(
output_dir=<span class="hljs-string">&quot;./results&quot;</span>,
eval_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
eval_steps=<span class="hljs-number">100</span>,
save_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
save_steps=<span class="hljs-number">100</span>,
load_best_model_at_end=<span class="hljs-literal">True</span>,
metric_for_best_model=<span class="hljs-string">&quot;eval_loss&quot;</span>,
greater_is_better=<span class="hljs-literal">False</span>,
num_train_epochs=<span class="hljs-number">10</span>, <span class="hljs-comment"># Set high, but we&#x27;ll stop early</span>
)
<span class="hljs-comment"># Add early stopping to prevent overfitting</span>
trainer = Trainer(
model=model,
args=training_args,
train_dataset=tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>],
eval_dataset=tokenized_datasets[<span class="hljs-string">&quot;validation&quot;</span>],
data_collator=data_collator,
processing_class=tokenizer,
compute_metrics=compute_metrics,
callbacks=[EarlyStoppingCallback(early_stopping_patience=<span class="hljs-number">3</span>)],
)`,wrap:!1}}),be=new M({props:{title:"2. Underfitting",local:"underfitting",headingTag:"h4"}}),Le=new Yn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBdHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjIuJTJGcmVzdWx0cyUyMiUyQyUwQSUyMCUyMCUyMCUyMC1udW1fdHJhaW5fZXBvY2hzJTNENSUyQyUwQSUyMCUyMCUyMCUyMCUyQm51bV90cmFpbl9lcG9jaHMlM0QxMCUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments
training_args = TrainingArguments(
output_dir=<span class="hljs-string">&quot;./results&quot;</span>,
-num_train_epochs=<span class="hljs-number">5</span>,
+num_train_epochs=<span class="hljs-number">10</span>,
)`,wrap:!1}}),We=new M({props:{title:"3. Erratic Learning Curves",local:"erratic-learning-curves",headingTag:"h4"}}),Fe=new Yn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBdHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjIuJTJGcmVzdWx0cyUyMiUyQyUwQSUyMCUyMCUyMCUyMC1sZWFybmluZ19yYXRlJTNEMWUtNSUyQyUwQSUyMCUyMCUyMCUyMCUyQmxlYXJuaW5nX3JhdGUlM0QxZS00JTJDJTBBJTIwJTIwJTIwJTIwLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwJTJCcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEMzIlMkMlMEEp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments
training_args = TrainingArguments(
output_dir=<span class="hljs-string">&quot;./results&quot;</span>,
-learning_rate=<span class="hljs-number">1e-5</span>,
+learning_rate=<span class="hljs-number">1e-4</span>,
-per_device_train_batch_size=<span class="hljs-number">16</span>,
+per_device_train_batch_size=<span class="hljs-number">32</span>,
)`,wrap:!1}}),Ye=new M({props:{title:"Key Takeaways",local:"key-takeaways",headingTag:"h2"}}),I=new Fn({props:{$$slots:{default:[cs]},$$scope:{ctx:C}}}),Qe=new M({props:{title:"Section Quiz",local:"section-quiz",headingTag:"h2"}}),Ne=new M({props:{title:"1. What does it typically mean when training loss decreases but validation loss starts increasing?",local:"1-what-does-it-typically-mean-when-training-loss-decreases-but-validation-loss-starts-increasing",headingTag:"h3"}}),qe=new rt({props:{choices:[{text:"The model is learning successfully and will continue to improve.",explain:"If validation loss is increasing while training loss decreases, this indicates a problem, not success."},{text:"The model is overfitting to the training data.",explain:"Correct! This is a classic sign of overfitting - the model performs well on training data but poorly on unseen validation data.",correct:!0},{text:"The learning rate is too low.",explain:"A low learning rate would cause slow learning, not the divergence between training and validation performance."},{text:"The dataset is too small.",explain:"While small datasets can contribute to overfitting, this specific pattern is the definition of overfitting regardless of dataset size."}]}}),De=new M({props:{title:"2. Why do accuracy curves often show a “steppy” or plateau-like pattern rather than smooth increases?",local:"2-why-do-accuracy-curves-often-show-a-steppy-or-plateau-like-pattern-rather-than-smooth-increases",headingTag:"h3"}}),Oe=new rt({props:{choices:[{text:"There's an error in the accuracy calculation.",explain:"The steppy pattern is normal and expected, not an error."},{text:"Accuracy is a discrete metric that only changes when predictions cross decision boundaries.",explain:"Correct! Unlike loss, accuracy depends on discrete prediction decisions, so small improvements in confidence may not change the final accuracy until a threshold is crossed.",correct:!0},{text:"The model is not learning effectively.",explain:"Steppy accuracy curves are normal even when the model is learning well."},{text:"The batch size is too small.",explain:"Batch size affects training stability but doesn't explain the inherently discrete nature of accuracy metrics."}]}}),Ke=new M({props:{title:"3. What is the best approach when you observe erratic, highly fluctuating learning curves?",local:"3-what-is-the-best-approach-when-you-observe-erratic-highly-fluctuating-learning-curves",headingTag:"h3"}}),et=new rt({props:{choices:[{text:"Increase the learning rate to speed up convergence.",explain:"Increasing the learning rate would likely make the fluctuations worse."},{text:"Reduce the learning rate and possibly increase the batch size.",explain:"Correct! Lower learning rates and larger batch sizes typically lead to more stable training.",correct:!0},{text:"Stop training immediately as the model won't improve.",explain:"Erratic curves can often be fixed with hyperparameter adjustments."},{text:"Switch to a completely different model architecture.",explain:"This is premature - erratic curves are usually fixable with hyperparameter tuning."}]}}),tt=new M({props:{title:"4. When should you consider using early stopping?",local:"4-when-should-you-consider-using-early-stopping",headingTag:"h3"}}),nt=new rt({props:{choices:[{text:"Always, as it prevents any form of overfitting.",explain:"Early stopping is useful but not always necessary, especially if other regularization methods are working."},{text:"When validation performance stops improving or starts degrading.",explain:"Correct! Early stopping helps prevent overfitting by stopping training when the model no longer generalizes better.",correct:!0},{text:"Only when training loss is still decreasing rapidly.",explain:"If training loss is decreasing rapidly and validation performance is good, you might want to continue training."},{text:"Never, as it prevents the model from reaching its full potential.",explain:"Early stopping is a valuable technique that often improves final model performance by preventing overfitting."}]}}),it=new M({props:{title:"5. What indicates that your model might be underfitting?",local:"5-what-indicates-that-your-model-might-be-underfitting",headingTag:"h3"}}),st=new rt({props:{choices:[{text:"Training accuracy is much higher than validation accuracy.",explain:"This describes overfitting, not underfitting."},{text:"Both training and validation performance are poor and plateau early.",explain:"Correct! Underfitting occurs when the model lacks capacity to learn the patterns, resulting in poor performance on both training and validation data.",correct:!0},{text:"The learning curves are very smooth with no fluctuations.",explain:"Smooth curves are generally good and don't indicate underfitting."},{text:"Validation loss is decreasing faster than training loss.",explain:"This would actually be a positive sign, not a problem."}]}}),lt=new as({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter3/5.mdx"}}),{c(){p=a("meta"),$=s(),w=a("p"),y=s(),u(b.$$.fragment),T=s(),u(v.$$.fragment),x=s(),c=a("p"),c.innerHTML=J,ot=s(),H=a("p"),H.textContent=Qn,pt=s(),u(L.$$.fragment),ct=s(),W=a("p"),W.textContent=Pn,ut=s(),k=a("ul"),k.innerHTML=Nn,mt=s(),z=a("p"),z.innerHTML=qn,ht=s(),u(B.$$.fragment),gt=s(),Z=a("p"),Z.textContent=Dn,dt=s(),R=a("p"),R.innerHTML=On,ft=s(),X=a("ul"),X.innerHTML=Kn,yt=s(),E=a("p"),E.innerHTML=ei,vt=s(),u(A.$$.fragment),wt=s(),u(G.$$.fragment),Tt=s(),V=a("p"),V.textContent=ti,Mt=s(),F=a("p"),F.innerHTML=ni,$t=s(),Y=a("ul"),Y.innerHTML=ii,bt=s(),u(U.$$.fragment),Jt=s(),u(S.$$.fragment),Ct=s(),Q=a("p"),Q.textContent=si,xt=s(),P=a("p"),P.innerHTML=li,Ut=s(),N=a("p"),N.textContent=ai,_t=s(),u(q.$$.fragment),jt=s(),D=a("p"),D.textContent=ri,It=s(),u(O.$$.fragment),Ht=s(),K=a("p"),K.textContent=oi,Lt=s(),ee=a("p"),ee.innerHTML=pi,Wt=s(),te=a("p"),te.textContent=ci,kt=s(),ne=a("p"),ne.textContent=ui,zt=s(),ie=a("p"),ie.textContent=mi,Bt=s(),se=a("p"),se.textContent=hi,Zt=s(),le=a("p"),le.textContent=gi,Rt=s(),u(_.$$.fragment),Xt=s(),u(ae.$$.fragment),Et=s(),re=a("p"),re.textContent=di,At=s(),u(oe.$$.fragment),Gt=s(),pe=a("p"),pe.innerHTML=fi,Vt=s(),ce=a("ol"),ce.innerHTML=yi,Ft=s(),u(ue.$$.fragment),Yt=s(),me=a("p"),me.textContent=vi,St=s(),he=a("ol"),he.innerHTML=wi,Qt=s(),u(j.$$.fragment),Pt=s(),u(ge.$$.fragment),Nt=s(),de=a("p"),de.textContent=Ti,qt=s(),fe=a("p"),fe.innerHTML=Mi,Dt=s(),ye=a("p"),ye.innerHTML=$i,Ot=s(),ve=a("ul"),ve.innerHTML=bi,Kt=s(),we=a("p"),we.innerHTML=Ji,en=s(),Te=a("ul"),Te.innerHTML=Ci,tn=s(),Me=a("p"),Me.innerHTML=xi,nn=s(),u($e.$$.fragment),sn=s(),u(be.$$.fragment),ln=s(),Je=a("p"),Je.textContent=Ui,an=s(),Ce=a("ul"),Ce.innerHTML=_i,rn=s(),xe=a("p"),xe.innerHTML=ji,on=s(),Ue=a("p"),Ue.innerHTML=Ii,pn=s(),_e=a("ul"),_e.innerHTML=Hi,cn=s(),je=a("p"),je.innerHTML=Li,un=s(),Ie=a("ul"),Ie.innerHTML=Wi,mn=s(),He=a("p"),He.textContent=ki,hn=s(),u(Le.$$.fragment),gn=s(),u(We.$$.fragment),dn=s(),ke=a("p"),ke.textContent=zi,fn=s(),ze=a("ul"),ze.innerHTML=Bi,yn=s(),Be=a("p"),Be.innerHTML=Zi,vn=s(),Ze=a("p"),Ze.innerHTML=Ri,wn=s(),Re=a("ul"),Re.innerHTML=Xi,Tn=s(),Xe=a("p"),Xe.textContent=Ei,Mn=s(),Ee=a("p"),Ee.innerHTML=Ai,$n=s(),Ae=a("p"),Ae.innerHTML=Gi,bn=s(),Ge=a("ul"),Ge.innerHTML=Vi,Jn=s(),Ve=a("p"),Ve.textContent=Fi,Cn=s(),u(Fe.$$.fragment),xn=s(),u(Ye.$$.fragment),Un=s(),Se=a("p"),Se.textContent=Yi,_n=s(),u(I.$$.fragment),jn=s(),u(Qe.$$.fragment),In=s(),Pe=a("p"),Pe.textContent=Si,Hn=s(),u(Ne.$$.fragment),Ln=s(),u(qe.$$.fragment),Wn=s(),u(De.$$.fragment),kn=s(),u(Oe.$$.fragment),zn=s(),u(Ke.$$.fragment),Bn=s(),u(et.$$.fragment),Zn=s(),u(tt.$$.fragment),Rn=s(),u(nt.$$.fragment),Xn=s(),u(it.$$.fragment),En=s(),u(st.$$.fragment),An=s(),u(lt.$$.fragment),Gn=s(),at=a("p"),this.h()},l(e){const t=is("svelte-u9bgzb",document.head);p=r(t,"META",{name:!0,content:!0}),t.forEach(n),$=l(e),w=r(e,"P",{}),Di(w).forEach(n),y=l(e),m(b.$$.fragment,e),T=l(e),m(v.$$.fragment,e),x=l(e),c=r(e,"P",{"data-svelte-h":!0}),o(c)!=="svelte-1ws90op"&&(c.innerHTML=J),ot=l(e),H=r(e,"P",{"data-svelte-h":!0}),o(H)!=="svelte-eliep2"&&(H.textContent=Qn),pt=l(e),m(L.$$.fragment,e),ct=l(e),W=r(e,"P",{"data-svelte-h":!0}),o(W)!=="svelte-za3ea7"&&(W.textContent=Pn),ut=l(e),k=r(e,"UL",{"data-svelte-h":!0}),o(k)!=="svelte-1t4wunj"&&(k.innerHTML=Nn),mt=l(e),z=r(e,"P",{"data-svelte-h":!0}),o(z)!=="svelte-19anp1w"&&(z.innerHTML=qn),ht=l(e),m(B.$$.fragment,e),gt=l(e),Z=r(e,"P",{"data-svelte-h":!0}),o(Z)!=="svelte-g4kfd9"&&(Z.textContent=Dn),dt=l(e),R=r(e,"P",{"data-svelte-h":!0}),o(R)!=="svelte-pvwhaj"&&(R.innerHTML=On),ft=l(e),X=r(e,"UL",{"data-svelte-h":!0}),o(X)!=="svelte-11aptsa"&&(X.innerHTML=Kn),yt=l(e),E=r(e,"P",{"data-svelte-h":!0}),o(E)!=="svelte-1pd4vow"&&(E.innerHTML=ei),vt=l(e),m(A.$$.fragment,e),wt=l(e),m(G.$$.fragment,e),Tt=l(e),V=r(e,"P",{"data-svelte-h":!0}),o(V)!=="svelte-1ot2vxf"&&(V.textContent=ti),Mt=l(e),F=r(e,"P",{"data-svelte-h":!0}),o(F)!=="svelte-1jzjr0y"&&(F.innerHTML=ni),$t=l(e),Y=r(e,"UL",{"data-svelte-h":!0}),o(Y)!=="svelte-ownnm7"&&(Y.innerHTML=ii),bt=l(e),m(U.$$.fragment,e),Jt=l(e),m(S.$$.fragment,e),Ct=l(e),Q=r(e,"P",{"data-svelte-h":!0}),o(Q)!=="svelte-qbg8tf"&&(Q.textContent=si),xt=l(e),P=r(e,"P",{"data-svelte-h":!0}),o(P)!=="svelte-lmle25"&&(P.innerHTML=li),Ut=l(e),N=r(e,"P",{"data-svelte-h":!0}),o(N)!=="svelte-g0y3o4"&&(N.textContent=ai),_t=l(e),m(q.$$.fragment,e),jt=l(e),D=r(e,"P",{"data-svelte-h":!0}),o(D)!=="svelte-9px25k"&&(D.textContent=ri),It=l(e),m(O.$$.fragment,e),Ht=l(e),K=r(e,"P",{"data-svelte-h":!0}),o(K)!=="svelte-l3som6"&&(K.textContent=oi),Lt=l(e),ee=r(e,"P",{"data-svelte-h":!0}),o(ee)!=="svelte-lw8se0"&&(ee.innerHTML=pi),Wt=l(e),te=r(e,"P",{"data-svelte-h":!0}),o(te)!=="svelte-52p4pq"&&(te.textContent=ci),kt=l(e),ne=r(e,"P",{"data-svelte-h":!0}),o(ne)!=="svelte-gklle5"&&(ne.textContent=ui),zt=l(e),ie=r(e,"P",{"data-svelte-h":!0}),o(ie)!=="svelte-3kw9rm"&&(ie.textContent=mi),Bt=l(e),se=r(e,"P",{"data-svelte-h":!0}),o(se)!=="svelte-5msz0y"&&(se.textContent=hi),Zt=l(e),le=r(e,"P",{"data-svelte-h":!0}),o(le)!=="svelte-1v47fvi"&&(le.textContent=gi),Rt=l(e),m(_.$$.fragment,e),Xt=l(e),m(ae.$$.fragment,e),Et=l(e),re=r(e,"P",{"data-svelte-h":!0}),o(re)!=="svelte-q6sc50"&&(re.textContent=di),At=l(e),m(oe.$$.fragment,e),Gt=l(e),pe=r(e,"P",{"data-svelte-h":!0}),o(pe)!=="svelte-1tpl7gk"&&(pe.innerHTML=fi),Vt=l(e),ce=r(e,"OL",{"data-svelte-h":!0}),o(ce)!=="svelte-wb01ww"&&(ce.innerHTML=yi),Ft=l(e),m(ue.$$.fragment,e),Yt=l(e),me=r(e,"P",{"data-svelte-h":!0}),o(me)!=="svelte-hadbhx"&&(me.textContent=vi),St=l(e),he=r(e,"OL",{"data-svelte-h":!0}),o(he)!=="svelte-1oj7bbp"&&(he.innerHTML=wi),Qt=l(e),m(j.$$.fragment,e),Pt=l(e),m(ge.$$.fragment,e),Nt=l(e),de=r(e,"P",{"data-svelte-h":!0}),o(de)!=="svelte-wgqvrb"&&(de.textContent=Ti),qt=l(e),fe=r(e,"P",{"data-svelte-h":!0}),o(fe)!=="svelte-281ynk"&&(fe.innerHTML=Mi),Dt=l(e),ye=r(e,"P",{"data-svelte-h":!0}),o(ye)!=="svelte-1m2kcc3"&&(ye.innerHTML=$i),Ot=l(e),ve=r(e,"UL",{"data-svelte-h":!0}),o(ve)!=="svelte-zqaa0r"&&(ve.innerHTML=bi),Kt=l(e),we=r(e,"P",{"data-svelte-h":!0}),o(we)!=="svelte-lmb51t"&&(we.innerHTML=Ji),en=l(e),Te=r(e,"UL",{"data-svelte-h":!0}),o(Te)!=="svelte-1pxlcl3"&&(Te.innerHTML=Ci),tn=l(e),Me=r(e,"P",{"data-svelte-h":!0}),o(Me)!=="svelte-8x6dgg"&&(Me.innerHTML=xi),nn=l(e),m($e.$$.fragment,e),sn=l(e),m(be.$$.fragment,e),ln=l(e),Je=r(e,"P",{"data-svelte-h":!0}),o(Je)!=="svelte-qnmlsu"&&(Je.textContent=Ui),an=l(e),Ce=r(e,"UL",{"data-svelte-h":!0}),o(Ce)!=="svelte-1ag1u4d"&&(Ce.innerHTML=_i),rn=l(e),xe=r(e,"P",{"data-svelte-h":!0}),o(xe)!=="svelte-clpn9k"&&(xe.innerHTML=ji),on=l(e),Ue=r(e,"P",{"data-svelte-h":!0}),o(Ue)!=="svelte-1m2kcc3"&&(Ue.innerHTML=Ii),pn=l(e),_e=r(e,"UL",{"data-svelte-h":!0}),o(_e)!=="svelte-1sedo32"&&(_e.innerHTML=Hi),cn=l(e),je=r(e,"P",{"data-svelte-h":!0}),o(je)!=="svelte-16mw4zr"&&(je.innerHTML=Li),un=l(e),Ie=r(e,"UL",{"data-svelte-h":!0}),o(Ie)!=="svelte-4laiep"&&(Ie.innerHTML=Wi),mn=l(e),He=r(e,"P",{"data-svelte-h":!0}),o(He)!=="svelte-1d3m5mc"&&(He.textContent=ki),hn=l(e),m(Le.$$.fragment,e),gn=l(e),m(We.$$.fragment,e),dn=l(e),ke=r(e,"P",{"data-svelte-h":!0}),o(ke)!=="svelte-171x3d7"&&(ke.textContent=zi),fn=l(e),ze=r(e,"UL",{"data-svelte-h":!0}),o(ze)!=="svelte-ozmyg2"&&(ze.innerHTML=Bi),yn=l(e),Be=r(e,"P",{"data-svelte-h":!0}),o(Be)!=="svelte-1nvkivp"&&(Be.innerHTML=Zi),vn=l(e),Ze=r(e,"P",{"data-svelte-h":!0}),o(Ze)!=="svelte-1m2kcc3"&&(Ze.innerHTML=Ri),wn=l(e),Re=r(e,"UL",{"data-svelte-h":!0}),o(Re)!=="svelte-3z0f8a"&&(Re.innerHTML=Xi),Tn=l(e),Xe=r(e,"P",{"data-svelte-h":!0}),o(Xe)!=="svelte-1y0awim"&&(Xe.textContent=Ei),Mn=l(e),Ee=r(e,"P",{"data-svelte-h":!0}),o(Ee)!=="svelte-19tpia7"&&(Ee.innerHTML=Ai),$n=l(e),Ae=r(e,"P",{"data-svelte-h":!0}),o(Ae)!=="svelte-huyrsu"&&(Ae.innerHTML=Gi),bn=l(e),Ge=r(e,"UL",{"data-svelte-h":!0}),o(Ge)!=="svelte-1oyey8p"&&(Ge.innerHTML=Vi),Jn=l(e),Ve=r(e,"P",{"data-svelte-h":!0}),o(Ve)!=="svelte-ykj10u"&&(Ve.textContent=Fi),Cn=l(e),m(Fe.$$.fragment,e),xn=l(e),m(Ye.$$.fragment,e),Un=l(e),Se=r(e,"P",{"data-svelte-h":!0}),o(Se)!=="svelte-1cusb5e"&&(Se.textContent=Yi),_n=l(e),m(I.$$.fragment,e),jn=l(e),m(Qe.$$.fragment,e),In=l(e),Pe=r(e,"P",{"data-svelte-h":!0}),o(Pe)!=="svelte-1yn5q85"&&(Pe.textContent=Si),Hn=l(e),m(Ne.$$.fragment,e),Ln=l(e),m(qe.$$.fragment,e),Wn=l(e),m(De.$$.fragment,e),kn=l(e),m(Oe.$$.fragment,e),zn=l(e),m(Ke.$$.fragment,e),Bn=l(e),m(et.$$.fragment,e),Zn=l(e),m(tt.$$.fragment,e),Rn=l(e),m(nt.$$.fragment,e),Xn=l(e),m(it.$$.fragment,e),En=l(e),m(st.$$.fragment,e),An=l(e),m(lt.$$.fragment,e),Gn=l(e),at=r(e,"P",{}),Di(at).forEach(n),this.h()},h(){Oi(p,"name","hf:doc:metadata"),Oi(p,"content",ms)},m(e,t){ss(document.head,p),i(e,$,t),i(e,w,t),i(e,y,t),h(b,e,t),i(e,T,t),h(v,e,t),i(e,x,t),i(e,c,t),i(e,ot,t),i(e,H,t),i(e,pt,t),h(L,e,t),i(e,ct,t),i(e,W,t),i(e,ut,t),i(e,k,t),i(e,mt,t),i(e,z,t),i(e,ht,t),h(B,e,t),i(e,gt,t),i(e,Z,t),i(e,dt,t),i(e,R,t),i(e,ft,t),i(e,X,t),i(e,yt,t),i(e,E,t),i(e,vt,t),h(A,e,t),i(e,wt,t),h(G,e,t),i(e,Tt,t),i(e,V,t),i(e,Mt,t),i(e,F,t),i(e,$t,t),i(e,Y,t),i(e,bt,t),h(U,e,t),i(e,Jt,t),h(S,e,t),i(e,Ct,t),i(e,Q,t),i(e,xt,t),i(e,P,t),i(e,Ut,t),i(e,N,t),i(e,_t,t),h(q,e,t),i(e,jt,t),i(e,D,t),i(e,It,t),h(O,e,t),i(e,Ht,t),i(e,K,t),i(e,Lt,t),i(e,ee,t),i(e,Wt,t),i(e,te,t),i(e,kt,t),i(e,ne,t),i(e,zt,t),i(e,ie,t),i(e,Bt,t),i(e,se,t),i(e,Zt,t),i(e,le,t),i(e,Rt,t),h(_,e,t),i(e,Xt,t),h(ae,e,t),i(e,Et,t),i(e,re,t),i(e,At,t),h(oe,e,t),i(e,Gt,t),i(e,pe,t),i(e,Vt,t),i(e,ce,t),i(e,Ft,t),h(ue,e,t),i(e,Yt,t),i(e,me,t),i(e,St,t),i(e,he,t),i(e,Qt,t),h(j,e,t),i(e,Pt,t),h(ge,e,t),i(e,Nt,t),i(e,de,t),i(e,qt,t),i(e,fe,t),i(e,Dt,t),i(e,ye,t),i(e,Ot,t),i(e,ve,t),i(e,Kt,t),i(e,we,t),i(e,en,t),i(e,Te,t),i(e,tn,t),i(e,Me,t),i(e,nn,t),h($e,e,t),i(e,sn,t),h(be,e,t),i(e,ln,t),i(e,Je,t),i(e,an,t),i(e,Ce,t),i(e,rn,t),i(e,xe,t),i(e,on,t),i(e,Ue,t),i(e,pn,t),i(e,_e,t),i(e,cn,t),i(e,je,t),i(e,un,t),i(e,Ie,t),i(e,mn,t),i(e,He,t),i(e,hn,t),h(Le,e,t),i(e,gn,t),h(We,e,t),i(e,dn,t),i(e,ke,t),i(e,fn,t),i(e,ze,t),i(e,yn,t),i(e,Be,t),i(e,vn,t),i(e,Ze,t),i(e,wn,t),i(e,Re,t),i(e,Tn,t),i(e,Xe,t),i(e,Mn,t),i(e,Ee,t),i(e,$n,t),i(e,Ae,t),i(e,bn,t),i(e,Ge,t),i(e,Jn,t),i(e,Ve,t),i(e,Cn,t),h(Fe,e,t),i(e,xn,t),h(Ye,e,t),i(e,Un,t),i(e,Se,t),i(e,_n,t),h(I,e,t),i(e,jn,t),h(Qe,e,t),i(e,In,t),i(e,Pe,t),i(e,Hn,t),h(Ne,e,t),i(e,Ln,t),h(qe,e,t),i(e,Wn,t),h(De,e,t),i(e,kn,t),h(Oe,e,t),i(e,zn,t),h(Ke,e,t),i(e,Bn,t),h(et,e,t),i(e,Zn,t),h(tt,e,t),i(e,Rn,t),h(nt,e,t),i(e,Xn,t),h(it,e,t),i(e,En,t),h(st,e,t),i(e,An,t),h(lt,e,t),i(e,Gn,t),i(e,at,t),Vn=!0},p(e,[t]){const Qi={};t&2&&(Qi.$$scope={dirty:t,ctx:e}),U.$set(Qi);const Pi={};t&2&&(Pi.$$scope={dirty:t,ctx:e}),_.$set(Pi);const Ni={};t&2&&(Ni.$$scope={dirty:t,ctx:e}),j.$set(Ni);const qi={};t&2&&(qi.$$scope={dirty:t,ctx:e}),I.$set(qi)},i(e){Vn||(g(b.$$.fragment,e),g(v.$$.fragment,e),g(L.$$.fragment,e),g(B.$$.fragment,e),g(A.$$.fragment,e),g(G.$$.fragment,e),g(U.$$.fragment,e),g(S.$$.fragment,e),g(q.$$.fragment,e),g(O.$$.fragment,e),g(_.$$.fragment,e),g(ae.$$.fragment,e),g(oe.$$.fragment,e),g(ue.$$.fragment,e),g(j.$$.fragment,e),g(ge.$$.fragment,e),g($e.$$.fragment,e),g(be.$$.fragment,e),g(Le.$$.fragment,e),g(We.$$.fragment,e),g(Fe.$$.fragment,e),g(Ye.$$.fragment,e),g(I.$$.fragment,e),g(Qe.$$.fragment,e),g(Ne.$$.fragment,e),g(qe.$$.fragment,e),g(De.$$.fragment,e),g(Oe.$$.fragment,e),g(Ke.$$.fragment,e),g(et.$$.fragment,e),g(tt.$$.fragment,e),g(nt.$$.fragment,e),g(it.$$.fragment,e),g(st.$$.fragment,e),g(lt.$$.fragment,e),Vn=!0)},o(e){d(b.$$.fragment,e),d(v.$$.fragment,e),d(L.$$.fragment,e),d(B.$$.fragment,e),d(A.$$.fragment,e),d(G.$$.fragment,e),d(U.$$.fragment,e),d(S.$$.fragment,e),d(q.$$.fragment,e),d(O.$$.fragment,e),d(_.$$.fragment,e),d(ae.$$.fragment,e),d(oe.$$.fragment,e),d(ue.$$.fragment,e),d(j.$$.fragment,e),d(ge.$$.fragment,e),d($e.$$.fragment,e),d(be.$$.fragment,e),d(Le.$$.fragment,e),d(We.$$.fragment,e),d(Fe.$$.fragment,e),d(Ye.$$.fragment,e),d(I.$$.fragment,e),d(Qe.$$.fragment,e),d(Ne.$$.fragment,e),d(qe.$$.fragment,e),d(De.$$.fragment,e),d(Oe.$$.fragment,e),d(Ke.$$.fragment,e),d(et.$$.fragment,e),d(tt.$$.fragment,e),d(nt.$$.fragment,e),d(it.$$.fragment,e),d(st.$$.fragment,e),d(lt.$$.fragment,e),Vn=!1},d(e){e&&(n($),n(w),n(y),n(T),n(x),n(c),n(ot),n(H),n(pt),n(ct),n(W),n(ut),n(k),n(mt),n(z),n(ht),n(gt),n(Z),n(dt),n(R),n(ft),n(X),n(yt),n(E),n(vt),n(wt),n(Tt),n(V),n(Mt),n(F),n($t),n(Y),n(bt),n(Jt),n(Ct),n(Q),n(xt),n(P),n(Ut),n(N),n(_t),n(jt),n(D),n(It),n(Ht),n(K),n(Lt),n(ee),n(Wt),n(te),n(kt),n(ne),n(zt),n(ie),n(Bt),n(se),n(Zt),n(le),n(Rt),n(Xt),n(Et),n(re),n(At),n(Gt),n(pe),n(Vt),n(ce),n(Ft),n(Yt),n(me),n(St),n(he),n(Qt),n(Pt),n(Nt),n(de),n(qt),n(fe),n(Dt),n(ye),n(Ot),n(ve),n(Kt),n(we),n(en),n(Te),n(tn),n(Me),n(nn),n(sn),n(ln),n(Je),n(an),n(Ce),n(rn),n(xe),n(on),n(Ue),n(pn),n(_e),n(cn),n(je),n(un),n(Ie),n(mn),n(He),n(hn),n(gn),n(dn),n(ke),n(fn),n(ze),n(yn),n(Be),n(vn),n(Ze),n(wn),n(Re),n(Tn),n(Xe),n(Mn),n(Ee),n($n),n(Ae),n(bn),n(Ge),n(Jn),n(Ve),n(Cn),n(xn),n(Un),n(Se),n(_n),n(jn),n(In),n(Pe),n(Hn),n(Ln),n(Wn),n(kn),n(zn),n(Bn),n(Zn),n(Rn),n(Xn),n(En),n(An),n(Gn),n(at)),n(p),f(b,e),f(v,e),f(L,e),f(B,e),f(A,e),f(G,e),f(U,e),f(S,e),f(q,e),f(O,e),f(_,e),f(ae,e),f(oe,e),f(ue,e),f(j,e),f(ge,e),f($e,e),f(be,e),f(Le,e),f(We,e),f(Fe,e),f(Ye,e),f(I,e),f(Qe,e),f(Ne,e),f(qe,e),f(De,e),f(Oe,e),f(Ke,e),f(et,e),f(tt,e),f(nt,e),f(it,e),f(st,e),f(lt,e)}}}const ms='{"title":"Understanding Learning Curves","local":"understanding-learning-curves","sections":[{"title":"What are Learning Curves?","local":"what-are-learning-curves","sections":[{"title":"Loss Curves","local":"loss-curves","sections":[],"depth":3},{"title":"Accuracy Curves","local":"accuracy-curves","sections":[],"depth":3},{"title":"Convergence","local":"convergence","sections":[],"depth":3}],"depth":2},{"title":"Interpreting Learning Curve Patterns","local":"interpreting-learning-curve-patterns","sections":[{"title":"Healthy Learning Curves","local":"healthy-learning-curves","sections":[],"depth":3},{"title":"Practical Examples","local":"practical-examples","sections":[{"title":"During Training","local":"during-training","sections":[],"depth":4},{"title":"After Training","local":"after-training","sections":[],"depth":4},{"title":"Overfitting","local":"overfitting","sections":[],"depth":4},{"title":"2. Underfitting","local":"underfitting","sections":[],"depth":4},{"title":"3. Erratic Learning Curves","local":"erratic-learning-curves","sections":[],"depth":4}],"depth":3}],"depth":2},{"title":"Key Takeaways","local":"key-takeaways","sections":[],"depth":2},{"title":"Section Quiz","local":"section-quiz","sections":[{"title":"1. What does it typically mean when training loss decreases but validation loss starts increasing?","local":"1-what-does-it-typically-mean-when-training-loss-decreases-but-validation-loss-starts-increasing","sections":[],"depth":3},{"title":"2. Why do accuracy curves often show a “steppy” or plateau-like pattern rather than smooth increases?","local":"2-why-do-accuracy-curves-often-show-a-steppy-or-plateau-like-pattern-rather-than-smooth-increases","sections":[],"depth":3},{"title":"3. What is the best approach when you observe erratic, highly fluctuating learning curves?","local":"3-what-is-the-best-approach-when-you-observe-erratic-highly-fluctuating-learning-curves","sections":[],"depth":3},{"title":"4. When should you consider using early stopping?","local":"4-when-should-you-consider-using-early-stopping","sections":[],"depth":3},{"title":"5. What indicates that your model might be underfitting?","local":"5-what-indicates-that-your-model-might-be-underfitting","sections":[],"depth":3}],"depth":2}],"depth":1}';function hs(C){return es(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ms extends ts{constructor(p){super(),ns(this,p,hs,us,Ki,{})}}export{Ms as component};

Xet Storage Details

Size:
46.8 kB
·
Xet hash:
1f627e64c5a86914839ec87bddf686656ca37837e350f8e5b63849fd1091d033

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.