import{S as nc,i as lc,s as pc,e as t,k as c,w as f,t as p,M as ec,c as m,d as a,m as h,x as i,a as u,h as e,b as o,G as n,g as r,y as d,q as _,o as $,B as v,v as rc}from"../../chunks/vendor-hf-doc-builder.js";import{T as wl}from"../../chunks/Tip-hf-doc-builder.js";import{Y as tc}from"../../chunks/Youtube-hf-doc-builder.js";import{I as pm}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as k}from"../../chunks/CodeBlock-hf-doc-builder.js";import{D as mc}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";import{F as uc}from"../../chunks/FrameworkSwitchCourse-hf-doc-builder.js";function cc(M){let b,w,j,E,A,P,O,g,ss,as,Ms,I,L,ts,z,G,H,ns,Gs,ls,ms,R,us;return{c(){b=t("p"),w=p("\u270F\uFE0F "),j=t("strong"),E=p("\u8F6E\u5230\u4F60\u4E86\uFF01"),A=p(" \u4F5C\u4E3A\u6211\u4EEC\u89E3\u51B3\u5176\u4ED6\u95EE\u9898\u540E\u7684\u53EF\u9009\u6311\u6218\uFF0C\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u56DE\u5230\u8FD9\u4E00\u6B65\uFF0C\u8BA9\u6A21\u578B\u4F7F\u7528\u539F\u59CB Keras \u8BA1\u7B97\u7684\u635F\u5931\u800C\u4E0D\u662F\u5185\u90E8\u635F\u5931\u3002 \u60A8\u9700\u8981\u5C06 "),P=t("code"),O=p('"labels"'),g=p(" \u6DFB\u52A0\u5230 "),ss=t("code"),as=p("to_tf_dataset()"),Ms=p(" \u7684 "),I=t("code"),L=p("label_cols"),ts=p(" \u53C2\u6570\uFF0C\u4EE5\u786E\u4FDD\u6B63\u786E\u8F93\u51FA\u6807\u7B7E\uFF0C\u8FD9\u5C06\u4E3A\u60A8\u63D0\u4F9B\u68AF\u5EA6\u2014\u2014\u4F46\u6211\u4EEC\u6307\u5B9A\u7684\u635F\u5931\u8FD8\u6709\u4E00\u4E2A\u95EE\u9898 . \u8BAD\u7EC3\u4ECD\u7136\u4F1A\u9047\u5230\u8FD9\u4E2A\u95EE\u9898\uFF0C\u5B66\u4E60\u4F1A\u975E\u5E38\u7F13\u6162\uFF0C\u5E76\u4E14\u4F1A\u5728\u591A\u6B21\u8BAD\u7EC3\u635F\u5931\u65F6\u8FBE\u5230\u7A33\u5B9A\u72B6\u6001\u3002 \u4F60\u80FD\u5F04\u6E05\u695A\u5B83\u662F\u4EC0\u4E48\u5417\uFF1F"),z=c(),G=t("p"),H=p("\u4E00\u4E2A ROT13 \u7F16\u7801\u7684\u63D0\u793A\uFF0C\u5982\u679C\u4F60\u5361\u4F4F\u4E86\uFF1AVs lbh ybbx ng gur bhgchgf bs FrdhraprPynffvsvpngvba zbqryf va Genafsbezref, gurve svefg bhgchg vf "),ns=t("code"),Gs=p("ybtvgf"),ls=p("\u3002 \u8363\u683C\u7EB3 ybtvgf?"),ms=c(),R=t("p"),us=p("\u7B2C\u4E8C\u4E2A\u63D0\u793A\uFF1AJura lbh fcrpvsl bcgvzvmref, npgvingvbaf \u662F ybffrf jvgu fgevatf, Xrenf frgf nyy gur nethzrag inyhrf gb gurve qrsnhygf\u3002 Jung nethzragf qbrf FcnefrPngrtbevpnyPebffragebcl unir, naq jung ner gurve qrsnhygf?")},l(y){b=m(y,"P",{});var T=u(b);w=e(T,"\u270F\uFE0F "),j=m(T,"STRONG",{});var cs=u(j);E=e(cs,"\u8F6E\u5230\u4F60\u4E86\uFF01"),cs.forEach(a),A=e(T," \u4F5C\u4E3A\u6211\u4EEC\u89E3\u51B3\u5176\u4ED6\u95EE\u9898\u540E\u7684\u53EF\u9009\u6311\u6218\uFF0C\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u56DE\u5230\u8FD9\u4E00\u6B65\uFF0C\u8BA9\u6A21\u578B\u4F7F\u7528\u539F\u59CB Keras \u8BA1\u7B97\u7684\u635F\u5931\u800C\u4E0D\u662F\u5185\u90E8\u635F\u5931\u3002 \u60A8\u9700\u8981\u5C06 "),P=m(T,"CODE",{});var V=u(P);O=e(V,'"labels"'),V.forEach(a),g=e(T," \u6DFB\u52A0\u5230 "),ss=m(T,"CODE",{});var ga=u(ss);as=e(ga,"to_tf_dataset()"),ga.forEach(a),Ms=e(T," \u7684 "),I=m(T,"CODE",{});var hs=u(I);L=e(hs,"label_cols"),hs.forEach(a),ts=e(T," \u53C2\u6570\uFF0C\u4EE5\u786E\u4FDD\u6B63\u786E\u8F93\u51FA\u6807\u7B7E\uFF0C\u8FD9\u5C06\u4E3A\u60A8\u63D0\u4F9B\u68AF\u5EA6\u2014\u2014\u4F46\u6211\u4EEC\u6307\u5B9A\u7684\u635F\u5931\u8FD8\u6709\u4E00\u4E2A\u95EE\u9898 . \u8BAD\u7EC3\u4ECD\u7136\u4F1A\u9047\u5230\u8FD9\u4E2A\u95EE\u9898\uFF0C\u5B66\u4E60\u4F1A\u975E\u5E38\u7F13\u6162\uFF0C\u5E76\u4E14\u4F1A\u5728\u591A\u6B21\u8BAD\u7EC3\u635F\u5931\u65F6\u8FBE\u5230\u7A33\u5B9A\u72B6\u6001\u3002 \u4F60\u80FD\u5F04\u6E05\u695A\u5B83\u662F\u4EC0\u4E48\u5417\uFF1F"),T.forEach(a),z=h(y),G=m(y,"P",{});var bs=u(G);H=e(bs,"\u4E00\u4E2A ROT13 \u7F16\u7801\u7684\u63D0\u793A\uFF0C\u5982\u679C\u4F60\u5361\u4F4F\u4E86\uFF1AVs lbh ybbx ng gur bhgchgf bs FrdhraprPynffvsvpngvba zbqryf va Genafsbezref, gurve svefg bhgchg vf "),ns=m(bs,"CODE",{});var xs=u(ns);Gs=e(xs,"ybtvgf"),xs.forEach(a),ls=e(bs,"\u3002 \u8363\u683C\u7EB3 ybtvgf?"),bs.forEach(a),ms=h(y),R=m(y,"P",{});var X=u(R);us=e(X,"\u7B2C\u4E8C\u4E2A\u63D0\u793A\uFF1AJura lbh fcrpvsl bcgvzvmref, npgvingvbaf \u662F ybffrf jvgu fgevatf, Xrenf frgf nyy gur nethzrag inyhrf gb gurve qrsnhygf\u3002 Jung nethzragf qbrf FcnefrPngrtbevpnyPebffragebcl unir, naq jung ner gurve qrsnhygf?"),X.forEach(a)},m(y,T){r(y,b,T),n(b,w),n(b,j),n(j,E),n(b,A),n(b,P),n(P,O),n(b,g),n(b,ss),n(ss,as),n(b,Ms),n(b,I),n(I,L),n(b,ts),r(y,z,T),r(y,G,T),n(G,H),n(G,ns),n(ns,Gs),n(G,ls),r(y,ms,T),r(y,R,T),n(R,us)},d(y){y&&a(b),y&&a(z),y&&a(G),y&&a(ms),y&&a(R)}}}function hc(M){let b,w,j,E,A;return{c(){b=t("p"),w=p("\u{1F4A1}\u60A8\u8FD8\u53EF\u4EE5\u4ECE\u{1F917} Transformers \u4E2D\u5BFC\u5165 "),j=t("code"),E=p("create_optimizer()"),A=p(" \u51FD\u6570\uFF0C\u8FD9\u5C06\u4E3A\u60A8\u63D0\u4F9B\u5177\u6709\u6B63\u786E\u6743\u91CD\u8870\u51CF\u4EE5\u53CA\u5B66\u4E60\u7387\u9884\u70ED\u548C\u5B66\u4E60\u7387\u8870\u51CF\u7684 AdamW \u4F18\u5316\u5668\u3002 \u6B64\u4F18\u5316\u5668\u901A\u5E38\u4F1A\u4EA7\u751F\u6BD4\u4F7F\u7528\u9ED8\u8BA4 Adam \u4F18\u5316\u5668\u83B7\u5F97\u7684\u7ED3\u679C\u7A0D\u597D\u4E00\u4E9B\u7684\u7ED3\u679C\u3002")},l(P){b=m(P,"P",{});var O=u(b);w=e(O,"\u{1F4A1}\u60A8\u8FD8\u53EF\u4EE5\u4ECE\u{1F917} Transformers \u4E2D\u5BFC\u5165 "),j=m(O,"CODE",{});var g=u(j);E=e(g,"create_optimizer()"),g.forEach(a),A=e(O," \u51FD\u6570\uFF0C\u8FD9\u5C06\u4E3A\u60A8\u63D0\u4F9B\u5177\u6709\u6B63\u786E\u6743\u91CD\u8870\u51CF\u4EE5\u53CA\u5B66\u4E60\u7387\u9884\u70ED\u548C\u5B66\u4E60\u7387\u8870\u51CF\u7684 AdamW \u4F18\u5316\u5668\u3002 \u6B64\u4F18\u5316\u5668\u901A\u5E38\u4F1A\u4EA7\u751F\u6BD4\u4F7F\u7528\u9ED8\u8BA4 Adam \u4F18\u5316\u5668\u83B7\u5F97\u7684\u7ED3\u679C\u7A0D\u597D\u4E00\u4E9B\u7684\u7ED3\u679C\u3002"),O.forEach(a)},m(P,O){r(P,b,O),n(b,w),n(b,j),n(j,E),n(b,A)},d(P){P&&a(b)}}}function bc(M){let b,w;return{c(){b=t("p"),w=p("\u5728\u8BFE\u7A0B\u7684\u4E0B\u4E00\u90E8\u5206\u4E2D\uFF0C\u6211\u4EEC\u5C06\u4ECB\u7ECD\u66F4\u5148\u8FDB\u7684\u6280\u672F\uFF0C\u8FD9\u4E9B\u6280\u672F\u53EF\u4EE5\u5E2E\u52A9\u60A8\u51CF\u5C11\u5185\u5B58\u5360\u7528\u5E76\u8BA9\u60A8\u5FAE\u8C03\u6700\u5927\u7684\u6A21\u578B\u3002")},l(j){b=m(j,"P",{});var E=u(b);w=e(E,"\u5728\u8BFE\u7A0B\u7684\u4E0B\u4E00\u90E8\u5206\u4E2D\uFF0C\u6211\u4EEC\u5C06\u4ECB\u7ECD\u66F4\u5148\u8FDB\u7684\u6280\u672F\uFF0C\u8FD9\u4E9B\u6280\u672F\u53EF\u4EE5\u5E2E\u52A9\u60A8\u51CF\u5C11\u5185\u5B58\u5360\u7528\u5E76\u8BA9\u60A8\u5FAE\u8C03\u6700\u5927\u7684\u6A21\u578B\u3002"),E.forEach(a)},m(j,E){r(j,b,E),n(b,w)},d(j){j&&a(b)}}}function jc(M){let b,w;return{c(){b=t("p"),w=p("\u{1F4A1} \u5982\u679C\u60A8\u7684\u8BAD\u7EC3\u6570\u636E\u4E0D\u5E73\u8861\uFF0C\u8BF7\u786E\u4FDD\u6784\u5EFA\u4E00\u6279\u5305\u542B\u6240\u6709\u6807\u7B7E\u7684\u8BAD\u7EC3\u6570\u636E\u3002")},l(j){b=m(j,"P",{});var E=u(b);w=e(E,"\u{1F4A1} \u5982\u679C\u60A8\u7684\u8BAD\u7EC3\u6570\u636E\u4E0D\u5E73\u8861\uFF0C\u8BF7\u786E\u4FDD\u6784\u5EFA\u4E00\u6279\u5305\u542B\u6240\u6709\u6807\u7B7E\u7684\u8BAD\u7EC3\u6570\u636E\u3002"),E.forEach(a)},m(j,E){r(j,b,E),n(b,w)},d(j){j&&a(b)}}}function oc(M){let b,w;return{c(){b=t("p"),w=p("\u26A0\uFE0F \u5728\u6B64\u6D4B\u8BD5\u4E4B\u540E\uFF0C\u60A8\u5C06\u4E0D\u5F97\u4E0D\u91CD\u65B0\u521B\u5EFA\u60A8\u7684\u6A21\u578B\u548C\u201CTrainer\u201D\uFF0C\u56E0\u4E3A\u83B7\u5F97\u7684\u6A21\u578B\u53EF\u80FD\u65E0\u6CD5\u5728\u60A8\u7684\u5B8C\u6574\u6570\u636E\u96C6\u4E0A\u6062\u590D\u548C\u5B66\u4E60\u6709\u7528\u7684\u4E1C\u897F\u3002")},l(j){b=m(j,"P",{});var E=u(b);w=e(E,"\u26A0\uFE0F \u5728\u6B64\u6D4B\u8BD5\u4E4B\u540E\uFF0C\u60A8\u5C06\u4E0D\u5F97\u4E0D\u91CD\u65B0\u521B\u5EFA\u60A8\u7684\u6A21\u578B\u548C\u201CTrainer\u201D\uFF0C\u56E0\u4E3A\u83B7\u5F97\u7684\u6A21\u578B\u53EF\u80FD\u65E0\u6CD5\u5728\u60A8\u7684\u5B8C\u6574\u6570\u636E\u96C6\u4E0A\u6062\u590D\u548C\u5B66\u4E60\u6709\u7528\u7684\u4E1C\u897F\u3002"),E.forEach(a)},m(j,E){r(j,b,E),n(b,w)},d(j){j&&a(b)}}}function fc(M){let b,w,j,E,A,P,O,g,ss,as,Ms,I,L,ts,z,G,H,ns,Gs,ls,ms,R,us,y,T,cs,V,ga,hs,bs,xs,X,kl,js,ze,$n,ge,Fe,Tl,os,Se,vn,Me,Ge,Pl,fs,xe,Ns,Ne,Ke,Cl,is,Le,En,Ue,Be,Dl,ds,Ie,yn,He,Re,Al,_s,Ve,Ks,Xe,Je,Ol,Ls,ql,Fa,We,zl,Sa,Ye,gl,Us,Fl,Ma,Ze,Sl,Bs,Qe,Ml,Ga,s0,Gl,D,a0,wn,n0,l0,kn,p0,e0,Tn,r0,t0,Pn,m0,u0,Cn,c0,h0,Dn,b0,j0,xl,Is,Nl,U,An,o0,f0,On,i0,d0,qn,_0,$0,Kl,Hs,Ll,x,v0,zn,E0,y0,gn,w0,k0,Fn,T0,P0,Ul,$s,C0,Sn,D0,A0,Bl,vs,O0,Mn,q0,z0,Il,Rs,Hl,xa,g0,Rl,Es,Vl,ys,F0,Gn,S0,M0,Xl,Vs,Jl,Na,G0,Wl,Xs,xn,x0,N0,Yl,Js,K0,Zl,B,Nn,L0,U0,Kn,B0,I0,Ln,H0,R0,Ql,ws,V0,Un,X0,J0,sp,Ws,ap,Ys,np,C,W0,Bn,Y0,Z0,In,Q0,sr,Hn,ar,nr,Rn,lr,pr,Vn,er,rr,Xn,tr,mr,Jn,ur,cr,lp,J,hr,Wn,br,jr,Yn,or,fr,pp,Zs,ep,Ka,ir,rp,Qs,tp,ps,Zn,dr,_r,Qn,$r,vr,mp,sa,up,aa,cp,La,Er,hp,na,bp,la,jp,Ua,yr,op,pa,fp,ea,ip,W,wr,sl,kr,Tr,al,Pr,Cr,dp,ra,_p,ta,$p,Ba,Dr,vp,ma,Ep,ua,yp,Ia,Ar,wp,ca,Or,kp,Y,qr,nl,zr,gr,ll,Fr,Sr,Tp,ks,Mr,ha,Gr,xr,Pp,Ha,Nr,Cp,ba,Dp,Ts,Ap,Ra,Kr,Op,ja,qp,oa,zp,Va,Lr,gp,fa,Ur,Fp,Xa,Br,Sp,ia,Ir,Mp,Ps,Hr,pl,Rr,Vr,Gp,Cs,xp,es,Ds,el,da,Xr,rl,Jr,Np,Z,Wr,tl,Yr,Zr,ml,Qr,st,Kp,Ja,at,Lp,As,nt,ul,lt,pt,Up,_a,et,Bp,F,rt,cl,tt,mt,hl,ut,ct,bl,ht,bt,jl,jt,ot,Ip,$a,Hp,Wa,ft,Rp,va,Vp,Ya,it,Xp,N,ol,dt,_t,fl,$t,vt,il,Et,yt,dl,wt,Jp,Za,kt,Wp,Qa,Tt,Yp,sn,Pt,Zp,Ea,Ct,Qp,an,Dt,se,nn,At,ae,ya,ne,Os,le,ln,Ot,pe,pn,qt,ee,qs,re,wa,zt,te,en,gt,me,rn,Ft,ue,tn,St,ce,ka,Mt,he,zs,Gt,Ta,xt,Nt,be,mn,Kt,je,K,un,Pa,Lt,Ut,Bt,cn,Ca,It,Ht,Rt,hn,Da,Vt,Xt,Jt,bn,Aa,Wt,Yt,oe,jn,Zt,fe;return j=new uc({props:{fw:M[0]}}),g=new pm({}),L=new mc({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/chapter8/section4_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/chapter8/section4_tf.ipynb"}]}}),V=new pm({}),X=new tc({props:{id:"N9kO52itd0Q"}}),Ls=new k({props:{code:`from datasets import load_dataset, load_metric
from transformers import (
    AutoTokenizer,
    TFAutoModelForSequenceClassification,
)

raw_datasets = load_dataset("glue", "mnli")

model_checkpoint = "distilbert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)


def preprocess_function(examples):
    return tokenizer(examples["premise"], examples["hypothesis"], truncation=True)


tokenized_datasets = raw_datasets.map(preprocess_function, batched=True)

train_dataset = tokenized_datasets["train"].to_tf_dataset(
    columns=["input_ids", "labels"], batch_size=16, shuffle=True
)

validation_dataset = tokenized_datasets["validation_matched"].to_tf_dataset(
    columns=["input_ids", "labels"], batch_size=16, shuffle=True
)

model = TFAutoModelForSequenceClassification.from_pretrained(model_checkpoint)

model.compile(loss="sparse_categorical_crossentropy", optimizer="adam")

model.fit(train_dataset)`,highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, load_metric
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> (
    AutoTokenizer,
    TFAutoModelForSequenceClassification,
)

raw_datasets = load_dataset(<span class="hljs-string">&quot;glue&quot;</span>, <span class="hljs-string">&quot;mnli&quot;</span>)

model_checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)


<span class="hljs-keyword">def</span> <span class="hljs-title function_">preprocess_function</span>(<span class="hljs-params">examples</span>):
    <span class="hljs-keyword">return</span> tokenizer(examples[<span class="hljs-string">&quot;premise&quot;</span>], examples[<span class="hljs-string">&quot;hypothesis&quot;</span>], truncation=<span class="hljs-literal">True</span>)


tokenized_datasets = raw_datasets.<span class="hljs-built_in">map</span>(preprocess_function, batched=<span class="hljs-literal">True</span>)

train_dataset = tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>].to_tf_dataset(
    columns=[<span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>], batch_size=<span class="hljs-number">16</span>, shuffle=<span class="hljs-literal">True</span>
)

validation_dataset = tokenized_datasets[<span class="hljs-string">&quot;validation_matched&quot;</span>].to_tf_dataset(
    columns=[<span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>], batch_size=<span class="hljs-number">16</span>, shuffle=<span class="hljs-literal">True</span>
)

model = TFAutoModelForSequenceClassification.from_pretrained(model_checkpoint)

model.<span class="hljs-built_in">compile</span>(loss=<span class="hljs-string">&quot;sparse_categorical_crossentropy&quot;</span>, optimizer=<span class="hljs-string">&quot;adam&quot;</span>)

model.fit(train_dataset)`}}),Us=new k({props:{code:"ValueError: No gradients provided for any variable: ['tf_distil_bert_for_sequence_classification/distilbert/embeddings/word_embeddings/weight:0', '...']",highlighted:'ValueError: No gradients provided <span class="hljs-keyword">for</span> <span class="hljs-built_in">any</span> variable: [<span class="hljs-string">&#x27;tf_distil_bert_for_sequence_classification/distilbert/embeddings/word_embeddings/weight:0&#x27;</span>, <span class="hljs-string">&#x27;...&#x27;</span>]'}}),Is=new k({props:{code:`for batch in train_dataset:
    break`,highlighted:`<span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> train_dataset:
    <span class="hljs-keyword">break</span>`}}),Hs=new k({props:{code:`{'attention_mask': <tf.Tensor: shape=(16, 76), dtype=int64, numpy=
 array([[1, 1, 1, ..., 0, 0, 0],
        [1, 1, 1, ..., 0, 0, 0],
        [1, 1, 1, ..., 0, 0, 0],
        ...,
        [1, 1, 1, ..., 1, 1, 1],
        [1, 1, 1, ..., 0, 0, 0],
        [1, 1, 1, ..., 0, 0, 0]])>,
 'label': <tf.Tensor: shape=(16,), dtype=int64, numpy=array([0, 2, 1, 2, 1, 1, 2, 0, 0, 0, 1, 0, 1, 2, 2, 1])>,
 'input_ids': <tf.Tensor: shape=(16, 76), dtype=int64, numpy=
 array([[ 101, 2174, 1010, ...,    0,    0,    0],
        [ 101, 3174, 2420, ...,    0,    0,    0],
        [ 101, 2044, 2048, ...,    0,    0,    0],
        ...,
        [ 101, 3398, 3398, ..., 2051, 2894,  102],
        [ 101, 1996, 4124, ...,    0,    0,    0],
        [ 101, 1999, 2070, ...,    0,    0,    0]])>}`,highlighted:`{<span class="hljs-string">&#x27;attention_mask&#x27;</span>: &lt;tf.Tensor: shape=(<span class="hljs-number">16</span>, <span class="hljs-number">76</span>), dtype=int64, numpy=
 array([[<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, ..., <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>],
        [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, ..., <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>],
        [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, ..., <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>],
        ...,
        [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, ..., <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>],
        [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, ..., <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>],
        [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, ..., <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>]])&gt;,
 <span class="hljs-string">&#x27;label&#x27;</span>: &lt;tf.Tensor: shape=(<span class="hljs-number">16</span>,), dtype=int64, numpy=array([<span class="hljs-number">0</span>, <span class="hljs-number">2</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">1</span>])&gt;,
 <span class="hljs-string">&#x27;input_ids&#x27;</span>: &lt;tf.Tensor: shape=(<span class="hljs-number">16</span>, <span class="hljs-number">76</span>), dtype=int64, numpy=
 array([[ <span class="hljs-number">101</span>, <span class="hljs-number">2174</span>, <span class="hljs-number">1010</span>, ...,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>],
        [ <span class="hljs-number">101</span>, <span class="hljs-number">3174</span>, <span class="hljs-number">2420</span>, ...,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>],
        [ <span class="hljs-number">101</span>, <span class="hljs-number">2044</span>, <span class="hljs-number">2048</span>, ...,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>],
        ...,
        [ <span class="hljs-number">101</span>, <span class="hljs-number">3398</span>, <span class="hljs-number">3398</span>, ..., <span class="hljs-number">2051</span>, <span class="hljs-number">2894</span>,  <span class="hljs-number">102</span>],
        [ <span class="hljs-number">101</span>, <span class="hljs-number">1996</span>, <span class="hljs-number">4124</span>, ...,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>],
        [ <span class="hljs-number">101</span>, <span class="hljs-number">1999</span>, <span class="hljs-number">2070</span>, ...,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>,    <span class="hljs-number">0</span>]])&gt;}`}}),Rs=new k({props:{code:'model.compile(optimizer="adam")',highlighted:'model.<span class="hljs-built_in">compile</span>(optimizer=<span class="hljs-string">&quot;adam&quot;</span>)'}}),Es=new wl({props:{$$slots:{default:[cc]},$$scope:{ctx:M}}}),Vs=new k({props:{code:"  246/24543 [..............................] - ETA: 15:52 - loss: nan",highlighted:'  <span class="hljs-number">246</span>/<span class="hljs-number">24543</span> [..............................] - ETA: <span class="hljs-number">15</span>:<span class="hljs-number">52</span> - loss: nan'}}),Ws=new k({props:{code:"model(batch)",highlighted:"model(batch)"}}),Ys=new k({props:{code:`TFSequenceClassifierOutput(loss=<tf.Tensor: shape=(16,), dtype=float32, numpy=
array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan], dtype=float32)>, logits=<tf.Tensor: shape=(16, 2), dtype=float32, numpy=
array([[nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan]], dtype=float32)>, hidden_states=None, attentions=None)`,highlighted:`TFSequenceClassifierOutput(loss=&lt;tf.Tensor: shape=(<span class="hljs-number">16</span>,), dtype=float32, numpy=
array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan], dtype=float32)&gt;, logits=&lt;tf.Tensor: shape=(<span class="hljs-number">16</span>, <span class="hljs-number">2</span>), dtype=float32, numpy=
array([[nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan],
       [nan, nan]], dtype=float32)&gt;, hidden_states=<span class="hljs-literal">None</span>, attentions=<span class="hljs-literal">None</span>)`}}),Zs=new k({props:{code:`model = TFAutoModelForSequenceClassification.from_pretrained(model_checkpoint)
model(batch)`,highlighted:`model = TFAutoModelForSequenceClassification.from_pretrained(model_checkpoint)
model(batch)`}}),Qs=new k({props:{code:`TFSequenceClassifierOutput(loss=<tf.Tensor: shape=(16,), dtype=float32, numpy=
array([0.6844486 ,        nan,        nan, 0.67127866, 0.7068601 ,
              nan, 0.69309855,        nan, 0.65531296,        nan,
              nan,        nan, 0.675402  ,        nan,        nan,
       0.69831556], dtype=float32)>, logits=<tf.Tensor: shape=(16, 2), dtype=float32, numpy=
array([[-0.04761693, -0.06509043],
       [-0.0481936 , -0.04556257],
       [-0.0040929 , -0.05848458],
       [-0.02417453, -0.0684005 ],
       [-0.02517801, -0.05241832],
       [-0.04514256, -0.0757378 ],
       [-0.02656011, -0.02646275],
       [ 0.00766164, -0.04350497],
       [ 0.02060014, -0.05655622],
       [-0.02615328, -0.0447021 ],
       [-0.05119278, -0.06928903],
       [-0.02859691, -0.04879177],
       [-0.02210129, -0.05791225],
       [-0.02363213, -0.05962167],
       [-0.05352269, -0.0481673 ],
       [-0.08141848, -0.07110836]], dtype=float32)>, hidden_states=None, attentions=None)`,highlighted:`TFSequenceClassifierOutput(loss=&lt;tf.Tensor: shape=(<span class="hljs-number">16</span>,), dtype=float32, numpy=
array([<span class="hljs-number">0.6844486</span> ,        nan,        nan, <span class="hljs-number">0.67127866</span>, <span class="hljs-number">0.7068601</span> ,
              nan, <span class="hljs-number">0.69309855</span>,        nan, <span class="hljs-number">0.65531296</span>,        nan,
              nan,        nan, <span class="hljs-number">0.675402</span>  ,        nan,        nan,
       <span class="hljs-number">0.69831556</span>], dtype=float32)&gt;, logits=&lt;tf.Tensor: shape=(<span class="hljs-number">16</span>, <span class="hljs-number">2</span>), dtype=float32, numpy=
array([[-<span class="hljs-number">0.04761693</span>, -<span class="hljs-number">0.06509043</span>],
       [-<span class="hljs-number">0.0481936</span> , -<span class="hljs-number">0.04556257</span>],
       [-<span class="hljs-number">0.0040929</span> , -<span class="hljs-number">0.05848458</span>],
       [-<span class="hljs-number">0.02417453</span>, -<span class="hljs-number">0.0684005</span> ],
       [-<span class="hljs-number">0.02517801</span>, -<span class="hljs-number">0.05241832</span>],
       [-<span class="hljs-number">0.04514256</span>, -<span class="hljs-number">0.0757378</span> ],
       [-<span class="hljs-number">0.02656011</span>, -<span class="hljs-number">0.02646275</span>],
       [ <span class="hljs-number">0.00766164</span>, -<span class="hljs-number">0.04350497</span>],
       [ <span class="hljs-number">0.02060014</span>, -<span class="hljs-number">0.05655622</span>],
       [-<span class="hljs-number">0.02615328</span>, -<span class="hljs-number">0.0447021</span> ],
       [-<span class="hljs-number">0.05119278</span>, -<span class="hljs-number">0.06928903</span>],
       [-<span class="hljs-number">0.02859691</span>, -<span class="hljs-number">0.04879177</span>],
       [-<span class="hljs-number">0.02210129</span>, -<span class="hljs-number">0.05791225</span>],
       [-<span class="hljs-number">0.02363213</span>, -<span class="hljs-number">0.05962167</span>],
       [-<span class="hljs-number">0.05352269</span>, -<span class="hljs-number">0.0481673</span> ],
       [-<span class="hljs-number">0.08141848</span>, -<span class="hljs-number">0.07110836</span>]], dtype=float32)&gt;, hidden_states=<span class="hljs-literal">None</span>, attentions=<span class="hljs-literal">None</span>)`}}),sa=new k({props:{code:`import numpy as np

loss = model(batch).loss.numpy()
indices = np.flatnonzero(np.isnan(loss))
indices`,highlighted:`<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

loss = model(batch).loss.numpy()
indices = np.flatnonzero(np.isnan(loss))
indices`}}),aa=new k({props:{code:"array([ 1,  2,  5,  7,  9, 10, 11, 13, 14])",highlighted:'array([ <span class="hljs-number">1</span>,  <span class="hljs-number">2</span>,  <span class="hljs-number">5</span>,  <span class="hljs-number">7</span>,  <span class="hljs-number">9</span>, <span class="hljs-number">10</span>, <span class="hljs-number">11</span>, <span class="hljs-number">13</span>, <span class="hljs-number">14</span>])'}}),na=new k({props:{code:`input_ids = batch["input_ids"].numpy()
input_ids[indices]`,highlighted:`input_ids = batch[<span class="hljs-string">&quot;input_ids&quot;</span>].numpy()
input_ids[indices]`}}),la=new k({props:{code:`array([[  101,  2007,  2032,  2001,  1037, 16480,  3917,  2594,  4135,
        23212,  3070,  2214, 10170,  1010,  2012,  4356,  1997,  3183,
         6838, 12953,  2039,  2000,  1996,  6147,  1997,  2010,  2606,
         1012,   102,  6838,  2001,  3294,  6625,  3773,  1996,  2214,
         2158,  1012,   102,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0],
       [  101,  1998,  6814,  2016,  2234,  2461,  2153,  1998, 13322,
         2009,  1012,   102,  2045,  1005,  1055,  2053,  3382,  2008,
         2016,  1005,  2222,  3046,  8103,  2075,  2009,  2153,  1012,
          102,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0],
       [  101,  1998,  2007,  1996,  3712,  4634,  1010,  2057,  8108,
         2025,  3404,  2028,  1012,  1996,  2616, 18449,  2125,  1999,
         1037,  9666,  1997,  4100,  8663, 11020,  6313,  2791,  1998,
         2431,  1011,  4301,  1012,   102,  2028,  1005,  1055,  5177,
         2110,  1998,  3977,  2000,  2832,  2106,  2025,  2689,  2104,
         2122,  6214,  1012,   102,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0],
       [  101,  1045,  2001,  1999,  1037, 13090,  5948,  2007,  2048,
         2308,  2006,  2026,  5001,  2043,  2026,  2171,  2001,  2170,
         1012,   102,  1045,  2001,  3564,  1999,  2277,  1012,   102,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0],
       [  101,  2195,  4279,  2191,  2039,  1996,  2181,  2124,  2004,
         1996,  2225,  7363,  1012,   102,  2045,  2003,  2069,  2028,
         2451,  1999,  1996,  2225,  7363,  1012,   102,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0],
       [  101,  2061,  2008,  1045,  2123,  1005,  1056,  2113,  2065,
         2009,  2428, 10654,  7347,  2030,  2009,  7126,  2256,  2495,
         2291,   102,  2009,  2003,  5094,  2256,  2495,  2291,  2035,
         2105,  1012,   102,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0],
       [  101,  2051,  1010,  2029,  3216,  2019,  2503,  3444,  1010,
         6732,  1996,  2265,  2038, 19840,  2098,  2125,  9906,  1998,
         2003,  2770,  2041,  1997,  4784,  1012,   102,  2051,  6732,
         1996,  2265,  2003,  9525,  1998,  4569,  1012,   102,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0],
       [  101,  1996, 10556,  2140, 11515,  2058,  1010,  2010,  2162,
         2252,  5689,  2013,  2010,  7223,  1012,   102,  2043,  1996,
        10556,  2140, 11515,  2058,  1010,  2010,  2252,  3062,  2000,
         1996,  2598,  1012,   102,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0],
       [  101, 13543,  1999,  2049,  6143,  2933,  2443,   102,  2025,
        13543,  1999,  6143,  2933,  2003,  2443,   102,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0,     0,     0,     0,     0,     0,
            0,     0,     0,     0]])`,highlighted:`array([[  <span class="hljs-number">101</span>,  <span class="hljs-number">2007</span>,  <span class="hljs-number">2032</span>,  <span class="hljs-number">2001</span>,  <span class="hljs-number">1037</span>, <span class="hljs-number">16480</span>,  <span class="hljs-number">3917</span>,  <span class="hljs-number">2594</span>,  <span class="hljs-number">4135</span>,
        <span class="hljs-number">23212</span>,  <span class="hljs-number">3070</span>,  <span class="hljs-number">2214</span>, <span class="hljs-number">10170</span>,  <span class="hljs-number">1010</span>,  <span class="hljs-number">2012</span>,  <span class="hljs-number">4356</span>,  <span class="hljs-number">1997</span>,  <span class="hljs-number">3183</span>,
         <span class="hljs-number">6838</span>, <span class="hljs-number">12953</span>,  <span class="hljs-number">2039</span>,  <span class="hljs-number">2000</span>,  <span class="hljs-number">1996</span>,  <span class="hljs-number">6147</span>,  <span class="hljs-number">1997</span>,  <span class="hljs-number">2010</span>,  <span class="hljs-number">2606</span>,
         <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,  <span class="hljs-number">6838</span>,  <span class="hljs-number">2001</span>,  <span class="hljs-number">3294</span>,  <span class="hljs-number">6625</span>,  <span class="hljs-number">3773</span>,  <span class="hljs-number">1996</span>,  <span class="hljs-number">2214</span>,
         <span class="hljs-number">2158</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>],
       [  <span class="hljs-number">101</span>,  <span class="hljs-number">1998</span>,  <span class="hljs-number">6814</span>,  <span class="hljs-number">2016</span>,  <span class="hljs-number">2234</span>,  <span class="hljs-number">2461</span>,  <span class="hljs-number">2153</span>,  <span class="hljs-number">1998</span>, <span class="hljs-number">13322</span>,
         <span class="hljs-number">2009</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,  <span class="hljs-number">2045</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">1055</span>,  <span class="hljs-number">2053</span>,  <span class="hljs-number">3382</span>,  <span class="hljs-number">2008</span>,
         <span class="hljs-number">2016</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">2222</span>,  <span class="hljs-number">3046</span>,  <span class="hljs-number">8103</span>,  <span class="hljs-number">2075</span>,  <span class="hljs-number">2009</span>,  <span class="hljs-number">2153</span>,  <span class="hljs-number">1012</span>,
          <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>],
       [  <span class="hljs-number">101</span>,  <span class="hljs-number">1998</span>,  <span class="hljs-number">2007</span>,  <span class="hljs-number">1996</span>,  <span class="hljs-number">3712</span>,  <span class="hljs-number">4634</span>,  <span class="hljs-number">1010</span>,  <span class="hljs-number">2057</span>,  <span class="hljs-number">8108</span>,
         <span class="hljs-number">2025</span>,  <span class="hljs-number">3404</span>,  <span class="hljs-number">2028</span>,  <span class="hljs-number">1012</span>,  <span class="hljs-number">1996</span>,  <span class="hljs-number">2616</span>, <span class="hljs-number">18449</span>,  <span class="hljs-number">2125</span>,  <span class="hljs-number">1999</span>,
         <span class="hljs-number">1037</span>,  <span class="hljs-number">9666</span>,  <span class="hljs-number">1997</span>,  <span class="hljs-number">4100</span>,  <span class="hljs-number">8663</span>, <span class="hljs-number">11020</span>,  <span class="hljs-number">6313</span>,  <span class="hljs-number">2791</span>,  <span class="hljs-number">1998</span>,
         <span class="hljs-number">2431</span>,  <span class="hljs-number">1011</span>,  <span class="hljs-number">4301</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,  <span class="hljs-number">2028</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">1055</span>,  <span class="hljs-number">5177</span>,
         <span class="hljs-number">2110</span>,  <span class="hljs-number">1998</span>,  <span class="hljs-number">3977</span>,  <span class="hljs-number">2000</span>,  <span class="hljs-number">2832</span>,  <span class="hljs-number">2106</span>,  <span class="hljs-number">2025</span>,  <span class="hljs-number">2689</span>,  <span class="hljs-number">2104</span>,
         <span class="hljs-number">2122</span>,  <span class="hljs-number">6214</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>],
       [  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">2001</span>,  <span class="hljs-number">1999</span>,  <span class="hljs-number">1037</span>, <span class="hljs-number">13090</span>,  <span class="hljs-number">5948</span>,  <span class="hljs-number">2007</span>,  <span class="hljs-number">2048</span>,
         <span class="hljs-number">2308</span>,  <span class="hljs-number">2006</span>,  <span class="hljs-number">2026</span>,  <span class="hljs-number">5001</span>,  <span class="hljs-number">2043</span>,  <span class="hljs-number">2026</span>,  <span class="hljs-number">2171</span>,  <span class="hljs-number">2001</span>,  <span class="hljs-number">2170</span>,
         <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">2001</span>,  <span class="hljs-number">3564</span>,  <span class="hljs-number">1999</span>,  <span class="hljs-number">2277</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>],
       [  <span class="hljs-number">101</span>,  <span class="hljs-number">2195</span>,  <span class="hljs-number">4279</span>,  <span class="hljs-number">2191</span>,  <span class="hljs-number">2039</span>,  <span class="hljs-number">1996</span>,  <span class="hljs-number">2181</span>,  <span class="hljs-number">2124</span>,  <span class="hljs-number">2004</span>,
         <span class="hljs-number">1996</span>,  <span class="hljs-number">2225</span>,  <span class="hljs-number">7363</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,  <span class="hljs-number">2045</span>,  <span class="hljs-number">2003</span>,  <span class="hljs-number">2069</span>,  <span class="hljs-number">2028</span>,
         <span class="hljs-number">2451</span>,  <span class="hljs-number">1999</span>,  <span class="hljs-number">1996</span>,  <span class="hljs-number">2225</span>,  <span class="hljs-number">7363</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>],
       [  <span class="hljs-number">101</span>,  <span class="hljs-number">2061</span>,  <span class="hljs-number">2008</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">2123</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">1056</span>,  <span class="hljs-number">2113</span>,  <span class="hljs-number">2065</span>,
         <span class="hljs-number">2009</span>,  <span class="hljs-number">2428</span>, <span class="hljs-number">10654</span>,  <span class="hljs-number">7347</span>,  <span class="hljs-number">2030</span>,  <span class="hljs-number">2009</span>,  <span class="hljs-number">7126</span>,  <span class="hljs-number">2256</span>,  <span class="hljs-number">2495</span>,
         <span class="hljs-number">2291</span>,   <span class="hljs-number">102</span>,  <span class="hljs-number">2009</span>,  <span class="hljs-number">2003</span>,  <span class="hljs-number">5094</span>,  <span class="hljs-number">2256</span>,  <span class="hljs-number">2495</span>,  <span class="hljs-number">2291</span>,  <span class="hljs-number">2035</span>,
         <span class="hljs-number">2105</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>],
       [  <span class="hljs-number">101</span>,  <span class="hljs-number">2051</span>,  <span class="hljs-number">1010</span>,  <span class="hljs-number">2029</span>,  <span class="hljs-number">3216</span>,  <span class="hljs-number">2019</span>,  <span class="hljs-number">2503</span>,  <span class="hljs-number">3444</span>,  <span class="hljs-number">1010</span>,
         <span class="hljs-number">6732</span>,  <span class="hljs-number">1996</span>,  <span class="hljs-number">2265</span>,  <span class="hljs-number">2038</span>, <span class="hljs-number">19840</span>,  <span class="hljs-number">2098</span>,  <span class="hljs-number">2125</span>,  <span class="hljs-number">9906</span>,  <span class="hljs-number">1998</span>,
         <span class="hljs-number">2003</span>,  <span class="hljs-number">2770</span>,  <span class="hljs-number">2041</span>,  <span class="hljs-number">1997</span>,  <span class="hljs-number">4784</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,  <span class="hljs-number">2051</span>,  <span class="hljs-number">6732</span>,
         <span class="hljs-number">1996</span>,  <span class="hljs-number">2265</span>,  <span class="hljs-number">2003</span>,  <span class="hljs-number">9525</span>,  <span class="hljs-number">1998</span>,  <span class="hljs-number">4569</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>],
       [  <span class="hljs-number">101</span>,  <span class="hljs-number">1996</span>, <span class="hljs-number">10556</span>,  <span class="hljs-number">2140</span>, <span class="hljs-number">11515</span>,  <span class="hljs-number">2058</span>,  <span class="hljs-number">1010</span>,  <span class="hljs-number">2010</span>,  <span class="hljs-number">2162</span>,
         <span class="hljs-number">2252</span>,  <span class="hljs-number">5689</span>,  <span class="hljs-number">2013</span>,  <span class="hljs-number">2010</span>,  <span class="hljs-number">7223</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,  <span class="hljs-number">2043</span>,  <span class="hljs-number">1996</span>,
        <span class="hljs-number">10556</span>,  <span class="hljs-number">2140</span>, <span class="hljs-number">11515</span>,  <span class="hljs-number">2058</span>,  <span class="hljs-number">1010</span>,  <span class="hljs-number">2010</span>,  <span class="hljs-number">2252</span>,  <span class="hljs-number">3062</span>,  <span class="hljs-number">2000</span>,
         <span class="hljs-number">1996</span>,  <span class="hljs-number">2598</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>],
       [  <span class="hljs-number">101</span>, <span class="hljs-number">13543</span>,  <span class="hljs-number">1999</span>,  <span class="hljs-number">2049</span>,  <span class="hljs-number">6143</span>,  <span class="hljs-number">2933</span>,  <span class="hljs-number">2443</span>,   <span class="hljs-number">102</span>,  <span class="hljs-number">2025</span>,
        <span class="hljs-number">13543</span>,  <span class="hljs-number">1999</span>,  <span class="hljs-number">6143</span>,  <span class="hljs-number">2933</span>,  <span class="hljs-number">2003</span>,  <span class="hljs-number">2443</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,
            <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>]])`}}),pa=new k({props:{code:`labels = batch['labels'].numpy()
labels[indices]`,highlighted:`labels = batch[<span class="hljs-string">&#x27;labels&#x27;</span>].numpy()
labels[indices]`}}),ea=new k({props:{code:"array([2, 2, 2, 2, 2, 2, 2, 2, 2])",highlighted:'array([<span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>])'}}),ra=new k({props:{code:"model.config.num_labels",highlighted:"model.config.num_labels"}}),ta=new k({props:{code:"2",highlighted:'<span class="hljs-number">2</span>'}}),ma=new k({props:{code:`model = TFAutoModelForSequenceClassification.from_pretrained(model_checkpoint, num_labels=3)
model.compile(optimizer='adam')
model.fit(train_dataset)`,highlighted:`model = TFAutoModelForSequenceClassification.from_pretrained(model_checkpoint, <span class="hljs-attribute">num_labels</span>=3)
model.compile(<span class="hljs-attribute">optimizer</span>=<span class="hljs-string">&#x27;adam&#x27;</span>)
model.fit(train_dataset)`}}),ua=new k({props:{code:"  869/24543 [>.............................] - ETA: 15:29 - loss: 1.1032",highlighted:'  <span class="hljs-number">869</span>/<span class="hljs-number">24543</span> [&gt;.............................] - ETA: <span class="hljs-number">15</span>:<span class="hljs-number">29</span> - loss: <span class="hljs-number">1.1032</span>'}}),ba=new k({props:{code:`from tensorflow.keras.optimizers import Adam

model = TFAutoModelForSequenceClassification.from_pretrained(model_checkpoint)
model.compile(optimizer=Adam(5e-5))`,highlighted:`<span class="hljs-keyword">from</span> tensorflow.keras.optimizers <span class="hljs-keyword">import</span> Adam

model = TFAutoModelForSequenceClassification.from_pretrained(model_checkpoint)
model.<span class="hljs-built_in">compile</span>(optimizer=Adam(<span class="hljs-number">5e-5</span>))`}}),Ts=new wl({props:{$$slots:{default:[hc]},$$scope:{ctx:M}}}),ja=new k({props:{code:"model.fit(train_dataset)",highlighted:"model.fit(train_dataset)"}}),oa=new k({props:{code:"319/24543 [..............................] - ETA: 16:07 - loss: 0.9718",highlighted:'<span class="hljs-number">319</span>/<span class="hljs-number">24543</span> [..............................] - ETA: <span class="hljs-number">16</span>:07 - loss: <span class="hljs-number">0.9718</span>'}}),Cs=new wl({props:{$$slots:{default:[bc]},$$scope:{ctx:M}}}),da=new pm({}),$a=new k({props:{code:`input_ids = batch["input_ids"].numpy()
tokenizer.decode(input_ids[0])`,highlighted:`input_ids = batch[<span class="hljs-string">&quot;input_ids&quot;</span>].numpy()
tokenizer.decode(input_ids[<span class="hljs-number">0</span>])`}}),va=new k({props:{code:`labels = batch["labels"].numpy()
label = labels[0]`,highlighted:`labels = batch[<span class="hljs-string">&quot;labels&quot;</span>].numpy()
label = labels[<span class="hljs-number">0</span>]`}}),ya=new k({props:{code:`for batch in train_dataset:
    break

# Make sure you have run model.compile() and set your optimizer,
# and your loss/metrics if you're using them

model.fit(batch, epochs=20)`,highlighted:`<span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> train_dataset:
    <span class="hljs-keyword">break</span>

<span class="hljs-comment"># Make sure you have run model.compile() and set your optimizer,</span>
<span class="hljs-comment"># and your loss/metrics if you&#x27;re using them</span>

model.fit(batch, epochs=<span class="hljs-number">20</span>)`}}),Os=new wl({props:{$$slots:{default:[jc]},$$scope:{ctx:M}}}),qs=new wl({props:{warning:!0,$$slots:{default:[oc]},$$scope:{ctx:M}}}),{c(){b=t("meta"),w=c(),f(j.$$.fragment),E=c(),A=t("h1"),P=t("a"),O=t("span"),f(g.$$.fragment),ss=c(),as=t("span"),Ms=p("Debugging the training pipeline"),I=c(),f(L.$$.fragment),ts=c(),z=t("p"),G=p("\u4F60\u5DF2\u7ECF\u7F16\u5199\u4E86\u4E00\u4E2A\u6F02\u4EAE\u7684\u811A\u672C\u6765\u8BAD\u7EC3\u6216\u5FAE\u8C03\u7ED9\u5B9A\u4EFB\u52A1\u7684\u6A21\u578B\uFF0C\u5C3D\u804C\u5C3D\u8D23\u5730\u9075\u5FAA "),H=t("a"),ns=p("\u7B2C\u4E03\u7AE0"),Gs=p(" \u4E2D\u7684\u5EFA\u8BAE\u3002 \u4F46\u662F\u5F53\u4F60\u542F\u52A8\u547D\u4EE4 "),ls=t("code"),ms=p("model.fit()"),R=p(" \u65F6\uFF0C\u53EF\u6015\u7684\u4E8B\u60C5\u53D1\u751F\u4E86\uFF1A\u4F60\u5F97\u5230\u4E00\u4E2A\u9519\u8BEF\u{1F631}\uFF01 \u6216\u8005\u66F4\u7CDF\u7CD5\u7684\u662F\uFF0C\u4E00\u5207\u4F3C\u4E4E\u90FD\u5F88\u597D\uFF0C\u8BAD\u7EC3\u8FD0\u884C\u6CA1\u6709\u9519\u8BEF\uFF0C\u4F46\u751F\u6210\u7684\u6A21\u578B\u5F88\u7CDF\u7CD5\u3002 \u5728\u672C\u8282\u4E2D\uFF0C\u6211\u4EEC\u5C06\u5411\u60A8\u5C55\u793A\u5982\u4F55\u8C03\u8BD5\u6B64\u7C7B\u95EE\u9898\u3002"),us=c(),y=t("h2"),T=t("a"),cs=t("span"),f(V.$$.fragment),ga=c(),hs=t("span"),bs=p("Debugging the training pipeline"),xs=c(),f(X.$$.fragment),kl=c(),js=t("p"),ze=p("The problem when you encounter an error in "),$n=t("code"),ge=p("model.fit()"),Fe=p(" is that it could come from multiple sources, as training usually brings together a lot of things that you\u2019ve been working on up until that point. The problem could be something wrong in your dataset, or some issue when trying to batch elements of the datasets together. Or it could be something wrong in the model code, or your loss function or optimizer. And even if everything goes well for training, something could still go wrong during the evaluation if there is a problem with your metric."),Tl=c(),os=t("p"),Se=p("The best way to debug an error that arises in "),vn=t("code"),Me=p("model.fit()"),Ge=p(" is to manually go through this whole pipeline to see where things went awry. The error is then often very easy to solve."),Pl=c(),fs=t("p"),xe=p("To demonstrate this, we will use the following script that (tries to) fine-tune a DistilBERT model on the "),Ns=t("a"),Ne=p("MNLI dataset"),Ke=p(":"),Cl=c(),is=t("p"),Le=p("\u5F53\u60A8\u5728 "),En=t("code"),Ue=p("model.fit()"),Be=p(" \u4E2D\u9047\u5230\u9519\u8BEF\u65F6\uFF0C\u95EE\u9898\u5728\u4E8E\u5B83\u53EF\u80FD\u6765\u81EA\u591A\u4E2A\u6765\u6E90\uFF0C\u56E0\u4E3A\u8BAD\u7EC3\u901A\u5E38\u4F1A\u6C47\u96C6\u5F88\u591A\u60A8\u5728\u6B64\u4E4B\u524D\u4E00\u76F4\u5728\u505A\u7684\u4E8B\u60C5\u3002 \u95EE\u9898\u53EF\u80FD\u662F\u60A8\u7684\u6570\u636E\u96C6\u4E2D\u6709\u95EE\u9898\uFF0C\u6216\u8005\u662F\u5728\u5C1D\u8BD5\u5C06\u6570\u636E\u96C6\u7684\u5143\u7D20\u6279\u5904\u7406\u5728\u4E00\u8D77\u65F6\u51FA\u73B0\u95EE\u9898\u3002 \u6216\u8005\u6A21\u578B\u4EE3\u7801\u3001\u635F\u5931\u51FD\u6570\u6216\u4F18\u5316\u5668\u4E2D\u53EF\u80FD\u6709\u95EE\u9898\u3002 \u5373\u4F7F\u8BAD\u7EC3\u4E00\u5207\u987A\u5229\uFF0C\u5982\u679C\u60A8\u7684\u6307\u6807\u6709\u95EE\u9898\uFF0C\u8BC4\u4F30\u671F\u95F4\u4ECD\u7136\u53EF\u80FD\u51FA\u73B0\u95EE\u9898\u3002"),Dl=c(),ds=t("p"),Ie=p("\u8C03\u8BD5 "),yn=t("code"),He=p("model.fit()"),Re=p(" \u4E2D\u51FA\u73B0\u7684\u9519\u8BEF\u7684\u6700\u4F73\u65B9\u6CD5\u662F\u624B\u52A8\u68C0\u67E5\u6574\u4E2A\u7BA1\u9053\uFF0C\u770B\u770B\u54EA\u91CC\u51FA\u4E86\u95EE\u9898\u3002 \u9519\u8BEF\u901A\u5E38\u5F88\u5BB9\u6613\u89E3\u51B3\u3002"),Al=c(),_s=t("p"),Ve=p("\u4E3A\u4E86\u8BC1\u660E\u8FD9\u4E00\u70B9\uFF0C\u6211\u4EEC\u5C06\u4F7F\u7528\u4EE5\u4E0B\u811A\u672C\uFF08\u5C1D\u8BD5\uFF09\u5728 "),Ks=t("a"),Xe=p("MNLI \u6570\u636E\u96C6"),Je=p("\u4E0A\u5FAE\u8C03 DistilBERT \u6A21\u578B\uFF1A"),Ol=c(),f(Ls.$$.fragment),ql=c(),Fa=t("p"),We=p("\u5982\u679C\u60A8\u5C1D\u8BD5\u6267\u884C\u5B83\uFF0C\u5728\u8FDB\u884C\u6570\u636E\u96C6\u8F6C\u6362\u65F6\u53EF\u80FD\u4F1A\u6536\u5230\u4E00\u4E9B\u201CVisibleDeprecationWarning\u201D\u2014\u2014\u8FD9\u662F\u6211\u4EEC\u5DF2\u77E5\u7684 UX \u95EE\u9898\uFF0C\u56E0\u6B64\u8BF7\u5FFD\u7565\u5B83\u3002 \u5982\u679C\u4F60\u5728 2021 \u5E74 11 \u6708\u4E4B\u540E\u9605\u8BFB\u8FD9\u95E8\u8BFE\u7A0B\u5E76\u4E14\u5B83\u4ECD\u5728\u7EE7\u7EED\uFF0C\u90A3\u4E48\u8BF7\u5728\u63A8\u7279\u4E0A @carrigmat \u4E0A\u53D1\u9001\u6124\u6012\u7684\u63A8\u6587\uFF0C\u76F4\u5230\u4ED6\u4FEE\u590D\u5B83\u3002"),zl=c(),Sa=t("p"),Ye=p("\u7136\u800C\uFF0C\u66F4\u4E25\u91CD\u7684\u95EE\u9898\u662F\u6211\u4EEC\u5F97\u5230\u4E86\u4E00\u4E2A\u5F7B\u5E95\u7684\u9519\u8BEF\u3002 \u5B83\u771F\u7684\u975E\u5E38\u957F\uFF1A"),gl=c(),f(Us.$$.fragment),Fl=c(),Ma=t("p"),Ze=p("\u8FD9\u610F\u5473\u7740\u4EC0\u4E48\uFF1F \u6211\u4EEC\u8BD5\u56FE\u8BAD\u7EC3\u6211\u4EEC\u7684\u6570\u636E\uFF0C\u4F46\u6211\u4EEC\u6CA1\u6709\u68AF\u5EA6\uFF1F \u8FD9\u5F88\u4EE4\u4EBA\u56F0\u60D1\u3002 \u6211\u4EEC\u751A\u81F3\u4E0D\u77E5\u9053\u8BE5\u5982\u4F55\u5F00\u59CB\u8C03\u8BD5\u7C7B\u4F3C\u7684\u4E1C\u897F\uFF1F \u5F53\u4F60\u5F97\u5230\u7684\u9519\u8BEF\u5E76\u4E0D\u80FD\u7ACB\u5373\u8868\u660E\u95EE\u9898\u51FA\u5728\u54EA\u91CC\u65F6\uFF0C\u6700\u597D\u7684\u89E3\u51B3\u65B9\u6848\u901A\u5E38\u662F\u6309\u987A\u5E8F\u68C0\u67E5\u6240\u6709\u5185\u5BB9\uFF0C\u786E\u4FDD\u5728\u6BCF\u4E2A\u9636\u6BB5\u4E00\u5207\u770B\u8D77\u6765\u90FD\u662F\u6B63\u786E\u7684\u3002 \u5F53\u7136\uFF0C\u5F00\u59CB\u7684\u5730\u65B9\u603B\u662F\u2026"),Sl=c(),Bs=t("h3"),Qe=p("\u68C0\u67E5\u60A8\u7684\u6570\u636E"),Ml=c(),Ga=t("p"),s0=p("\u8FD9\u662F\u4E0D\u8A00\u800C\u55BB\u7684\uFF0C\u4F46\u5982\u679C\u60A8\u7684\u6570\u636E\u5DF2\u635F\u574F\uFF0CKeras \u5C06\u65E0\u6CD5\u4E3A\u60A8\u4FEE\u590D\u5B83\u3002 \u6240\u4EE5\u9996\u5148\uFF0C\u4F60\u9700\u8981\u770B\u770B\u4F60\u7684\u8BAD\u7EC3\u96C6\u4E2D\u6709\u4EC0\u4E48\u3002"),Gl=c(),D=t("p"),a0=p("\u5C3D\u7BA1\u67E5\u770B "),wn=t("code"),n0=p("raw_datasets"),l0=p(" \u548C "),kn=t("code"),p0=p("tokenized_datasets"),e0=p(" \u5F88\u8BF1\u4EBA\uFF0C\u4F46\u6211\u4EEC\u5F3A\u70C8\u5EFA\u8BAE\u60A8\u5728\u6570\u636E\u5C06\u8981\u8FDB\u5165\u6A21\u578B\u7684\u5730\u65B9\u76F4\u63A5\u67E5\u770B\u6570\u636E\u3002 \u8FD9\u610F\u5473\u7740\u5E94\u8BE5\u4ECE\u60A8\u4F7F\u7528 "),Tn=t("code"),r0=p("to_tf_dataset()"),t0=p(" \u51FD\u6570\u521B\u5EFA\u7684 "),Pn=t("code"),m0=p("tf.data.Dataset"),u0=p(" \u8BFB\u53D6\u8F93\u51FA\uFF01 \u90A3\u4E48\u6211\u4EEC\u8BE5\u600E\u4E48\u505A\u5462\uFF1F "),Cn=t("code"),c0=p("tf.data.Dataset"),h0=p(" \u5BF9\u8C61\u4E00\u6B21\u7ED9\u6211\u4EEC\u6574\u4E2A\u6279\u6B21\u5E76\u4E14\u4E0D\u652F\u6301\u7D22\u5F15\uFF0C\u6240\u4EE5\u6211\u4EEC\u4E0D\u80FD\u53EA\u8BF7\u6C42 "),Dn=t("code"),b0=p("train_dataset[0]"),j0=p("\u3002 \u4F46\u662F\uFF0C\u6211\u4EEC\u53EF\u4EE5\u793C\u8C8C\u5730\u5411\u5B83\u8981\u4E00\u6279\uFF1A"),xl=c(),f(Is.$$.fragment),Nl=c(),U=t("p"),An=t("code"),o0=p("break"),f0=p(" \u5728\u4E00\u6B21\u8FED\u4EE3\u540E\u7ED3\u675F\u5FAA\u73AF\uFF0C\u56E0\u6B64\u8FD9\u4F1A\u6293\u53D6\u6765\u81EA"),On=t("code"),i0=p("train_dataset"),d0=p(" \u7684\u7B2C\u4E00\u6279\u5E76\u5C06\u5176\u4FDD\u5B58\u4E3A"),qn=t("code"),_0=p("batch"),$0=p("\u3002 \u73B0\u5728\uFF0C\u8BA9\u6211\u4EEC\u770B\u770B\u91CC\u9762\u6709\u4EC0\u4E48\uFF1A"),Kl=c(),f(Hs.$$.fragment),Ll=c(),x=t("p"),v0=p("\u8FD9\u770B\u8D77\u6765\u4E0D\u9519\uFF0C\u4E0D\u662F\u5417\uFF1F\u6211\u4EEC\u5C06 "),zn=t("code"),E0=p("labels"),y0=p(" \u3001"),gn=t("code"),w0=p("attention_mask"),k0=p(" \u548C "),Fn=t("code"),T0=p("input_ids"),P0=p(" \u4F20\u9012\u7ED9\u6A21\u578B\uFF0C\u8FD9\u5E94\u8BE5\u662F\u8BA1\u7B97\u8F93\u51FA\u548C\u8BA1\u7B97\u635F\u5931\u6240\u9700\u7684\u4E00\u5207\u3002\u90A3\u4E48\u4E3A\u4EC0\u4E48\u6211\u4EEC\u6CA1\u6709\u68AF\u5EA6\u5462\uFF1F\u4ED4\u7EC6\u770B\uFF1A\u6211\u4EEC\u5C06\u5355\u4E2A\u5B57\u5178\u4F5C\u4E3A\u8F93\u5165\u4F20\u9012\uFF0C\u4F46\u8BAD\u7EC3\u6279\u6B21\u901A\u5E38\u662F\u8F93\u5165\u5F20\u91CF\u6216\u5B57\u5178\uFF0C\u52A0\u4E0A\u6807\u7B7E\u5F20\u91CF\u3002\u6211\u4EEC\u7684\u6807\u7B7E\u53EA\u662F\u6211\u4EEC\u8F93\u5165\u5B57\u5178\u4E2D\u7684\u4E00\u4E2A\u952E\u3002"),Ul=c(),$s=t("p"),C0=p("\u8FD9\u662F\u4E00\u4E2A\u95EE\u9898\u5417\uFF1F\u5B9E\u9645\u4E0A\uFF0C\u5E76\u975E\u603B\u662F\u5982\u6B64\uFF01\u4F46\u8FD9\u662F\u60A8\u5728\u4F7F\u7528 TensorFlow \u8BAD\u7EC3 Transformer \u6A21\u578B\u65F6\u4F1A\u9047\u5230\u7684\u6700\u5E38\u89C1\u95EE\u9898\u4E4B\u4E00\u3002\u6211\u4EEC\u7684\u6A21\u578B\u90FD\u53EF\u4EE5\u5728\u5185\u90E8\u8BA1\u7B97\u635F\u5931\uFF0C\u4F46\u8981\u505A\u5230\u8FD9\u4E00\u70B9\uFF0C\u9700\u8981\u5728\u8F93\u5165\u5B57\u5178\u4E2D\u4F20\u9012\u6807\u7B7E\u3002\u8FD9\u662F\u5F53\u6211\u4EEC\u6CA1\u6709\u4E3A "),Sn=t("code"),D0=p("compile()"),A0=p(" \u6307\u5B9A\u635F\u5931\u503C\u65F6\u4F7F\u7528\u7684\u635F\u5931\u3002\u53E6\u4E00\u65B9\u9762\uFF0CKeras \u901A\u5E38\u5E0C\u671B\u6807\u7B7E\u4E0E\u8F93\u5165\u5B57\u5178\u5206\u5F00\u4F20\u9012\uFF0C\u5982\u679C\u4F60\u4E0D\u8FD9\u6837\u505A\uFF0C\u635F\u5931\u8BA1\u7B97\u901A\u5E38\u4F1A\u5931\u8D25\u3002"),Bl=c(),vs=t("p"),O0=p("\u95EE\u9898\u73B0\u5728\u53D8\u5F97\u66F4\u6E05\u695A\u4E86\uFF1A\u6211\u4EEC\u4F20\u9012\u4E86\u4E00\u4E2A\u201C\u635F\u5931\u201D\u53C2\u6570\uFF0C\u8FD9\u610F\u5473\u7740\u6211\u4EEC\u8981\u6C42 Keras \u4E3A\u6211\u4EEC\u8BA1\u7B97\u635F\u5931\uFF0C\u4F46\u6211\u4EEC\u5C06\u6807\u7B7E\u4F5C\u4E3A\u6A21\u578B\u7684\u8F93\u5165\u4F20\u9012\uFF0C\u800C\u4E0D\u662F\u653E\u5728 Keras \u671F\u671B\u7684\u5730\u65B9\u7684\uFF01\u6211\u4EEC\u9700\u8981\u4E8C\u9009\u4E00\uFF1A\u8981\u4E48\u4F7F\u7528\u6A21\u578B\u7684\u5185\u90E8\u635F\u5931\u5E76\u5C06\u6807\u7B7E\u4FDD\u7559\u5728\u539F\u5904\uFF0C\u8981\u4E48\u7EE7\u7EED\u4F7F\u7528 Keras \u635F\u5931\uFF0C\u4F46\u5C06\u6807\u7B7E\u79FB\u52A8\u5230 Keras \u671F\u671B\u7684\u4F4D\u7F6E\u3002\u4E3A\u7B80\u5355\u8D77\u89C1\uFF0C\u8BA9\u6211\u4EEC\u91C7\u7528\u7B2C\u4E00\u79CD\u65B9\u6CD5\u3002\u5C06\u5BF9 "),Mn=t("code"),q0=p("compile()"),z0=p(" \u7684\u8C03\u7528\u66F4\u6539\u4E3A\uFF1A"),Il=c(),f(Rs.$$.fragment),Hl=c(),xa=t("p"),g0=p("\u73B0\u5728\u6211\u4EEC\u5C06\u4F7F\u7528\u6A21\u578B\u7684\u5185\u90E8\u635F\u5931\uFF0C\u8FD9\u4E2A\u95EE\u9898\u5E94\u8BE5\u89E3\u51B3\u4E86\uFF01"),Rl=c(),f(Es.$$.fragment),Vl=c(),ys=t("p"),F0=p("\u73B0\u5728\uFF0C\u8BA9\u6211\u4EEC\u5C1D\u8BD5\u8BAD\u7EC3\u3002 \u6211\u4EEC\u73B0\u5728\u5E94\u8BE5\u5F97\u5230\u68AF\u5EA6\uFF0C\u6240\u4EE5\u5E0C\u671B\uFF08\u8FD9\u91CC\u64AD\u653E\u4E0D\u7965\u7684\u97F3\u4E50\uFF09\u6211\u4EEC\u53EF\u4EE5\u8C03\u7528 "),Gn=t("code"),S0=p("model.fit()"),M0=p(" \u4E00\u5207\u90FD\u4F1A\u6B63\u5E38\u5DE5\u4F5C\uFF01"),Xl=c(),f(Vs.$$.fragment),Jl=c(),Na=t("p"),G0=p("Oh no."),Wl=c(),Xs=t("p"),xn=t("code"),x0=p("nan"),N0=p(" \u4E0D\u662F\u4E00\u4E2A\u975E\u5E38\u4EE4\u4EBA\u5F00\u5FC3\u7684\u635F\u5931\u503C\u3002 \u5C3D\u7BA1\u5982\u6B64\uFF0C\u6211\u4EEC\u5DF2\u7ECF\u68C0\u67E5\u4E86\u6211\u4EEC\u7684\u6570\u636E\uFF0C\u5B83\u770B\u8D77\u6765\u8FD8\u4E0D\u9519\u3002 \u5982\u679C\u8FD9\u4E0D\u662F\u95EE\u9898\uFF0C\u6211\u4EEC\u4E0B\u4E00\u6B65\u8BE5\u53BB\u54EA\u91CC\uFF1F \u663E\u800C\u6613\u89C1\u7684\u4E0B\u4E00\u6B65\u662F\u2026"),Yl=c(),Js=t("h3"),K0=p("\u68C0\u67E5\u4F60\u7684\u6A21\u578B"),Zl=c(),B=t("p"),Nn=t("code"),L0=p("model.fit()"),U0=p(" \u662F Keras \u4E2D\u4E00\u4E2A\u975E\u5E38\u65B9\u4FBF\u7684\u51FD\u6570\uFF0C\u4F46\u5B83\u4E3A\u60A8\u505A\u4E86\u5F88\u591A\u4E8B\u60C5\uFF0C\u8FD9\u4F7F\u5F97\u51C6\u786E\u627E\u5230\u95EE\u9898\u53D1\u751F\u7684\u4F4D\u7F6E\u53D8\u5F97\u66F4\u52A0\u68D8\u624B\u3002 \u5982\u679C\u60A8\u6B63\u5728\u8C03\u8BD5\u60A8\u7684\u6A21\u578B\uFF0C\u4E00\u4E2A\u771F\u6B63\u6709\u7528\u7684\u7B56\u7565\u662F\u53EA\u5C06\u4E00\u4E2A\u6279\u6B21\u4F20\u9012\u7ED9\u6A21\u578B\uFF0C\u5E76\u8BE6\u7EC6\u67E5\u770B\u8BE5\u6279\u6B21\u7684\u8F93\u51FA\u3002 \u5982\u679C\u6A21\u578B\u629B\u51FA\u9519\u8BEF\uFF0C\u53E6\u4E00\u4E2A\u975E\u5E38\u6709\u7528\u7684\u63D0\u793A\u662F\u4F7F\u7528 "),Kn=t("code"),B0=p("run_eagerly=True"),I0=c(),Ln=t("code"),H0=p("compile()"),R0=p(" \u6A21\u578B\u3002 \u8FD9\u4F1A\u4F7F\u5B83\u53D8\u6162\u5F88\u591A\uFF0C\u4F46\u5B83\u4F1A\u4F7F\u9519\u8BEF\u6D88\u606F\u66F4\u5BB9\u6613\u7406\u89E3\uFF0C\u56E0\u4E3A\u5B83\u4EEC\u4F1A\u51C6\u786E\u5730\u6307\u51FA\u95EE\u9898\u53D1\u751F\u5728\u6A21\u578B\u4EE3\u7801\u7684\u54EA\u4E2A\u4F4D\u7F6E\u3002"),Ql=c(),ws=t("p"),V0=p("\u4E0D\u8FC7\uFF0C\u76EE\u524D\u6211\u4EEC\u8FD8\u4E0D\u9700\u8981 "),Un=t("code"),X0=p("run_eagerly"),J0=p("\u3002 \u8BA9\u6211\u4EEC\u901A\u8FC7\u6A21\u578B\u8FD0\u884C\u6211\u4EEC\u4E4B\u524D\u5F97\u5230\u7684\u201C\u6279\u5904\u7406\u201D\uFF0C\u770B\u770B\u8F93\u51FA\u662F\u4EC0\u4E48\u6837\u5B50\u7684\uFF1A"),sp=c(),f(Ws.$$.fragment),ap=c(),f(Ys.$$.fragment),np=c(),C=t("p"),W0=p("\u55EF\uFF0C\u8FD9\u5F88\u68D8\u624B\u3002\u4E00\u5207\u90FD\u662F"),Bn=t("code"),Y0=p("nan"),Z0=p("\uFF01\u4F46\u8FD9\u5F88\u5947\u602A\uFF0C\u4E0D\u662F\u5417\uFF1F\u6211\u4EEC\u6240\u6709\u7684 logits \u600E\u4E48\u4F1A\u53D8\u6210\u201Cnan\u201D\uFF1F "),In=t("code"),Q0=p("nan"),sr=p(" \u7684\u610F\u601D\u662F\u201C\u4E0D\u662F\u6570\u5B57\u201D\u3002 "),Hn=t("code"),ar=p("nan"),nr=p(" \u503C\u7ECF\u5E38\u51FA\u73B0\u5728\u60A8\u6267\u884C\u7981\u6B62\u64CD\u4F5C\u65F6\uFF0C\u4F8B\u5982\u9664\u4EE5\u96F6\u3002\u4F46\u662F\uFF0C\u5728\u673A\u5668\u5B66\u4E60\u4E2D\u4E86\u89E3 "),Rn=t("code"),lr=p("nan"),pr=p(" \u975E\u5E38\u91CD\u8981\u7684\u4E00\u4EF6\u4E8B\u662F\uFF0C\u8BE5\u503C\u503E\u5411\u4E8E"),Vn=t("em"),er=p("\u4F20\u64AD"),rr=p("\u3002\u5982\u679C\u5C06\u4E00\u4E2A\u6570\u5B57\u4E58\u4EE5 "),Xn=t("code"),tr=p("nan"),mr=p("\uFF0C\u5219\u8F93\u51FA\u4E5F\u662F "),Jn=t("code"),ur=p("nan"),cr=p("\u3002\u5982\u679C\u4F60\u5728\u8F93\u51FA\u3001\u635F\u5931\u6216\u68AF\u5EA6\u7684\u4EFB\u4F55\u5730\u65B9\u5F97\u5230\u4E00\u4E2A\u201Cnan\u201D\uFF0C\u90A3\u4E48\u5B83\u4F1A\u8FC5\u901F\u4F20\u64AD\u5230\u4F60\u7684\u6574\u4E2A\u6A21\u578B\u4E2D\u2014\u2014\u56E0\u4E3A\u5F53\u90A3\u4E2A\u201Cnan\u201D\u503C\u901A\u8FC7\u4F60\u7684\u7F51\u7EDC\u4F20\u64AD\u56DE\u6765\u65F6\uFF0C\u4F60\u4F1A\u5F97\u5230nan \u68AF\u5EA6\uFF0C\u5F53\u4F7F\u7528\u8FD9\u4E9B\u68AF\u5EA6\u8BA1\u7B97\u6743\u91CD\u66F4\u65B0\u65F6\uFF0C\u60A8\u5C06\u83B7\u5F97 nan \u6743\u91CD\uFF0C\u8FD9\u4E9B\u6743\u91CD\u5C06\u8BA1\u7B97\u66F4\u591A\u7684 nan \u8F93\u51FA\uFF01\u5F88\u5FEB\uFF0C\u6574\u4E2A\u7F51\u7EDC\u5C06\u53EA\u662F\u201Cnan\u201D\u7684\u4E00\u5927\u5757\u3002\u4E00\u65E6\u53D1\u751F\u8FD9\u79CD\u60C5\u51B5\uFF0C\u5C31\u5F88\u96BE\u770B\u51FA\u95EE\u9898\u662F\u4ECE\u54EA\u91CC\u5F00\u59CB\u7684\u3002\u6211\u4EEC\u5982\u4F55\u9694\u79BB\u201Cnan\u201D\u7B2C\u4E00\u6B21\u51FA\u73B0\u7684\u5730\u65B9\uFF1F"),lp=c(),J=t("p"),hr=p("\u7B54\u6848\u662F\u5C1D\u8BD5"),Wn=t("em"),br=p("\u91CD\u65B0\u521D\u59CB\u5316"),jr=p("\u6211\u4EEC\u7684\u6A21\u578B\u3002\u4E00\u65E6\u6211\u4EEC\u5F00\u59CB\u8BAD\u7EC3\uFF0C\u6211\u4EEC\u5C31\u4F1A\u5728\u67D0\u4E2A\u5730\u65B9\u5F97\u5230\u4E00\u4E2A\u201Cnan\u201D\uFF0C\u5B83\u5F88\u5FEB\u5C31\u4F1A\u4F20\u64AD\u5230\u6574\u4E2A\u6A21\u578B\u4E2D\u3002\u6240\u4EE5\uFF0C\u8BA9\u6211\u4EEC\u4ECE\u68C0\u67E5\u70B9\u52A0\u8F7D\u6A21\u578B\u800C\u4E0D\u505A\u4EFB\u4F55\u6743\u91CD\u66F4\u65B0\uFF0C\u770B\u770B\u6211\u4EEC\u4ECE\u54EA\u91CC\u5F97\u5230\u4E00\u4E2A "),Yn=t("code"),or=p("nan"),fr=p(" \u503C\uFF1A"),pp=c(),f(Zs.$$.fragment),ep=c(),Ka=t("p"),ir=p("\u5F53\u6211\u4EEC\u8FD0\u884C\u5B83\u65F6\uFF0C\u6211\u4EEC\u5F97\u5230\uFF1A"),rp=c(),f(Qs.$$.fragment),tp=c(),ps=t("p"),Zn=t("em"),dr=p("\u73B0\u5728"),_r=p("\u6211\u4EEC\u5230\u4E86\u67D0\u4E2A\u5730\u65B9\uFF01 \u6211\u4EEC\u7684 logits \u4E2D\u6CA1\u6709 "),Qn=t("code"),$r=p("nan"),vr=p(" \u503C\uFF0C\u8FD9\u4EE4\u4EBA\u653E\u5FC3\u3002 \u4F46\u662F\u6211\u4EEC\u786E\u5B9E\u5728\u635F\u5931\u4E2D\u770B\u5230\u4E86\u4E00\u4E9B\u201Cnan\u201D\u503C\uFF01 \u8FD9\u4E9B\u6837\u672C\u6709\u4EC0\u4E48\u7279\u522B\u5BFC\u81F4\u8FD9\u4E2A\u95EE\u9898\u7684\u5417\uFF1F \u8BA9\u6211\u4EEC\u770B\u770B\u5B83\u4EEC\u662F\u54EA\u4E9B\uFF08\u8BF7\u6CE8\u610F\uFF0C\u5982\u679C\u60A8\u81EA\u5DF1\u8FD0\u884C\u6B64\u4EE3\u7801\uFF0C\u60A8\u53EF\u80FD\u4F1A\u5F97\u5230\u4E0D\u540C\u7684\u7D22\u5F15\uFF0C\u56E0\u4E3A\u6570\u636E\u96C6\u5DF2\u88AB\u968F\u673A\u6253\u4E71\uFF09\uFF1A"),mp=c(),f(sa.$$.fragment),up=c(),f(aa.$$.fragment),cp=c(),La=t("p"),Er=p("\u8BA9\u6211\u4EEC\u770B\u770B\u8FD9\u4E9B\u6765\u81EA\u6837\u672C\u7684\u8F93\u5165id\uFF1A"),hp=c(),f(na.$$.fragment),bp=c(),f(la.$$.fragment),jp=c(),Ua=t("p"),yr=p("\u55EF\uFF0C\u8FD9\u91CC\u6709\u5F88\u591A\u4E1C\u897F\uFF0C\u4F46\u6CA1\u6709\u4EC0\u4E48\u4E0D\u5BFB\u5E38\u7684\u3002 \u8BA9\u6211\u4EEC\u770B\u770B\u6807\u7B7E\uFF1A"),op=c(),f(pa.$$.fragment),fp=c(),f(ea.$$.fragment),ip=c(),W=t("p"),wr=p("\u554A! "),sl=t("code"),kr=p("nan"),Tr=p(" \u6837\u672C\u90FD\u5177\u6709\u76F8\u540C\u7684\u6807\u7B7E\uFF0C\u5373\u6807\u7B7E 2\u3002\u8FD9\u662F\u4E00\u4E2A\u975E\u5E38\u660E\u663E\u7684\u63D0\u793A\u3002 \u5F53\u6211\u4EEC\u7684\u6807\u7B7E\u4E3A 2 \u65F6\uFF0C\u6211\u4EEC\u4F1A\u5F97\u5230loss\u4E3A "),al=t("code"),Pr=p("nan"),Cr=p("\uFF0C\u8FD9\u8868\u660E\u8FD9\u662F\u68C0\u67E5\u6A21\u578B\u4E2D\u6807\u7B7E\u6570\u91CF\u7684\u597D\u65F6\u673A\uFF1A"),dp=c(),f(ra.$$.fragment),_p=c(),f(ta.$$.fragment),$p=c(),Ba=t("p"),Dr=p("\u73B0\u5728\u6211\u4EEC\u770B\u5230\u4E86\u95EE\u9898\uFF1A\u6A21\u578B\u8BA4\u4E3A\u53EA\u6709\u4E24\u4E2A\u7C7B\uFF0C\u4F46\u6807\u7B7E\u4E0A\u5347\u5230 2\uFF0C\u8FD9\u610F\u5473\u7740\u5B9E\u9645\u4E0A\u6709\u4E09\u4E2A\u7C7B\uFF08\u56E0\u4E3A 0 \u4E5F\u662F\u4E00\u4E2A\u7C7B\uFF09\u3002 \u8FD9\u5C31\u662F\u6211\u4EEC\u5F97\u5230\u201Cnan\u201D\u7684\u65B9\u5F0F\u2014\u2014\u901A\u8FC7\u5C1D\u8BD5\u8BA1\u7B97\u4E0D\u5B58\u5728\u7684\u7C7B\u7684\u635F\u5931\uFF01 \u8BA9\u6211\u4EEC\u5C1D\u8BD5\u6539\u53D8\u5B83\u5E76\u518D\u6B21\u62DF\u5408\u6A21\u578B\uFF1A"),vp=c(),f(ma.$$.fragment),Ep=c(),f(ua.$$.fragment),yp=c(),Ia=t("p"),Ar=p("\u6211\u4EEC\u5728\u8BAD\u7EC3\uFF01 \u6CA1\u6709\u66F4\u591A\u7684\u2019nan\u2019s\uFF0C\u6211\u4EEC\u7684\u635F\u5931\u6B63\u5728\u51CF\u5C11\u2026\u6709\u70B9\u3002 \u5982\u679C\u4F60\u89C2\u5BDF\u4E00\u6BB5\u65F6\u95F4\uFF0C\u4F60\u53EF\u80FD\u4F1A\u5F00\u59CB\u6709\u70B9\u4E0D\u8010\u70E6\uFF0C\u56E0\u4E3A\u635F\u5931\u503C\u4E00\u76F4\u5C45\u9AD8\u4E0D\u4E0B\u3002 \u8BA9\u6211\u4EEC\u5728\u8FD9\u91CC\u505C\u6B62\u8BAD\u7EC3\u5E76\u5C1D\u8BD5\u8003\u8651\u53EF\u80FD\u5BFC\u81F4\u6B64\u95EE\u9898\u7684\u539F\u56E0\u3002 \u5728\u8FD9\u4E00\u70B9\u4E0A\uFF0C\u6211\u4EEC\u5F88\u786E\u5B9A\u6570\u636E\u548C\u6A21\u578B\u90FD\u6CA1\u6709\u95EE\u9898\uFF0C\u4F46\u662F\u6211\u4EEC\u7684\u6A21\u578B\u5E76\u6CA1\u6709\u5F88\u597D\u5730\u5B66\u4E60\u3002 \u8FD8\u5269\u4E0B\u4EC0\u4E48\uFF1F \u662F\u65F6\u5019\u2026"),wp=c(),ca=t("h3"),Or=p("\u68C0\u67E5\u4F60\u7684\u8D85\u53C2\u6570"),kp=c(),Y=t("p"),qr=p("\u5982\u679C\u4F60\u56DE\u5934\u770B\u4E0A\u9762\u7684\u4EE3\u7801\uFF0C\u4F60\u53EF\u80FD\u6839\u672C\u770B\u4E0D\u5230\u4EFB\u4F55\u8D85\u53C2\u6570\uFF0C\u9664\u4E86 "),nl=t("code"),zr=p("batch_size"),gr=p("\uFF0C\u8FD9\u4F3C\u4E4E\u4E0D\u662F\u7F6A\u9B41\u7978\u9996\u3002\u4E0D\u8FC7\uFF0C\u4E0D\u8981\u88AB\u8FF7\u60D1\uFF1B\u603B\u662F\u6709\u8D85\u53C2\u6570\uFF0C\u5982\u679C\u4F60\u770B\u4E0D\u5230\u5B83\u4EEC\uFF0C\u90A3\u53EA\u662F\u610F\u5473\u7740\u4F60\u4E0D\u77E5\u9053\u5B83\u4EEC\u7684\u8BBE\u7F6E\u662F\u4EC0\u4E48\u3002\u7279\u522B\u8981\u8BB0\u4F4F\u5173\u4E8E Keras \u7684\u4E00\u4E2A\u5173\u952E\u70B9\uFF1A\u5982\u679C\u60A8\u4F7F\u7528\u5B57\u7B26\u4E32\u8BBE\u7F6E\u635F\u5931\u51FD\u6570\u3001\u4F18\u5316\u5668\u6216\u6FC0\u6D3B\u51FD\u6570\uFF0C"),ll=t("em"),Fr=p("\u5B83\u7684\u6240\u6709\u53C2\u6570\u90FD\u5C06\u8BBE\u7F6E\u4E3A\u5B83\u4EEC\u7684\u9ED8\u8BA4\u503C"),Sr=p("\u3002\u8FD9\u610F\u5473\u7740\u5373\u4F7F\u4E3A\u6B64\u4F7F\u7528\u5B57\u7B26\u4E32\u975E\u5E38\u65B9\u4FBF\uFF0C\u4F46\u5728\u8FD9\u6837\u505A\u65F6\u60A8\u5E94\u8BE5\u975E\u5E38\u5C0F\u5FC3\uFF0C\u56E0\u4E3A\u5B83\u5F88\u5BB9\u6613\u5BF9\u60A8\u9690\u85CF\u5173\u952E\u7684\u4E8B\u60C5\u3002 \uFF08\u4EFB\u4F55\u5C1D\u8BD5\u4E0A\u8FF0\u65B9\u5F0F\u7684\u4EBA\u90FD\u5E94\u8BE5\u4ED4\u7EC6\u6CE8\u610F\u8FD9\u4E00\u4E8B\u5B9E\u3002\uFF09"),Tp=c(),ks=t("p"),Mr=p("\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\uFF0C\u6211\u4EEC\u5728\u54EA\u91CC\u8BBE\u7F6E\u4E86\u5E26\u6709\u5B57\u7B26\u4E32\u7684\u53C2\u6570\uFF1F\u6211\u4EEC\u6700\u521D\u4F7F\u7528\u5B57\u7B26\u4E32\u8BBE\u7F6E\u635F\u5931\uFF0C\u4F46\u6211\u4EEC\u4E0D\u518D\u8FD9\u6837\u505A\u4E86\u3002\u4F46\u662F\uFF0C\u6211\u4EEC\u6B63\u5728\u4F7F\u7528\u5B57\u7B26\u4E32\u8BBE\u7F6E\u4F18\u5316\u5668\u3002\u96BE\u9053\u8FD9\u5BF9\u6211\u4EEC\u9690\u7792\u4E86\u4EC0\u4E48\uFF1F\u8BA9\u6211\u4EEC\u770B\u770B"),ha=t("a"),Gr=p("\u5173\u4E8E\u5B83\u7684\u4E00\u4E9B\u8BA8\u8BBA"),xr=p("\u3002"),Pp=c(),Ha=t("p"),Nr=p("\u8FD9\u91CC\u6709\u4EC0\u4E48\u9700\u8981\u6CE8\u610F\u7684\u5417\uFF1F\u6CA1\u9519\u2014\u2014\u5B66\u4E60\u7387\uFF01\u5F53\u6211\u4EEC\u53EA\u4F7F\u7528\u5B57\u7B26\u4E32\u201Cadam\u201D\u65F6\uFF0C\u6211\u4EEC\u5C06\u83B7\u5F97\u9ED8\u8BA4\u7684\u5B66\u4E60\u7387\uFF0C\u5373 0.001\uFF0C\u5373 1e-3\u3002\u8FD9\u5BF9\u4E8Etransormer\u6A21\u578B\u6765\u8BF4\u592A\u9AD8\u4E86\uFF01\u4E00\u822C\u6765\u8BF4\uFF0C\u6211\u4EEC\u5EFA\u8BAE\u60A8\u7684\u6A21\u578B\u5C1D\u8BD5 1e-5 \u548C 1e-4 \u4E4B\u95F4\u7684\u5B66\u4E60\u7387\uFF1B\u8FD9\u6BD4\u6211\u4EEC\u5728\u8FD9\u91CC\u5B9E\u9645\u4F7F\u7528\u7684\u503C\u5C0F 10X \u5230 100X \u4E4B\u95F4\u3002\u542C\u8D77\u6765\u8FD9\u53EF\u80FD\u662F\u4E00\u4E2A\u4E3B\u8981\u95EE\u9898\uFF0C\u6240\u4EE5\u8BA9\u6211\u4EEC\u5C1D\u8BD5\u51CF\u5C11\u5B83\u3002\u4E3A\u6B64\uFF0C\u6211\u4EEC\u9700\u8981\u5BFC\u5165\u5B9E\u9645\u7684\u201C\u4F18\u5316\u5668\u201D\u5BF9\u8C61\u3002\u5F53\u6211\u4EEC\u8FD9\u6837\u505A\u7684\u65F6\u5019\uFF0C\u8BA9\u6211\u4EEC\u4ECE\u68C0\u67E5\u70B9\u91CD\u65B0\u521D\u59CB\u5316\u6A21\u578B\uFF0C\u4EE5\u9632\u9AD8\u5B66\u4E60\u7387\u7684\u8BAD\u7EC3\u635F\u574F\u4E86\u5B83\u7684\u6743\u91CD\uFF1A"),Cp=c(),f(ba.$$.fragment),Dp=c(),f(Ts.$$.fragment),Ap=c(),Ra=t("p"),Kr=p("\u73B0\u5728\uFF0C\u6211\u4EEC\u53EF\u4EE5\u5C1D\u8BD5\u4F7F\u7528\u65B0\u7684\u3001\u6539\u8FDB\u540E\u7684\u5B66\u4E60\u7387\u6765\u62DF\u5408\u6A21\u578B\uFF1A"),Op=c(),f(ja.$$.fragment),qp=c(),f(oa.$$.fragment),zp=c(),Va=t("p"),Lr=p("\u73B0\u5728\u6211\u4EEC\u7684\u635F\u5931\u771F\u7684\u5728\u67D0\u4E2A\u5730\u65B9\uFF01 \u8BAD\u7EC3\u7EC8\u4E8E\u770B\u8D77\u6765\u594F\u6548\u4E86\u3002 \u8FD9\u91CC\u6709\u4E00\u4E2A\u6559\u8BAD\uFF1A\u5F53\u4F60\u7684\u6A21\u578B\u6B63\u5728\u8FD0\u884C\u4F46\u635F\u5931\u6CA1\u6709\u4E0B\u964D\uFF0C\u5E76\u4E14\u4F60\u786E\u5B9A\u4F60\u7684\u6570\u636E\u6CA1\u95EE\u9898\u65F6\uFF0C\u68C0\u67E5\u5B66\u4E60\u7387\u548C\u6743\u91CD\u8870\u51CF\u7B49\u8D85\u53C2\u6570\u662F\u4E2A\u597D\u4E3B\u610F\u3002 \u5C06\u5176\u4E2D\u4EFB\u4F55\u4E00\u4E2A\u8BBE\u7F6E\u5F97\u592A\u9AD8\u5F88\u53EF\u80FD\u5BFC\u81F4\u8BAD\u7EC3\u5728\u9AD8\u635F\u5931\u503C\u4E0B\u201C\u505C\u6EDE\u201D\u3002"),gp=c(),fa=t("h2"),Ur=p("\u5176\u4ED6\u6F5C\u5728\u95EE\u9898"),Fp=c(),Xa=t("p"),Br=p("\u6211\u4EEC\u5DF2\u7ECF\u6DB5\u76D6\u4E86\u4E0A\u9762\u811A\u672C\u4E2D\u7684\u95EE\u9898\uFF0C\u4F46\u60A8\u53EF\u80FD\u4F1A\u9047\u5230\u5176\u4ED6\u51E0\u4E2A\u5E38\u89C1\u9519\u8BEF\u3002 \u8BA9\u6211\u4EEC\u770B\u4E00\u4E2A\uFF08\u975E\u5E38\u4E0D\u5B8C\u6574\u7684\uFF09\u5217\u8868\u3002"),Sp=c(),ia=t("h3"),Ir=p("\u5904\u7406\u5185\u5B58\u4E0D\u8DB3\u9519\u8BEF"),Mp=c(),Ps=t("p"),Hr=p("\u5185\u5B58\u4E0D\u8DB3\u7684\u8FF9\u8C61\u662F\u201C\u5206\u914D\u5F20\u91CF\u65F6\u51FA\u73B0 OOM\u201D\u4E4B\u7C7B\u7684\u9519\u8BEF\u2014\u2014OOM \u662F\u201C\u5185\u5B58\u4E0D\u8DB3\u201D\u7684\u7F29\u5199\u3002 \u5728\u5904\u7406\u5927\u578B\u8BED\u8A00\u6A21\u578B\u65F6\uFF0C\u8FD9\u662F\u4E00\u4E2A\u975E\u5E38\u5E38\u89C1\u7684\u5371\u9669\u3002 \u5982\u679C\u9047\u5230\u8FD9\u79CD\u60C5\u51B5\uFF0C\u4E00\u4E2A\u597D\u7684\u7B56\u7565\u662F\u5C06\u6279\u91CF\u5927\u5C0F\u51CF\u534A\u5E76\u91CD\u8BD5\u3002 \u4F46\u8BF7\u8BB0\u4F4F\uFF0C\u6709\u4E9B\u578B\u53F7"),pl=t("em"),Rr=p("\u975E\u5E38"),Vr=p("\u5927\u3002 \u4F8B\u5982\uFF0C\u5168\u5C3A\u5BF8 GPT-2 \u7684\u53C2\u6570\u4E3A 1.5B\uFF0C\u8FD9\u610F\u5473\u7740\u60A8\u5C06\u9700\u8981 6 GB \u7684\u5185\u5B58\u6765\u5B58\u50A8\u6A21\u578B\uFF0C\u53E6\u5916\u9700\u8981 6 GB \u7684\u5185\u5B58\u7528\u4E8E\u68AF\u5EA6\u4E0B\u964D\uFF01 \u65E0\u8BBA\u60A8\u4F7F\u7528\u4EC0\u4E48\u6279\u91CF\u5927\u5C0F\uFF0C\u8BAD\u7EC3\u5B8C\u6574\u7684 GPT-2 \u6A21\u578B\u901A\u5E38\u9700\u8981\u8D85\u8FC7 20 GB \u7684 VRAM\uFF0C\u800C\u53EA\u6709\u5C11\u6570 GPU \u62E5\u6709\u3002 \u50CF\u201Cdistilbert-base-cased\u201D\u8FD9\u6837\u66F4\u8F7B\u91CF\u7EA7\u7684\u6A21\u578B\u66F4\u5BB9\u6613\u8FD0\u884C\uFF0C\u8BAD\u7EC3\u4E5F\u66F4\u5FEB\u3002"),Gp=c(),f(Cs.$$.fragment),xp=c(),es=t("h3"),Ds=t("a"),el=t("span"),f(da.$$.fragment),Xr=c(),rl=t("span"),Jr=p("TensorFlow \u{1F99B}\u997F\u997F"),Np=c(),Z=t("p"),Wr=p("\u60A8\u5E94\u8BE5\u6CE8\u610F\u7684 TensorFlow \u7684\u4E00\u4E2A\u7279\u6B8A\u602A\u7656\u662F\uFF0C\u5B83\u4F1A\u5728\u60A8\u52A0\u8F7D\u6A21\u578B\u6216\u8FDB\u884C\u4EFB\u4F55\u8BAD\u7EC3\u540E\u7ACB\u5373\u4E3A\u81EA\u5DF1\u5206\u914D "),tl=t("em"),Yr=p("\u6240\u6709"),Zr=p(" GPU \u5185\u5B58\uFF0C\u7136\u540E\u6839\u636E\u9700\u8981\u5206\u914D\u8BE5\u5185\u5B58\u3002\u8FD9\u4E0E\u5176\u4ED6\u6846\u67B6\u7684\u884C\u4E3A\u4E0D\u540C\uFF0C\u4F8B\u5982 PyTorch\uFF0C\u540E\u8005\u6839\u636E CUDA \u7684\u9700\u8981\u5206\u914D\u5185\u5B58\uFF0C\u800C\u4E0D\u662F\u5728\u5185\u90E8\u8FDB\u884C\u3002 TensorFlow \u65B9\u6CD5\u7684\u4E00\u4E2A\u4F18\u70B9\u662F\uFF0C\u5F53\u60A8\u8017\u5C3D\u5185\u5B58\u65F6\uFF0C\u5B83\u901A\u5E38\u4F1A\u7ED9\u51FA\u6709\u7528\u7684\u9519\u8BEF\uFF0C\u5E76\u4E14\u5B83\u53EF\u4EE5\u4ECE\u8BE5\u72B6\u6001\u6062\u590D\u800C\u4E0D\u4F1A\u5BFC\u81F4\u6574\u4E2A CUDA \u5185\u6838\u5D29\u6E83\u3002\u4F46\u4E5F\u6709\u4E00\u4E2A\u91CD\u8981\u7684\u7F3A\u70B9\uFF1A\u5982\u679C\u4F60\u540C\u65F6\u8FD0\u884C\u4E24\u4E2A TensorFlow \u8FDB\u7A0B\uFF0C\u90A3\u4E48"),ml=t("strong"),Qr=p("\u4F60\u5C06\u5EA6\u8FC7\u4E00\u6BB5\u7CDF\u7CD5\u7684\u65F6\u5149"),st=p("\u3002"),Kp=c(),Ja=t("p"),at=p("\u5982\u679C\u60A8\u5728 Colab \u4E0A\u8FD0\u884C\uFF0C\u5219\u65E0\u9700\u62C5\u5FC3\u8FD9\u4E00\u70B9\uFF0C\u4F46\u5982\u679C\u60A8\u5728\u672C\u5730\u8FD0\u884C\uFF0C\u8FD9\u7EDD\u5BF9\u662F\u60A8\u5E94\u8BE5\u5C0F\u5FC3\u7684\u4E8B\u60C5\u3002\u7279\u522B\u8981\u6CE8\u610F\uFF0C\u5173\u95ED\u7B14\u8BB0\u672C\u9009\u9879\u5361\u5E76\u4E0D\u4E00\u5B9A\u4F1A\u5173\u95ED\u8BE5\u7B14\u8BB0\u672C\uFF01\u60A8\u53EF\u80FD\u9700\u8981\u9009\u62E9\u6B63\u5728\u8FD0\u884C\u7684\u7B14\u8BB0\u672C\uFF08\u5E26\u6709\u7EFF\u8272\u56FE\u6807\u7684\u7B14\u8BB0\u672C\uFF09\u5E76\u5728\u76EE\u5F55\u5217\u8868\u4E2D\u624B\u52A8\u5173\u95ED\u5B83\u4EEC\u3002\u4EFB\u4F55\u4F7F\u7528 TensorFlow \u7684\u6B63\u5728\u8FD0\u884C\u7684\u7B14\u8BB0\u672C\u4ECD\u53EF\u80FD\u5360\u7528\u5927\u91CF GPU \u5185\u5B58\uFF0C\u8FD9\u610F\u5473\u7740\u60A8\u542F\u52A8\u7684\u4EFB\u4F55\u65B0\u7B14\u8BB0\u672C\u90FD\u53EF\u80FD\u4F1A\u9047\u5230\u4E00\u4E9B\u975E\u5E38\u5947\u602A\u7684\u95EE\u9898\u3002"),Lp=c(),As=t("p"),nt=p("\u5982\u679C\u60A8\u5F00\u59CB\u8FD0\u884C\u4E4B\u524D\u6B63\u786E\u7684\u4EE3\u7801\u5374\u6536\u5230\u6709\u5173 CUDA\u3001BLAS \u6216 cuBLAS \u7684\u9519\u8BEF\uFF0C\u8FD9\u901A\u5E38\u662F\u7F6A\u9B41\u7978\u9996\u3002\u60A8\u53EF\u4EE5\u4F7F\u7528\u7C7B\u4F3C "),ul=t("code"),lt=p("nvidia-smi"),pt=p(" \u7684\u547D\u4EE4\u6765\u68C0\u67E5 - \u5F53\u60A8\u5173\u95ED\u6216\u91CD\u65B0\u542F\u52A8\u5F53\u524D\u7B14\u8BB0\u672C\u65F6\uFF0C\u60A8\u7684\u5927\u90E8\u5206\u5185\u5B58\u662F\u5426\u7A7A\u95F2\uFF0C\u6216\u8005\u662F\u5426\u4ECD\u5728\u4F7F\u7528\u4E2D\uFF1F\u5982\u679C\u5B83\u4ECD\u5728\u4F7F\u7528\u4E2D\uFF0C\u5219\u6709\u5176\u4ED6\u4E1C\u897F\u5728\u5360\u7528\u5B83\uFF01"),Up=c(),_a=t("h3"),et=p("\u68C0\u67E5\u60A8\u7684\u6570\u636E\uFF08\u518D\u6B21\uFF01\uFF09"),Bp=c(),F=t("p"),rt=p("\u53EA\u6709\u5728\u7406\u8BBA\u4E0A\u53EF\u4EE5\u4ECE\u60A8\u7684\u6570\u636E\u4E2D\u5B66\u5230\u4EFB\u4F55\u4E1C\u897F\u65F6\uFF0C\u60A8\u7684\u6A21\u578B\u624D\u4F1A\u5B66\u5230\u4E00\u4E9B\u4E1C\u897F\u3002 \u5982\u679C\u5B58\u5728\u635F\u574F\u6570\u636E\u7684\u9519\u8BEF\u6216\u6807\u7B7E\u662F\u968F\u673A\u5C5E\u6027\u7684\uFF0C\u90A3\u4E48\u60A8\u5F88\u53EF\u80FD\u4E0D\u4F1A\u5728\u6570\u636E\u96C6\u4E0A\u83B7\u5F97\u4EFB\u4F55\u77E5\u8BC6\u3002\u8FD9\u91CC\u4E00\u4E2A\u6709\u7528\u7684\u5DE5\u5177\u662F"),cl=t("code"),tt=p("tokenizer.decode()"),mt=p("\u3002 \u8FD9\u4F1A\u5C06 "),hl=t("code"),ut=p("input_ids"),ct=p(" \u8F6C\u6362\u56DE\u5B57\u7B26\u4E32\uFF0C\u56E0\u6B64\u60A8\u53EF\u4EE5\u67E5\u770B\u6570\u636E\u5E76\u67E5\u770B\u60A8\u7684\u8BAD\u7EC3\u6570\u636E\u662F\u5426\u6B63\u5728\u6559\u6388\u60A8\u5E0C\u671B\u5B83\u6559\u6388\u7684\u5185\u5BB9\u3002 \u4F8B\u5982\uFF0C\u50CF\u6211\u4EEC\u4E0A\u9762\u6240\u505A\u7684\u90A3\u6837\u4ECE "),bl=t("code"),ht=p("tf.data.Dataset"),bt=p(" \u4E2D\u83B7\u53D6 "),jl=t("code"),jt=p("batch"),ot=p(" \u540E\uFF0C\u60A8\u53EF\u4EE5\u50CF\u8FD9\u6837\u89E3\u7801\u7B2C\u4E00\u4E2A\u5143\u7D20\uFF1A"),Ip=c(),f($a.$$.fragment),Hp=c(),Wa=t("p"),ft=p("Then you can compare it with the first label, like so:"),Rp=c(),f(va.$$.fragment),Vp=c(),Ya=t("p"),it=p("\u4E00\u65E6\u60A8\u53EF\u4EE5\u50CF\u8FD9\u6837\u67E5\u770B\u60A8\u7684\u6570\u636E\uFF0C\u60A8\u53EF\u4EE5\u95EE\u81EA\u5DF1\u4EE5\u4E0B\u95EE\u9898\uFF1A"),Xp=c(),N=t("ul"),ol=t("li"),dt=p("\u89E3\u7801\u540E\u7684\u6570\u636E\u662F\u5426\u53EF\u4EE5\u7406\u89E3\uFF1F"),_t=c(),fl=t("li"),$t=p("\u4F60\u8BA4\u540C\u8FD9\u4E9B\u6807\u7B7E\u5417\uFF1F"),vt=c(),il=t("li"),Et=p("\u6709\u6CA1\u6709\u4E00\u4E2A\u6807\u7B7E\u6BD4\u5176\u4ED6\u6807\u7B7E\u66F4\u5E38\u89C1\uFF1F"),yt=c(),dl=t("li"),wt=p("\u5982\u679C\u6A21\u578B\u9884\u6D4B\u968F\u673A\u7684\u7B54\u6848/\u603B\u662F\u76F8\u540C\u7684\u7B54\u6848\uFF0C\u90A3\u4E48loss/\u8BC4\u4F30\u6307\u6807\u5E94\u8BE5\u662F\u591A\u5C11\uFF1F"),Jp=c(),Za=t("p"),kt=p("\u67E5\u770B\u60A8\u7684\u6570\u636E\u540E\uFF0C\u67E5\u770B\u6A21\u578B\u7684\u4E00\u4E9B\u9884\u6D4B\u5E76\u5BF9\u5176\u8FDB\u884C\u89E3\u7801\u3002 \u5982\u679C\u6A21\u578B\u603B\u662F\u9884\u6D4B\u540C\u6837\u7684\u4E8B\u60C5\uFF0C\u90A3\u53EF\u80FD\u662F\u56E0\u4E3A\u4F60\u7684\u6570\u636E\u96C6\u504F\u5411\u4E00\u4E2A\u7C7B\u522B\uFF08\u9488\u5BF9\u5206\u7C7B\u95EE\u9898\uFF09\uFF1B \u8FC7\u91C7\u6837\u7A00\u6709\u7C7B\u7B49\u6280\u672F\u53EF\u80FD\u4F1A\u6709\u6240\u5E2E\u52A9\u3002"),Wp=c(),Qa=t("p"),Tt=p("\u5982\u679C\u60A8\u5728\u521D\u59CB\u6A21\u578B\u4E0A\u83B7\u5F97\u7684loss/\u8BC4\u4F30\u6307\u6807\u4E0E\u60A8\u671F\u671B\u7684\u968F\u673A\u9884\u6D4B\u7684loss/\u8BC4\u4F30\u6307\u6807\u975E\u5E38\u4E0D\u540C\uFF0C\u8BF7\u4ED4\u7EC6\u68C0\u67E5\u60A8\u7684loss\u6216\u8BC4\u4F30\u6307\u6807\u7684\u8BA1\u7B97\u65B9\u5F0F\uFF0C\u56E0\u4E3A\u90A3\u91CC\u53EF\u80FD\u5B58\u5728\u9519\u8BEF\u3002 \u5982\u679C\u60A8\u4F7F\u7528\u6700\u540E\u6DFB\u52A0\u7684\u591A\u4E2Aloss\uFF0C\u8BF7\u786E\u4FDD\u5B83\u4EEC\u5177\u6709\u76F8\u540C\u7684\u89C4\u6A21\u3002"),Yp=c(),sn=t("p"),Pt=p("\u5F53\u60A8\u786E\u5B9A\u60A8\u7684\u6570\u636E\u662F\u5B8C\u7F8E\u7684\u65F6\uFF0C\u60A8\u53EF\u4EE5\u901A\u8FC7\u4E00\u4E2A\u7B80\u5355\u7684\u6D4B\u8BD5\u6765\u67E5\u770B\u6A21\u578B\u662F\u5426\u80FD\u591F\u5BF9\u5176\u8FDB\u884C\u8BAD\u7EC3\u3002"),Zp=c(),Ea=t("h3"),Ct=p("\u5728\u4E00\u6279\u4E0A\u8FC7\u5EA6\u62DF\u5408\u4F60\u7684\u6A21\u578B"),Qp=c(),an=t("p"),Dt=p("\u8FC7\u5EA6\u62DF\u5408\u901A\u5E38\u662F\u6211\u4EEC\u5728\u8BAD\u7EC3\u65F6\u5C3D\u91CF\u907F\u514D\u7684\u4E8B\u60C5\uFF0C\u56E0\u4E3A\u8FD9\u610F\u5473\u7740\u6A21\u578B\u6CA1\u6709\u5B66\u4E60\u8BC6\u522B\u6211\u4EEC\u60F3\u8981\u7684\u4E00\u822C\u7279\u5F81\uFF0C\u800C\u53EA\u662F\u8BB0\u4F4F\u4E86\u8BAD\u7EC3\u6837\u672C\u3002 \u4F46\u662F\uFF0C\u4E00\u904D\u53C8\u4E00\u904D\u5730\u5C1D\u8BD5\u5728\u4E00\u4E2A\u6279\u6B21\u4E0A\u8BAD\u7EC3\u60A8\u7684\u6A21\u578B\u662F\u4E00\u4E2A\u5F88\u597D\u7684\u6D4B\u8BD5\uFF0C\u53EF\u4EE5\u68C0\u67E5\u60A8\u6784\u5EFA\u7684\u95EE\u9898\u662F\u5426\u53EF\u4EE5\u901A\u8FC7\u60A8\u5C1D\u8BD5\u8BAD\u7EC3\u7684\u6A21\u578B\u6765\u89E3\u51B3\u3002 \u5B83\u8FD8\u5C06\u5E2E\u52A9\u60A8\u67E5\u770B\u60A8\u7684\u521D\u59CB\u5B66\u4E60\u7387\u662F\u5426\u592A\u9AD8\u3002"),se=c(),nn=t("p"),At=p("\u4E00\u65E6\u4F60\u5B9A\u4E49\u4E86\u4F60\u7684\u201C\u6A21\u578B\u201D\uFF0C\u8FD9\u6837\u505A\u771F\u7684\u5F88\u5BB9\u6613\uFF1B \u53EA\u9700\u83B7\u53D6\u4E00\u6279\u8BAD\u7EC3\u6570\u636E\uFF0C\u7136\u540E\u5C06\u8BE5\u201C\u6279\u6B21\u201D\u89C6\u4E3A\u60A8\u7684\u6574\u4E2A\u6570\u636E\u96C6\uFF0C\u5E76\u5728\u5176\u4E0Afit\u5927\u91CFepoch\uFF1A"),ae=c(),f(ya.$$.fragment),ne=c(),f(Os.$$.fragment),le=c(),ln=t("p"),Ot=p("\u751F\u6210\u7684\u6A21\u578B\u5728\u201C\u6279\u6B21\u201D\u4E0A\u5E94\u8BE5\u6709\u63A5\u8FD1\u5B8C\u7F8E\u7684\u7ED3\u679C\uFF0C\u635F\u5931\u8FC5\u901F\u4E0B\u964D\u5230 0\uFF08\u6216\u60A8\u6B63\u5728\u4F7F\u7528\u7684\u635F\u5931\u7684\u6700\u5C0F\u503C\uFF09\u3002"),pe=c(),pn=t("p"),qt=p("\u5982\u679C\u4F60\u6CA1\u6709\u8BBE\u6CD5\u8BA9\u4F60\u7684\u6A21\u578B\u83B7\u5F97\u8FD9\u6837\u7684\u5B8C\u7F8E\u7ED3\u679C\uFF0C\u8FD9\u610F\u5473\u7740\u4F60\u6784\u5EFA\u95EE\u9898\u6216\u6570\u636E\u7684\u65B9\u5F0F\u6709\u95EE\u9898\uFF0C\u6240\u4EE5\u4F60\u5E94\u8BE5\u4FEE\u590D\u5B83\u3002 \u53EA\u6709\u5F53\u4F60\u8BBE\u6CD5\u901A\u8FC7\u8FC7\u62DF\u5408\u6D4B\u8BD5\u65F6\uFF0C\u4F60\u624D\u80FD\u786E\u5B9A\u4F60\u7684\u6A21\u578B\u5B9E\u9645\u4E0A\u53EF\u4EE5\u5B66\u5230\u4E00\u4E9B\u4E1C\u897F\u3002"),ee=c(),f(qs.$$.fragment),re=c(),wa=t("h3"),zt=p("\u5728\u4F60\u6709\u7B2C\u4E00\u4E2A\u57FA\u7EBF\u4E4B\u524D\u4E0D\u8981\u8C03\u6574\u4EFB\u4F55\u4E1C\u897F"),te=c(),en=t("p"),gt=p("\u8D85\u53C2\u6570\u8C03\u6574\u603B\u662F\u88AB\u5F3A\u8C03\u4E3A\u673A\u5668\u5B66\u4E60\u4E2D\u6700\u96BE\u7684\u90E8\u5206\uFF0C\u4F46\u8FD9\u53EA\u662F\u5E2E\u52A9\u60A8\u5728\u6307\u6807\u4E0A\u83B7\u5F97\u4E00\u70B9\u70B9\u63D0\u5347\u7684\u6700\u540E\u4E00\u6B65\u3002 \u4F8B\u5982\u5C06\u9ED8\u8BA4\u7684 Adam \u5B66\u4E60\u7387 1e-3 \u4E0E Transformer \u6A21\u578B\u4E00\u8D77\u4F7F\u7528\uFF0C\u5F53\u7136\u4F1A\u4F7F\u5B66\u4E60\u8FDB\u884C\u5F97\u975E\u5E38\u7F13\u6162\u6216\u5B8C\u5168\u505C\u6B62\uFF0C\u4F46\u5927\u591A\u6570\u65F6\u5019\u201C\u5408\u7406\u201D\u7684\u8D85\u53C2\u6570\uFF0C\u4F8B\u5982\u4ECE 1e-5 \u5230 5e-5 \u7684\u5B66\u4E60\u7387\uFF0C\u4F1A\u5F88\u597D\u5730\u7ED9\u4F60\u5E26\u6765\u597D\u7684\u7ED3\u679C\u3002\u56E0\u6B64\uFF0C\u5728\u60A8\u83B7\u5F97\u8D85\u51FA\u6570\u636E\u96C6\u57FA\u7EBF\u7684\u4E1C\u897F\u4E4B\u524D\uFF0C\u4E0D\u8981\u5F00\u59CB\u8FDB\u884C\u8017\u65F6\u4E14\u6602\u8D35\u7684\u8D85\u53C2\u6570\u641C\u7D22\u3002"),me=c(),rn=t("p"),Ft=p("\u4E00\u65E6\u4F60\u6709\u4E00\u4E2A\u8DB3\u591F\u597D\u7684\u6A21\u578B\uFF0C\u4F60\u5C31\u53EF\u4EE5\u5F00\u59CB\u7A0D\u5FAE\u8C03\u6574\u4E00\u4E0B\u3002 \u4E0D\u8981\u5C1D\u8BD5\u4F7F\u7528\u4E0D\u540C\u7684\u8D85\u53C2\u6570\u542F\u52A8\u4E00\u5343\u6B21\u8FD0\u884C\uFF0C\u800C\u662F\u6BD4\u8F83\u4E00\u4E2A\u8D85\u53C2\u6570\u7684\u4E0D\u540C\u503C\u7684\u51E0\u6B21\u8FD0\u884C\uFF0C\u4EE5\u4E86\u89E3\u54EA\u4E2A\u5F71\u54CD\u6700\u5927\u3002"),ue=c(),tn=t("p"),St=p("\u5982\u679C\u60A8\u6B63\u5728\u8C03\u6574\u6A21\u578B\u672C\u8EAB\uFF0C\u4E0D\u8981\u5C1D\u8BD5\u4EFB\u4F55\u60A8\u65E0\u6CD5\u5408\u7406\u8BC1\u660E\u7684\u4E8B\u60C5\u3002 \u59CB\u7EC8\u786E\u4FDD\u60A8\u8FD4\u56DE\u8FC7\u62DF\u5408\u6D4B\u8BD5\u4EE5\u9A8C\u8BC1\u60A8\u7684\u66F4\u6539\u6CA1\u6709\u4EA7\u751F\u4EFB\u4F55\u610F\u5916\u540E\u679C\u3002"),ce=c(),ka=t("h3"),Mt=p("\u8BF7\u6C42\u5E2E\u5FD9"),he=c(),zs=t("p"),Gt=p("\u5E0C\u671B\u60A8\u4F1A\u5728\u672C\u8282\u4E2D\u627E\u5230\u4E00\u4E9B\u53EF\u4EE5\u5E2E\u52A9\u60A8\u89E3\u51B3\u95EE\u9898\u7684\u5EFA\u8BAE\uFF0C\u4F46\u5982\u679C\u4E0D\u662F\u8FD9\u6837\uFF0C\u8BF7\u8BB0\u4F4F\u60A8\u53EF\u4EE5\u968F\u65F6\u5728 "),Ta=t("a"),xt=p("\u8BBA\u575B"),Nt=p(" \u4E0A\u5411\u793E\u533A\u63D0\u95EE\u3002"),be=c(),mn=t("p"),Kt=p("\u4EE5\u4E0B\u662F\u4E00\u4E9B\u53EF\u80FD\u6709\u7528\u7684\u989D\u5916\u8D44\u6E90\uFF1A"),je=c(),K=t("ul"),un=t("li"),Pa=t("a"),Lt=p("\u201C\u4F5C\u4E3A\u5DE5\u7A0B\u6700\u4F73\u5B9E\u8DF5\u5DE5\u5177\u7684\u518D\u73B0\u6027\u201D"),Ut=p("\uFF0C\u4F5C\u8005\uFF1AJoel Grus"),Bt=c(),cn=t("li"),Ca=t("a"),It=p("\u201C\u795E\u7ECF\u7F51\u7EDC\u8C03\u8BD5\u6E05\u5355\u201D"),Ht=p(" \u4F5C\u8005\uFF1ACecelia Shao"),Rt=c(),hn=t("li"),Da=t("a"),Vt=p("\u201C\u5982\u4F55\u5BF9\u673A\u5668\u5B66\u4E60\u4EE3\u7801\u8FDB\u884C\u5355\u5143\u6D4B\u8BD5\u201D"),Xt=p(" by Chase Roberts"),Jt=c(),bn=t("li"),Aa=t("a"),Wt=p("\u201C\u8BAD\u7EC3\u795E\u7ECF\u7F51\u7EDC\u7684\u79D8\u8BC0\u201D"),Yt=p("\u4F5C\u8005\uFF1AAndrej Karpathy"),oe=c(),jn=t("p"),Zt=p("\u5F53\u7136\uFF0C\u5E76\u4E0D\u662F\u4F60\u5728\u8BAD\u7EC3\u795E\u7ECF\u7F51\u7EDC\u65F6\u9047\u5230\u7684\u6BCF\u4E00\u4E2A\u95EE\u9898\u90FD\u662F\u4F60\u81EA\u5DF1\u7684\u9519\uFF01 \u5982\u679C\u60A8\u5728 \u{1F917} Transformers \u6216 \u{1F917} Datasets \u5E93\u4E2D\u9047\u5230\u770B\u8D77\u6765\u4E0D\u6B63\u786E\u7684\u5185\u5BB9\uFF0C\u60A8\u53EF\u80FD\u9047\u5230\u4E86\u9519\u8BEF\u3002 \u4F60\u5E94\u8BE5\u544A\u8BC9\u6211\u4EEC\u8FD9\u4E00\u5207\uFF0C\u5728\u4E0B\u4E00\u8282\u4E2D\uFF0C\u6211\u4EEC\u5C06\u51C6\u786E\u89E3\u91CA\u5982\u4F55\u505A\u5230\u8FD9\u4E00\u70B9\u3002"),this.h()},l(s){const l=ec('[data-svelte="svelte-1phssyn"]',document.head);b=m(l,"META",{name:!0,content:!0}),l.forEach(a),w=h(s),i(j.$$.fragment,s),E=h(s),A=m(s,"H1",{class:!0});var Oa=u(A);P=m(Oa,"A",{id:!0,class:!0,href:!0});var _l=u(P);O=m(_l,"SPAN",{});var $l=u(O);i(g.$$.fragment,$l),$l.forEach(a),_l.forEach(a),ss=h(Oa),as=m(Oa,"SPAN",{});var vl=u(as);Ms=e(vl,"Debugging the training pipeline"),vl.forEach(a),Oa.forEach(a),I=h(s),i(L.$$.fragment,s),ts=h(s),z=m(s,"P",{});var rs=u(z);G=e(rs,"\u4F60\u5DF2\u7ECF\u7F16\u5199\u4E86\u4E00\u4E2A\u6F02\u4EAE\u7684\u811A\u672C\u6765\u8BAD\u7EC3\u6216\u5FAE\u8C03\u7ED9\u5B9A\u4EFB\u52A1\u7684\u6A21\u578B\uFF0C\u5C3D\u804C\u5C3D\u8D23\u5730\u9075\u5FAA "),H=m(rs,"A",{href:!0});var El=u(H);ns=e(El,"\u7B2C\u4E03\u7AE0"),El.forEach(a),Gs=e(rs," \u4E2D\u7684\u5EFA\u8BAE\u3002 \u4F46\u662F\u5F53\u4F60\u542F\u52A8\u547D\u4EE4 "),ls=m(rs,"CODE",{});var em=u(ls);ms=e(em,"model.fit()"),em.forEach(a),R=e(rs," \u65F6\uFF0C\u53EF\u6015\u7684\u4E8B\u60C5\u53D1\u751F\u4E86\uFF1A\u4F60\u5F97\u5230\u4E00\u4E2A\u9519\u8BEF\u{1F631}\uFF01 \u6216\u8005\u66F4\u7CDF\u7CD5\u7684\u662F\uFF0C\u4E00\u5207\u4F3C\u4E4E\u90FD\u5F88\u597D\uFF0C\u8BAD\u7EC3\u8FD0\u884C\u6CA1\u6709\u9519\u8BEF\uFF0C\u4F46\u751F\u6210\u7684\u6A21\u578B\u5F88\u7CDF\u7CD5\u3002 \u5728\u672C\u8282\u4E2D\uFF0C\u6211\u4EEC\u5C06\u5411\u60A8\u5C55\u793A\u5982\u4F55\u8C03\u8BD5\u6B64\u7C7B\u95EE\u9898\u3002"),rs.forEach(a),us=h(s),y=m(s,"H2",{class:!0});var ie=u(y);T=m(ie,"A",{id:!0,class:!0,href:!0});var rm=u(T);cs=m(rm,"SPAN",{});var tm=u(cs);i(V.$$.fragment,tm),tm.forEach(a),rm.forEach(a),ga=h(ie),hs=m(ie,"SPAN",{});var mm=u(hs);bs=e(mm,"Debugging the training pipeline"),mm.forEach(a),ie.forEach(a),xs=h(s),i(X.$$.fragment,s),kl=h(s),js=m(s,"P",{});var de=u(js);ze=e(de,"The problem when you encounter an error in "),$n=m(de,"CODE",{});var um=u($n);ge=e(um,"model.fit()"),um.forEach(a),Fe=e(de," is that it could come from multiple sources, as training usually brings together a lot of things that you\u2019ve been working on up until that point. The problem could be something wrong in your dataset, or some issue when trying to batch elements of the datasets together. Or it could be something wrong in the model code, or your loss function or optimizer. And even if everything goes well for training, something could still go wrong during the evaluation if there is a problem with your metric."),de.forEach(a),Tl=h(s),os=m(s,"P",{});var _e=u(os);Se=e(_e,"The best way to debug an error that arises in "),vn=m(_e,"CODE",{});var cm=u(vn);Me=e(cm,"model.fit()"),cm.forEach(a),Ge=e(_e," is to manually go through this whole pipeline to see where things went awry. The error is then often very easy to solve."),_e.forEach(a),Pl=h(s),fs=m(s,"P",{});var $e=u(fs);xe=e($e,"To demonstrate this, we will use the following script that (tries to) fine-tune a DistilBERT model on the "),Ns=m($e,"A",{href:!0,rel:!0});var hm=u(Ns);Ne=e(hm,"MNLI dataset"),hm.forEach(a),Ke=e($e,":"),$e.forEach(a),Cl=h(s),is=m(s,"P",{});var ve=u(is);Le=e(ve,"\u5F53\u60A8\u5728 "),En=m(ve,"CODE",{});var bm=u(En);Ue=e(bm,"model.fit()"),bm.forEach(a),Be=e(ve," \u4E2D\u9047\u5230\u9519\u8BEF\u65F6\uFF0C\u95EE\u9898\u5728\u4E8E\u5B83\u53EF\u80FD\u6765\u81EA\u591A\u4E2A\u6765\u6E90\uFF0C\u56E0\u4E3A\u8BAD\u7EC3\u901A\u5E38\u4F1A\u6C47\u96C6\u5F88\u591A\u60A8\u5728\u6B64\u4E4B\u524D\u4E00\u76F4\u5728\u505A\u7684\u4E8B\u60C5\u3002 \u95EE\u9898\u53EF\u80FD\u662F\u60A8\u7684\u6570\u636E\u96C6\u4E2D\u6709\u95EE\u9898\uFF0C\u6216\u8005\u662F\u5728\u5C1D\u8BD5\u5C06\u6570\u636E\u96C6\u7684\u5143\u7D20\u6279\u5904\u7406\u5728\u4E00\u8D77\u65F6\u51FA\u73B0\u95EE\u9898\u3002 \u6216\u8005\u6A21\u578B\u4EE3\u7801\u3001\u635F\u5931\u51FD\u6570\u6216\u4F18\u5316\u5668\u4E2D\u53EF\u80FD\u6709\u95EE\u9898\u3002 \u5373\u4F7F\u8BAD\u7EC3\u4E00\u5207\u987A\u5229\uFF0C\u5982\u679C\u60A8\u7684\u6307\u6807\u6709\u95EE\u9898\uFF0C\u8BC4\u4F30\u671F\u95F4\u4ECD\u7136\u53EF\u80FD\u51FA\u73B0\u95EE\u9898\u3002"),ve.forEach(a),Dl=h(s),ds=m(s,"P",{});var Ee=u(ds);Ie=e(Ee,"\u8C03\u8BD5 "),yn=m(Ee,"CODE",{});var jm=u(yn);He=e(jm,"model.fit()"),jm.forEach(a),Re=e(Ee," \u4E2D\u51FA\u73B0\u7684\u9519\u8BEF\u7684\u6700\u4F73\u65B9\u6CD5\u662F\u624B\u52A8\u68C0\u67E5\u6574\u4E2A\u7BA1\u9053\uFF0C\u770B\u770B\u54EA\u91CC\u51FA\u4E86\u95EE\u9898\u3002 \u9519\u8BEF\u901A\u5E38\u5F88\u5BB9\u6613\u89E3\u51B3\u3002"),Ee.forEach(a),Al=h(s),_s=m(s,"P",{});var ye=u(_s);Ve=e(ye,"\u4E3A\u4E86\u8BC1\u660E\u8FD9\u4E00\u70B9\uFF0C\u6211\u4EEC\u5C06\u4F7F\u7528\u4EE5\u4E0B\u811A\u672C\uFF08\u5C1D\u8BD5\uFF09\u5728 "),Ks=m(ye,"A",{href:!0,rel:!0});var om=u(Ks);Xe=e(om,"MNLI \u6570\u636E\u96C6"),om.forEach(a),Je=e(ye,"\u4E0A\u5FAE\u8C03 DistilBERT \u6A21\u578B\uFF1A"),ye.forEach(a),Ol=h(s),i(Ls.$$.fragment,s),ql=h(s),Fa=m(s,"P",{});var fm=u(Fa);We=e(fm,"\u5982\u679C\u60A8\u5C1D\u8BD5\u6267\u884C\u5B83\uFF0C\u5728\u8FDB\u884C\u6570\u636E\u96C6\u8F6C\u6362\u65F6\u53EF\u80FD\u4F1A\u6536\u5230\u4E00\u4E9B\u201CVisibleDeprecationWarning\u201D\u2014\u2014\u8FD9\u662F\u6211\u4EEC\u5DF2\u77E5\u7684 UX \u95EE\u9898\uFF0C\u56E0\u6B64\u8BF7\u5FFD\u7565\u5B83\u3002 \u5982\u679C\u4F60\u5728 2021 \u5E74 11 \u6708\u4E4B\u540E\u9605\u8BFB\u8FD9\u95E8\u8BFE\u7A0B\u5E76\u4E14\u5B83\u4ECD\u5728\u7EE7\u7EED\uFF0C\u90A3\u4E48\u8BF7\u5728\u63A8\u7279\u4E0A @carrigmat \u4E0A\u53D1\u9001\u6124\u6012\u7684\u63A8\u6587\uFF0C\u76F4\u5230\u4ED6\u4FEE\u590D\u5B83\u3002"),fm.forEach(a),zl=h(s),Sa=m(s,"P",{});var im=u(Sa);Ye=e(im,"\u7136\u800C\uFF0C\u66F4\u4E25\u91CD\u7684\u95EE\u9898\u662F\u6211\u4EEC\u5F97\u5230\u4E86\u4E00\u4E2A\u5F7B\u5E95\u7684\u9519\u8BEF\u3002 \u5B83\u771F\u7684\u975E\u5E38\u957F\uFF1A"),im.forEach(a),gl=h(s),i(Us.$$.fragment,s),Fl=h(s),Ma=m(s,"P",{});var dm=u(Ma);Ze=e(dm,"\u8FD9\u610F\u5473\u7740\u4EC0\u4E48\uFF1F \u6211\u4EEC\u8BD5\u56FE\u8BAD\u7EC3\u6211\u4EEC\u7684\u6570\u636E\uFF0C\u4F46\u6211\u4EEC\u6CA1\u6709\u68AF\u5EA6\uFF1F \u8FD9\u5F88\u4EE4\u4EBA\u56F0\u60D1\u3002 \u6211\u4EEC\u751A\u81F3\u4E0D\u77E5\u9053\u8BE5\u5982\u4F55\u5F00\u59CB\u8C03\u8BD5\u7C7B\u4F3C\u7684\u4E1C\u897F\uFF1F \u5F53\u4F60\u5F97\u5230\u7684\u9519\u8BEF\u5E76\u4E0D\u80FD\u7ACB\u5373\u8868\u660E\u95EE\u9898\u51FA\u5728\u54EA\u91CC\u65F6\uFF0C\u6700\u597D\u7684\u89E3\u51B3\u65B9\u6848\u901A\u5E38\u662F\u6309\u987A\u5E8F\u68C0\u67E5\u6240\u6709\u5185\u5BB9\uFF0C\u786E\u4FDD\u5728\u6BCF\u4E2A\u9636\u6BB5\u4E00\u5207\u770B\u8D77\u6765\u90FD\u662F\u6B63\u786E\u7684\u3002 \u5F53\u7136\uFF0C\u5F00\u59CB\u7684\u5730\u65B9\u603B\u662F\u2026"),dm.forEach(a),Sl=h(s),Bs=m(s,"H3",{id:!0});var _m=u(Bs);Qe=e(_m,"\u68C0\u67E5\u60A8\u7684\u6570\u636E"),_m.forEach(a),Ml=h(s),Ga=m(s,"P",{});var $m=u(Ga);s0=e($m,"\u8FD9\u662F\u4E0D\u8A00\u800C\u55BB\u7684\uFF0C\u4F46\u5982\u679C\u60A8\u7684\u6570\u636E\u5DF2\u635F\u574F\uFF0CKeras \u5C06\u65E0\u6CD5\u4E3A\u60A8\u4FEE\u590D\u5B83\u3002 \u6240\u4EE5\u9996\u5148\uFF0C\u4F60\u9700\u8981\u770B\u770B\u4F60\u7684\u8BAD\u7EC3\u96C6\u4E2D\u6709\u4EC0\u4E48\u3002"),$m.forEach(a),Gl=h(s),D=m(s,"P",{});var S=u(D);a0=e(S,"\u5C3D\u7BA1\u67E5\u770B "),wn=m(S,"CODE",{});var vm=u(wn);n0=e(vm,"raw_datasets"),vm.forEach(a),l0=e(S," \u548C "),kn=m(S,"CODE",{});var Em=u(kn);p0=e(Em,"tokenized_datasets"),Em.forEach(a),e0=e(S," \u5F88\u8BF1\u4EBA\uFF0C\u4F46\u6211\u4EEC\u5F3A\u70C8\u5EFA\u8BAE\u60A8\u5728\u6570\u636E\u5C06\u8981\u8FDB\u5165\u6A21\u578B\u7684\u5730\u65B9\u76F4\u63A5\u67E5\u770B\u6570\u636E\u3002 \u8FD9\u610F\u5473\u7740\u5E94\u8BE5\u4ECE\u60A8\u4F7F\u7528 "),Tn=m(S,"CODE",{});var ym=u(Tn);r0=e(ym,"to_tf_dataset()"),ym.forEach(a),t0=e(S," \u51FD\u6570\u521B\u5EFA\u7684 "),Pn=m(S,"CODE",{});var wm=u(Pn);m0=e(wm,"tf.data.Dataset"),wm.forEach(a),u0=e(S," \u8BFB\u53D6\u8F93\u51FA\uFF01 \u90A3\u4E48\u6211\u4EEC\u8BE5\u600E\u4E48\u505A\u5462\uFF1F "),Cn=m(S,"CODE",{});var km=u(Cn);c0=e(km,"tf.data.Dataset"),km.forEach(a),h0=e(S," \u5BF9\u8C61\u4E00\u6B21\u7ED9\u6211\u4EEC\u6574\u4E2A\u6279\u6B21\u5E76\u4E14\u4E0D\u652F\u6301\u7D22\u5F15\uFF0C\u6240\u4EE5\u6211\u4EEC\u4E0D\u80FD\u53EA\u8BF7\u6C42 "),Dn=m(S,"CODE",{});var Tm=u(Dn);b0=e(Tm,"train_dataset[0]"),Tm.forEach(a),j0=e(S,"\u3002 \u4F46\u662F\uFF0C\u6211\u4EEC\u53EF\u4EE5\u793C\u8C8C\u5730\u5411\u5B83\u8981\u4E00\u6279\uFF1A"),S.forEach(a),xl=h(s),i(Is.$$.fragment,s),Nl=h(s),U=m(s,"P",{});var qa=u(U);An=m(qa,"CODE",{});var Pm=u(An);o0=e(Pm,"break"),Pm.forEach(a),f0=e(qa," \u5728\u4E00\u6B21\u8FED\u4EE3\u540E\u7ED3\u675F\u5FAA\u73AF\uFF0C\u56E0\u6B64\u8FD9\u4F1A\u6293\u53D6\u6765\u81EA"),On=m(qa,"CODE",{});var Cm=u(On);i0=e(Cm,"train_dataset"),Cm.forEach(a),d0=e(qa," \u7684\u7B2C\u4E00\u6279\u5E76\u5C06\u5176\u4FDD\u5B58\u4E3A"),qn=m(qa,"CODE",{});var Dm=u(qn);_0=e(Dm,"batch"),Dm.forEach(a),$0=e(qa,"\u3002 \u73B0\u5728\uFF0C\u8BA9\u6211\u4EEC\u770B\u770B\u91CC\u9762\u6709\u4EC0\u4E48\uFF1A"),qa.forEach(a),Kl=h(s),i(Hs.$$.fragment,s),Ll=h(s),x=m(s,"P",{});var gs=u(x);v0=e(gs,"\u8FD9\u770B\u8D77\u6765\u4E0D\u9519\uFF0C\u4E0D\u662F\u5417\uFF1F\u6211\u4EEC\u5C06 "),zn=m(gs,"CODE",{});var Am=u(zn);E0=e(Am,"labels"),Am.forEach(a),y0=e(gs," \u3001"),gn=m(gs,"CODE",{});var Om=u(gn);w0=e(Om,"attention_mask"),Om.forEach(a),k0=e(gs," \u548C "),Fn=m(gs,"CODE",{});var qm=u(Fn);T0=e(qm,"input_ids"),qm.forEach(a),P0=e(gs," \u4F20\u9012\u7ED9\u6A21\u578B\uFF0C\u8FD9\u5E94\u8BE5\u662F\u8BA1\u7B97\u8F93\u51FA\u548C\u8BA1\u7B97\u635F\u5931\u6240\u9700\u7684\u4E00\u5207\u3002\u90A3\u4E48\u4E3A\u4EC0\u4E48\u6211\u4EEC\u6CA1\u6709\u68AF\u5EA6\u5462\uFF1F\u4ED4\u7EC6\u770B\uFF1A\u6211\u4EEC\u5C06\u5355\u4E2A\u5B57\u5178\u4F5C\u4E3A\u8F93\u5165\u4F20\u9012\uFF0C\u4F46\u8BAD\u7EC3\u6279\u6B21\u901A\u5E38\u662F\u8F93\u5165\u5F20\u91CF\u6216\u5B57\u5178\uFF0C\u52A0\u4E0A\u6807\u7B7E\u5F20\u91CF\u3002\u6211\u4EEC\u7684\u6807\u7B7E\u53EA\u662F\u6211\u4EEC\u8F93\u5165\u5B57\u5178\u4E2D\u7684\u4E00\u4E2A\u952E\u3002"),gs.forEach(a),Ul=h(s),$s=m(s,"P",{});var we=u($s);C0=e(we,"\u8FD9\u662F\u4E00\u4E2A\u95EE\u9898\u5417\uFF1F\u5B9E\u9645\u4E0A\uFF0C\u5E76\u975E\u603B\u662F\u5982\u6B64\uFF01\u4F46\u8FD9\u662F\u60A8\u5728\u4F7F\u7528 TensorFlow \u8BAD\u7EC3 Transformer \u6A21\u578B\u65F6\u4F1A\u9047\u5230\u7684\u6700\u5E38\u89C1\u95EE\u9898\u4E4B\u4E00\u3002\u6211\u4EEC\u7684\u6A21\u578B\u90FD\u53EF\u4EE5\u5728\u5185\u90E8\u8BA1\u7B97\u635F\u5931\uFF0C\u4F46\u8981\u505A\u5230\u8FD9\u4E00\u70B9\uFF0C\u9700\u8981\u5728\u8F93\u5165\u5B57\u5178\u4E2D\u4F20\u9012\u6807\u7B7E\u3002\u8FD9\u662F\u5F53\u6211\u4EEC\u6CA1\u6709\u4E3A "),Sn=m(we,"CODE",{});var zm=u(Sn);D0=e(zm,"compile()"),zm.forEach(a),A0=e(we," \u6307\u5B9A\u635F\u5931\u503C\u65F6\u4F7F\u7528\u7684\u635F\u5931\u3002\u53E6\u4E00\u65B9\u9762\uFF0CKeras \u901A\u5E38\u5E0C\u671B\u6807\u7B7E\u4E0E\u8F93\u5165\u5B57\u5178\u5206\u5F00\u4F20\u9012\uFF0C\u5982\u679C\u4F60\u4E0D\u8FD9\u6837\u505A\uFF0C\u635F\u5931\u8BA1\u7B97\u901A\u5E38\u4F1A\u5931\u8D25\u3002"),we.forEach(a),Bl=h(s),vs=m(s,"P",{});var ke=u(vs);O0=e(ke,"\u95EE\u9898\u73B0\u5728\u53D8\u5F97\u66F4\u6E05\u695A\u4E86\uFF1A\u6211\u4EEC\u4F20\u9012\u4E86\u4E00\u4E2A\u201C\u635F\u5931\u201D\u53C2\u6570\uFF0C\u8FD9\u610F\u5473\u7740\u6211\u4EEC\u8981\u6C42 Keras \u4E3A\u6211\u4EEC\u8BA1\u7B97\u635F\u5931\uFF0C\u4F46\u6211\u4EEC\u5C06\u6807\u7B7E\u4F5C\u4E3A\u6A21\u578B\u7684\u8F93\u5165\u4F20\u9012\uFF0C\u800C\u4E0D\u662F\u653E\u5728 Keras \u671F\u671B\u7684\u5730\u65B9\u7684\uFF01\u6211\u4EEC\u9700\u8981\u4E8C\u9009\u4E00\uFF1A\u8981\u4E48\u4F7F\u7528\u6A21\u578B\u7684\u5185\u90E8\u635F\u5931\u5E76\u5C06\u6807\u7B7E\u4FDD\u7559\u5728\u539F\u5904\uFF0C\u8981\u4E48\u7EE7\u7EED\u4F7F\u7528 Keras \u635F\u5931\uFF0C\u4F46\u5C06\u6807\u7B7E\u79FB\u52A8\u5230 Keras \u671F\u671B\u7684\u4F4D\u7F6E\u3002\u4E3A\u7B80\u5355\u8D77\u89C1\uFF0C\u8BA9\u6211\u4EEC\u91C7\u7528\u7B2C\u4E00\u79CD\u65B9\u6CD5\u3002\u5C06\u5BF9 "),Mn=m(ke,"CODE",{});var gm=u(Mn);q0=e(gm,"compile()"),gm.forEach(a),z0=e(ke," \u7684\u8C03\u7528\u66F4\u6539\u4E3A\uFF1A"),ke.forEach(a),Il=h(s),i(Rs.$$.fragment,s),Hl=h(s),xa=m(s,"P",{});var Fm=u(xa);g0=e(Fm,"\u73B0\u5728\u6211\u4EEC\u5C06\u4F7F\u7528\u6A21\u578B\u7684\u5185\u90E8\u635F\u5931\uFF0C\u8FD9\u4E2A\u95EE\u9898\u5E94\u8BE5\u89E3\u51B3\u4E86\uFF01"),Fm.forEach(a),Rl=h(s),i(Es.$$.fragment,s),Vl=h(s),ys=m(s,"P",{});var Te=u(ys);F0=e(Te,"\u73B0\u5728\uFF0C\u8BA9\u6211\u4EEC\u5C1D\u8BD5\u8BAD\u7EC3\u3002 \u6211\u4EEC\u73B0\u5728\u5E94\u8BE5\u5F97\u5230\u68AF\u5EA6\uFF0C\u6240\u4EE5\u5E0C\u671B\uFF08\u8FD9\u91CC\u64AD\u653E\u4E0D\u7965\u7684\u97F3\u4E50\uFF09\u6211\u4EEC\u53EF\u4EE5\u8C03\u7528 "),Gn=m(Te,"CODE",{});var Sm=u(Gn);S0=e(Sm,"model.fit()"),Sm.forEach(a),M0=e(Te," \u4E00\u5207\u90FD\u4F1A\u6B63\u5E38\u5DE5\u4F5C\uFF01"),Te.forEach(a),Xl=h(s),i(Vs.$$.fragment,s),Jl=h(s),Na=m(s,"P",{});var Mm=u(Na);G0=e(Mm,"Oh no."),Mm.forEach(a),Wl=h(s),Xs=m(s,"P",{});var Qt=u(Xs);xn=m(Qt,"CODE",{});var Gm=u(xn);x0=e(Gm,"nan"),Gm.forEach(a),N0=e(Qt," \u4E0D\u662F\u4E00\u4E2A\u975E\u5E38\u4EE4\u4EBA\u5F00\u5FC3\u7684\u635F\u5931\u503C\u3002 \u5C3D\u7BA1\u5982\u6B64\uFF0C\u6211\u4EEC\u5DF2\u7ECF\u68C0\u67E5\u4E86\u6211\u4EEC\u7684\u6570\u636E\uFF0C\u5B83\u770B\u8D77\u6765\u8FD8\u4E0D\u9519\u3002 \u5982\u679C\u8FD9\u4E0D\u662F\u95EE\u9898\uFF0C\u6211\u4EEC\u4E0B\u4E00\u6B65\u8BE5\u53BB\u54EA\u91CC\uFF1F \u663E\u800C\u6613\u89C1\u7684\u4E0B\u4E00\u6B65\u662F\u2026"),Qt.forEach(a),Yl=h(s),Js=m(s,"H3",{id:!0});var xm=u(Js);K0=e(xm,"\u68C0\u67E5\u4F60\u7684\u6A21\u578B"),xm.forEach(a),Zl=h(s),B=m(s,"P",{});var za=u(B);Nn=m(za,"CODE",{});var Nm=u(Nn);L0=e(Nm,"model.fit()"),Nm.forEach(a),U0=e(za," \u662F Keras \u4E2D\u4E00\u4E2A\u975E\u5E38\u65B9\u4FBF\u7684\u51FD\u6570\uFF0C\u4F46\u5B83\u4E3A\u60A8\u505A\u4E86\u5F88\u591A\u4E8B\u60C5\uFF0C\u8FD9\u4F7F\u5F97\u51C6\u786E\u627E\u5230\u95EE\u9898\u53D1\u751F\u7684\u4F4D\u7F6E\u53D8\u5F97\u66F4\u52A0\u68D8\u624B\u3002 \u5982\u679C\u60A8\u6B63\u5728\u8C03\u8BD5\u60A8\u7684\u6A21\u578B\uFF0C\u4E00\u4E2A\u771F\u6B63\u6709\u7528\u7684\u7B56\u7565\u662F\u53EA\u5C06\u4E00\u4E2A\u6279\u6B21\u4F20\u9012\u7ED9\u6A21\u578B\uFF0C\u5E76\u8BE6\u7EC6\u67E5\u770B\u8BE5\u6279\u6B21\u7684\u8F93\u51FA\u3002 \u5982\u679C\u6A21\u578B\u629B\u51FA\u9519\u8BEF\uFF0C\u53E6\u4E00\u4E2A\u975E\u5E38\u6709\u7528\u7684\u63D0\u793A\u662F\u4F7F\u7528 "),Kn=m(za,"CODE",{});var Km=u(Kn);B0=e(Km,"run_eagerly=True"),Km.forEach(a),I0=h(za),Ln=m(za,"CODE",{});var Lm=u(Ln);H0=e(Lm,"compile()"),Lm.forEach(a),R0=e(za," \u6A21\u578B\u3002 \u8FD9\u4F1A\u4F7F\u5B83\u53D8\u6162\u5F88\u591A\uFF0C\u4F46\u5B83\u4F1A\u4F7F\u9519\u8BEF\u6D88\u606F\u66F4\u5BB9\u6613\u7406\u89E3\uFF0C\u56E0\u4E3A\u5B83\u4EEC\u4F1A\u51C6\u786E\u5730\u6307\u51FA\u95EE\u9898\u53D1\u751F\u5728\u6A21\u578B\u4EE3\u7801\u7684\u54EA\u4E2A\u4F4D\u7F6E\u3002"),za.forEach(a),Ql=h(s),ws=m(s,"P",{});var Pe=u(ws);V0=e(Pe,"\u4E0D\u8FC7\uFF0C\u76EE\u524D\u6211\u4EEC\u8FD8\u4E0D\u9700\u8981 "),Un=m(Pe,"CODE",{});var Um=u(Un);X0=e(Um,"run_eagerly"),Um.forEach(a),J0=e(Pe,"\u3002 \u8BA9\u6211\u4EEC\u901A\u8FC7\u6A21\u578B\u8FD0\u884C\u6211\u4EEC\u4E4B\u524D\u5F97\u5230\u7684\u201C\u6279\u5904\u7406\u201D\uFF0C\u770B\u770B\u8F93\u51FA\u662F\u4EC0\u4E48\u6837\u5B50\u7684\uFF1A"),Pe.forEach(a),sp=h(s),i(Ws.$$.fragment,s),ap=h(s),i(Ys.$$.fragment,s),np=h(s),C=m(s,"P",{});var q=u(C);W0=e(q,"\u55EF\uFF0C\u8FD9\u5F88\u68D8\u624B\u3002\u4E00\u5207\u90FD\u662F"),Bn=m(q,"CODE",{});var Bm=u(Bn);Y0=e(Bm,"nan"),Bm.forEach(a),Z0=e(q,"\uFF01\u4F46\u8FD9\u5F88\u5947\u602A\uFF0C\u4E0D\u662F\u5417\uFF1F\u6211\u4EEC\u6240\u6709\u7684 logits \u600E\u4E48\u4F1A\u53D8\u6210\u201Cnan\u201D\uFF1F "),In=m(q,"CODE",{});var Im=u(In);Q0=e(Im,"nan"),Im.forEach(a),sr=e(q," \u7684\u610F\u601D\u662F\u201C\u4E0D\u662F\u6570\u5B57\u201D\u3002 "),Hn=m(q,"CODE",{});var Hm=u(Hn);ar=e(Hm,"nan"),Hm.forEach(a),nr=e(q," \u503C\u7ECF\u5E38\u51FA\u73B0\u5728\u60A8\u6267\u884C\u7981\u6B62\u64CD\u4F5C\u65F6\uFF0C\u4F8B\u5982\u9664\u4EE5\u96F6\u3002\u4F46\u662F\uFF0C\u5728\u673A\u5668\u5B66\u4E60\u4E2D\u4E86\u89E3 "),Rn=m(q,"CODE",{});var Rm=u(Rn);lr=e(Rm,"nan"),Rm.forEach(a),pr=e(q," \u975E\u5E38\u91CD\u8981\u7684\u4E00\u4EF6\u4E8B\u662F\uFF0C\u8BE5\u503C\u503E\u5411\u4E8E"),Vn=m(q,"EM",{});var Vm=u(Vn);er=e(Vm,"\u4F20\u64AD"),Vm.forEach(a),rr=e(q,"\u3002\u5982\u679C\u5C06\u4E00\u4E2A\u6570\u5B57\u4E58\u4EE5 "),Xn=m(q,"CODE",{});var Xm=u(Xn);tr=e(Xm,"nan"),Xm.forEach(a),mr=e(q,"\uFF0C\u5219\u8F93\u51FA\u4E5F\u662F "),Jn=m(q,"CODE",{});var Jm=u(Jn);ur=e(Jm,"nan"),Jm.forEach(a),cr=e(q,"\u3002\u5982\u679C\u4F60\u5728\u8F93\u51FA\u3001\u635F\u5931\u6216\u68AF\u5EA6\u7684\u4EFB\u4F55\u5730\u65B9\u5F97\u5230\u4E00\u4E2A\u201Cnan\u201D\uFF0C\u90A3\u4E48\u5B83\u4F1A\u8FC5\u901F\u4F20\u64AD\u5230\u4F60\u7684\u6574\u4E2A\u6A21\u578B\u4E2D\u2014\u2014\u56E0\u4E3A\u5F53\u90A3\u4E2A\u201Cnan\u201D\u503C\u901A\u8FC7\u4F60\u7684\u7F51\u7EDC\u4F20\u64AD\u56DE\u6765\u65F6\uFF0C\u4F60\u4F1A\u5F97\u5230nan \u68AF\u5EA6\uFF0C\u5F53\u4F7F\u7528\u8FD9\u4E9B\u68AF\u5EA6\u8BA1\u7B97\u6743\u91CD\u66F4\u65B0\u65F6\uFF0C\u60A8\u5C06\u83B7\u5F97 nan \u6743\u91CD\uFF0C\u8FD9\u4E9B\u6743\u91CD\u5C06\u8BA1\u7B97\u66F4\u591A\u7684 nan \u8F93\u51FA\uFF01\u5F88\u5FEB\uFF0C\u6574\u4E2A\u7F51\u7EDC\u5C06\u53EA\u662F\u201Cnan\u201D\u7684\u4E00\u5927\u5757\u3002\u4E00\u65E6\u53D1\u751F\u8FD9\u79CD\u60C5\u51B5\uFF0C\u5C31\u5F88\u96BE\u770B\u51FA\u95EE\u9898\u662F\u4ECE\u54EA\u91CC\u5F00\u59CB\u7684\u3002\u6211\u4EEC\u5982\u4F55\u9694\u79BB\u201Cnan\u201D\u7B2C\u4E00\u6B21\u51FA\u73B0\u7684\u5730\u65B9\uFF1F"),q.forEach(a),lp=h(s),J=m(s,"P",{});var on=u(J);hr=e(on,"\u7B54\u6848\u662F\u5C1D\u8BD5"),Wn=m(on,"EM",{});var Wm=u(Wn);br=e(Wm,"\u91CD\u65B0\u521D\u59CB\u5316"),Wm.forEach(a),jr=e(on,"\u6211\u4EEC\u7684\u6A21\u578B\u3002\u4E00\u65E6\u6211\u4EEC\u5F00\u59CB\u8BAD\u7EC3\uFF0C\u6211\u4EEC\u5C31\u4F1A\u5728\u67D0\u4E2A\u5730\u65B9\u5F97\u5230\u4E00\u4E2A\u201Cnan\u201D\uFF0C\u5B83\u5F88\u5FEB\u5C31\u4F1A\u4F20\u64AD\u5230\u6574\u4E2A\u6A21\u578B\u4E2D\u3002\u6240\u4EE5\uFF0C\u8BA9\u6211\u4EEC\u4ECE\u68C0\u67E5\u70B9\u52A0\u8F7D\u6A21\u578B\u800C\u4E0D\u505A\u4EFB\u4F55\u6743\u91CD\u66F4\u65B0\uFF0C\u770B\u770B\u6211\u4EEC\u4ECE\u54EA\u91CC\u5F97\u5230\u4E00\u4E2A "),Yn=m(on,"CODE",{});var Ym=u(Yn);or=e(Ym,"nan"),Ym.forEach(a),fr=e(on," \u503C\uFF1A"),on.forEach(a),pp=h(s),i(Zs.$$.fragment,s),ep=h(s),Ka=m(s,"P",{});var Zm=u(Ka);ir=e(Zm,"\u5F53\u6211\u4EEC\u8FD0\u884C\u5B83\u65F6\uFF0C\u6211\u4EEC\u5F97\u5230\uFF1A"),Zm.forEach(a),rp=h(s),i(Qs.$$.fragment,s),tp=h(s),ps=m(s,"P",{});var yl=u(ps);Zn=m(yl,"EM",{});var Qm=u(Zn);dr=e(Qm,"\u73B0\u5728"),Qm.forEach(a),_r=e(yl,"\u6211\u4EEC\u5230\u4E86\u67D0\u4E2A\u5730\u65B9\uFF01 \u6211\u4EEC\u7684 logits \u4E2D\u6CA1\u6709 "),Qn=m(yl,"CODE",{});var su=u(Qn);$r=e(su,"nan"),su.forEach(a),vr=e(yl," \u503C\uFF0C\u8FD9\u4EE4\u4EBA\u653E\u5FC3\u3002 \u4F46\u662F\u6211\u4EEC\u786E\u5B9E\u5728\u635F\u5931\u4E2D\u770B\u5230\u4E86\u4E00\u4E9B\u201Cnan\u201D\u503C\uFF01 \u8FD9\u4E9B\u6837\u672C\u6709\u4EC0\u4E48\u7279\u522B\u5BFC\u81F4\u8FD9\u4E2A\u95EE\u9898\u7684\u5417\uFF1F \u8BA9\u6211\u4EEC\u770B\u770B\u5B83\u4EEC\u662F\u54EA\u4E9B\uFF08\u8BF7\u6CE8\u610F\uFF0C\u5982\u679C\u60A8\u81EA\u5DF1\u8FD0\u884C\u6B64\u4EE3\u7801\uFF0C\u60A8\u53EF\u80FD\u4F1A\u5F97\u5230\u4E0D\u540C\u7684\u7D22\u5F15\uFF0C\u56E0\u4E3A\u6570\u636E\u96C6\u5DF2\u88AB\u968F\u673A\u6253\u4E71\uFF09\uFF1A"),yl.forEach(a),mp=h(s),i(sa.$$.fragment,s),up=h(s),i(aa.$$.fragment,s),cp=h(s),La=m(s,"P",{});var au=u(La);Er=e(au,"\u8BA9\u6211\u4EEC\u770B\u770B\u8FD9\u4E9B\u6765\u81EA\u6837\u672C\u7684\u8F93\u5165id\uFF1A"),au.forEach(a),hp=h(s),i(na.$$.fragment,s),bp=h(s),i(la.$$.fragment,s),jp=h(s),Ua=m(s,"P",{});var nu=u(Ua);yr=e(nu,"\u55EF\uFF0C\u8FD9\u91CC\u6709\u5F88\u591A\u4E1C\u897F\uFF0C\u4F46\u6CA1\u6709\u4EC0\u4E48\u4E0D\u5BFB\u5E38\u7684\u3002 \u8BA9\u6211\u4EEC\u770B\u770B\u6807\u7B7E\uFF1A"),nu.forEach(a),op=h(s),i(pa.$$.fragment,s),fp=h(s),i(ea.$$.fragment,s),ip=h(s),W=m(s,"P",{});var fn=u(W);wr=e(fn,"\u554A! "),sl=m(fn,"CODE",{});var lu=u(sl);kr=e(lu,"nan"),lu.forEach(a),Tr=e(fn," \u6837\u672C\u90FD\u5177\u6709\u76F8\u540C\u7684\u6807\u7B7E\uFF0C\u5373\u6807\u7B7E 2\u3002\u8FD9\u662F\u4E00\u4E2A\u975E\u5E38\u660E\u663E\u7684\u63D0\u793A\u3002 \u5F53\u6211\u4EEC\u7684\u6807\u7B7E\u4E3A 2 \u65F6\uFF0C\u6211\u4EEC\u4F1A\u5F97\u5230loss\u4E3A "),al=m(fn,"CODE",{});var pu=u(al);Pr=e(pu,"nan"),pu.forEach(a),Cr=e(fn,"\uFF0C\u8FD9\u8868\u660E\u8FD9\u662F\u68C0\u67E5\u6A21\u578B\u4E2D\u6807\u7B7E\u6570\u91CF\u7684\u597D\u65F6\u673A\uFF1A"),fn.forEach(a),dp=h(s),i(ra.$$.fragment,s),_p=h(s),i(ta.$$.fragment,s),$p=h(s),Ba=m(s,"P",{});var eu=u(Ba);Dr=e(eu,"\u73B0\u5728\u6211\u4EEC\u770B\u5230\u4E86\u95EE\u9898\uFF1A\u6A21\u578B\u8BA4\u4E3A\u53EA\u6709\u4E24\u4E2A\u7C7B\uFF0C\u4F46\u6807\u7B7E\u4E0A\u5347\u5230 2\uFF0C\u8FD9\u610F\u5473\u7740\u5B9E\u9645\u4E0A\u6709\u4E09\u4E2A\u7C7B\uFF08\u56E0\u4E3A 0 \u4E5F\u662F\u4E00\u4E2A\u7C7B\uFF09\u3002 \u8FD9\u5C31\u662F\u6211\u4EEC\u5F97\u5230\u201Cnan\u201D\u7684\u65B9\u5F0F\u2014\u2014\u901A\u8FC7\u5C1D\u8BD5\u8BA1\u7B97\u4E0D\u5B58\u5728\u7684\u7C7B\u7684\u635F\u5931\uFF01 \u8BA9\u6211\u4EEC\u5C1D\u8BD5\u6539\u53D8\u5B83\u5E76\u518D\u6B21\u62DF\u5408\u6A21\u578B\uFF1A"),eu.forEach(a),vp=h(s),i(ma.$$.fragment,s),Ep=h(s),i(ua.$$.fragment,s),yp=h(s),Ia=m(s,"P",{});var ru=u(Ia);Ar=e(ru,"\u6211\u4EEC\u5728\u8BAD\u7EC3\uFF01 \u6CA1\u6709\u66F4\u591A\u7684\u2019nan\u2019s\uFF0C\u6211\u4EEC\u7684\u635F\u5931\u6B63\u5728\u51CF\u5C11\u2026\u6709\u70B9\u3002 \u5982\u679C\u4F60\u89C2\u5BDF\u4E00\u6BB5\u65F6\u95F4\uFF0C\u4F60\u53EF\u80FD\u4F1A\u5F00\u59CB\u6709\u70B9\u4E0D\u8010\u70E6\uFF0C\u56E0\u4E3A\u635F\u5931\u503C\u4E00\u76F4\u5C45\u9AD8\u4E0D\u4E0B\u3002 \u8BA9\u6211\u4EEC\u5728\u8FD9\u91CC\u505C\u6B62\u8BAD\u7EC3\u5E76\u5C1D\u8BD5\u8003\u8651\u53EF\u80FD\u5BFC\u81F4\u6B64\u95EE\u9898\u7684\u539F\u56E0\u3002 \u5728\u8FD9\u4E00\u70B9\u4E0A\uFF0C\u6211\u4EEC\u5F88\u786E\u5B9A\u6570\u636E\u548C\u6A21\u578B\u90FD\u6CA1\u6709\u95EE\u9898\uFF0C\u4F46\u662F\u6211\u4EEC\u7684\u6A21\u578B\u5E76\u6CA1\u6709\u5F88\u597D\u5730\u5B66\u4E60\u3002 \u8FD8\u5269\u4E0B\u4EC0\u4E48\uFF1F \u662F\u65F6\u5019\u2026"),ru.forEach(a),wp=h(s),ca=m(s,"H3",{id:!0});var tu=u(ca);Or=e(tu,"\u68C0\u67E5\u4F60\u7684\u8D85\u53C2\u6570"),tu.forEach(a),kp=h(s),Y=m(s,"P",{});var dn=u(Y);qr=e(dn,"\u5982\u679C\u4F60\u56DE\u5934\u770B\u4E0A\u9762\u7684\u4EE3\u7801\uFF0C\u4F60\u53EF\u80FD\u6839\u672C\u770B\u4E0D\u5230\u4EFB\u4F55\u8D85\u53C2\u6570\uFF0C\u9664\u4E86 "),nl=m(dn,"CODE",{});var mu=u(nl);zr=e(mu,"batch_size"),mu.forEach(a),gr=e(dn,"\uFF0C\u8FD9\u4F3C\u4E4E\u4E0D\u662F\u7F6A\u9B41\u7978\u9996\u3002\u4E0D\u8FC7\uFF0C\u4E0D\u8981\u88AB\u8FF7\u60D1\uFF1B\u603B\u662F\u6709\u8D85\u53C2\u6570\uFF0C\u5982\u679C\u4F60\u770B\u4E0D\u5230\u5B83\u4EEC\uFF0C\u90A3\u53EA\u662F\u610F\u5473\u7740\u4F60\u4E0D\u77E5\u9053\u5B83\u4EEC\u7684\u8BBE\u7F6E\u662F\u4EC0\u4E48\u3002\u7279\u522B\u8981\u8BB0\u4F4F\u5173\u4E8E Keras \u7684\u4E00\u4E2A\u5173\u952E\u70B9\uFF1A\u5982\u679C\u60A8\u4F7F\u7528\u5B57\u7B26\u4E32\u8BBE\u7F6E\u635F\u5931\u51FD\u6570\u3001\u4F18\u5316\u5668\u6216\u6FC0\u6D3B\u51FD\u6570\uFF0C"),ll=m(dn,"EM",{});var uu=u(ll);Fr=e(uu,"\u5B83\u7684\u6240\u6709\u53C2\u6570\u90FD\u5C06\u8BBE\u7F6E\u4E3A\u5B83\u4EEC\u7684\u9ED8\u8BA4\u503C"),uu.forEach(a),Sr=e(dn,"\u3002\u8FD9\u610F\u5473\u7740\u5373\u4F7F\u4E3A\u6B64\u4F7F\u7528\u5B57\u7B26\u4E32\u975E\u5E38\u65B9\u4FBF\uFF0C\u4F46\u5728\u8FD9\u6837\u505A\u65F6\u60A8\u5E94\u8BE5\u975E\u5E38\u5C0F\u5FC3\uFF0C\u56E0\u4E3A\u5B83\u5F88\u5BB9\u6613\u5BF9\u60A8\u9690\u85CF\u5173\u952E\u7684\u4E8B\u60C5\u3002 \uFF08\u4EFB\u4F55\u5C1D\u8BD5\u4E0A\u8FF0\u65B9\u5F0F\u7684\u4EBA\u90FD\u5E94\u8BE5\u4ED4\u7EC6\u6CE8\u610F\u8FD9\u4E00\u4E8B\u5B9E\u3002\uFF09"),dn.forEach(a),Tp=h(s),ks=m(s,"P",{});var Ce=u(ks);Mr=e(Ce,"\u5728\u8FD9\u79CD\u60C5\u51B5\u4E0B\uFF0C\u6211\u4EEC\u5728\u54EA\u91CC\u8BBE\u7F6E\u4E86\u5E26\u6709\u5B57\u7B26\u4E32\u7684\u53C2\u6570\uFF1F\u6211\u4EEC\u6700\u521D\u4F7F\u7528\u5B57\u7B26\u4E32\u8BBE\u7F6E\u635F\u5931\uFF0C\u4F46\u6211\u4EEC\u4E0D\u518D\u8FD9\u6837\u505A\u4E86\u3002\u4F46\u662F\uFF0C\u6211\u4EEC\u6B63\u5728\u4F7F\u7528\u5B57\u7B26\u4E32\u8BBE\u7F6E\u4F18\u5316\u5668\u3002\u96BE\u9053\u8FD9\u5BF9\u6211\u4EEC\u9690\u7792\u4E86\u4EC0\u4E48\uFF1F\u8BA9\u6211\u4EEC\u770B\u770B"),ha=m(Ce,"A",{href:!0,rel:!0});var cu=u(ha);Gr=e(cu,"\u5173\u4E8E\u5B83\u7684\u4E00\u4E9B\u8BA8\u8BBA"),cu.forEach(a),xr=e(Ce,"\u3002"),Ce.forEach(a),Pp=h(s),Ha=m(s,"P",{});var hu=u(Ha);Nr=e(hu,"\u8FD9\u91CC\u6709\u4EC0\u4E48\u9700\u8981\u6CE8\u610F\u7684\u5417\uFF1F\u6CA1\u9519\u2014\u2014\u5B66\u4E60\u7387\uFF01\u5F53\u6211\u4EEC\u53EA\u4F7F\u7528\u5B57\u7B26\u4E32\u201Cadam\u201D\u65F6\uFF0C\u6211\u4EEC\u5C06\u83B7\u5F97\u9ED8\u8BA4\u7684\u5B66\u4E60\u7387\uFF0C\u5373 0.001\uFF0C\u5373 1e-3\u3002\u8FD9\u5BF9\u4E8Etransormer\u6A21\u578B\u6765\u8BF4\u592A\u9AD8\u4E86\uFF01\u4E00\u822C\u6765\u8BF4\uFF0C\u6211\u4EEC\u5EFA\u8BAE\u60A8\u7684\u6A21\u578B\u5C1D\u8BD5 1e-5 \u548C 1e-4 \u4E4B\u95F4\u7684\u5B66\u4E60\u7387\uFF1B\u8FD9\u6BD4\u6211\u4EEC\u5728\u8FD9\u91CC\u5B9E\u9645\u4F7F\u7528\u7684\u503C\u5C0F 10X \u5230 100X \u4E4B\u95F4\u3002\u542C\u8D77\u6765\u8FD9\u53EF\u80FD\u662F\u4E00\u4E2A\u4E3B\u8981\u95EE\u9898\uFF0C\u6240\u4EE5\u8BA9\u6211\u4EEC\u5C1D\u8BD5\u51CF\u5C11\u5B83\u3002\u4E3A\u6B64\uFF0C\u6211\u4EEC\u9700\u8981\u5BFC\u5165\u5B9E\u9645\u7684\u201C\u4F18\u5316\u5668\u201D\u5BF9\u8C61\u3002\u5F53\u6211\u4EEC\u8FD9\u6837\u505A\u7684\u65F6\u5019\uFF0C\u8BA9\u6211\u4EEC\u4ECE\u68C0\u67E5\u70B9\u91CD\u65B0\u521D\u59CB\u5316\u6A21\u578B\uFF0C\u4EE5\u9632\u9AD8\u5B66\u4E60\u7387\u7684\u8BAD\u7EC3\u635F\u574F\u4E86\u5B83\u7684\u6743\u91CD\uFF1A"),hu.forEach(a),Cp=h(s),i(ba.$$.fragment,s),Dp=h(s),i(Ts.$$.fragment,s),Ap=h(s),Ra=m(s,"P",{});var bu=u(Ra);Kr=e(bu,"\u73B0\u5728\uFF0C\u6211\u4EEC\u53EF\u4EE5\u5C1D\u8BD5\u4F7F\u7528\u65B0\u7684\u3001\u6539\u8FDB\u540E\u7684\u5B66\u4E60\u7387\u6765\u62DF\u5408\u6A21\u578B\uFF1A"),bu.forEach(a),Op=h(s),i(ja.$$.fragment,s),qp=h(s),i(oa.$$.fragment,s),zp=h(s),Va=m(s,"P",{});var ju=u(Va);Lr=e(ju,"\u73B0\u5728\u6211\u4EEC\u7684\u635F\u5931\u771F\u7684\u5728\u67D0\u4E2A\u5730\u65B9\uFF01 \u8BAD\u7EC3\u7EC8\u4E8E\u770B\u8D77\u6765\u594F\u6548\u4E86\u3002 \u8FD9\u91CC\u6709\u4E00\u4E2A\u6559\u8BAD\uFF1A\u5F53\u4F60\u7684\u6A21\u578B\u6B63\u5728\u8FD0\u884C\u4F46\u635F\u5931\u6CA1\u6709\u4E0B\u964D\uFF0C\u5E76\u4E14\u4F60\u786E\u5B9A\u4F60\u7684\u6570\u636E\u6CA1\u95EE\u9898\u65F6\uFF0C\u68C0\u67E5\u5B66\u4E60\u7387\u548C\u6743\u91CD\u8870\u51CF\u7B49\u8D85\u53C2\u6570\u662F\u4E2A\u597D\u4E3B\u610F\u3002 \u5C06\u5176\u4E2D\u4EFB\u4F55\u4E00\u4E2A\u8BBE\u7F6E\u5F97\u592A\u9AD8\u5F88\u53EF\u80FD\u5BFC\u81F4\u8BAD\u7EC3\u5728\u9AD8\u635F\u5931\u503C\u4E0B\u201C\u505C\u6EDE\u201D\u3002"),ju.forEach(a),gp=h(s),fa=m(s,"H2",{id:!0});var ou=u(fa);Ur=e(ou,"\u5176\u4ED6\u6F5C\u5728\u95EE\u9898"),ou.forEach(a),Fp=h(s),Xa=m(s,"P",{});var fu=u(Xa);Br=e(fu,"\u6211\u4EEC\u5DF2\u7ECF\u6DB5\u76D6\u4E86\u4E0A\u9762\u811A\u672C\u4E2D\u7684\u95EE\u9898\uFF0C\u4F46\u60A8\u53EF\u80FD\u4F1A\u9047\u5230\u5176\u4ED6\u51E0\u4E2A\u5E38\u89C1\u9519\u8BEF\u3002 \u8BA9\u6211\u4EEC\u770B\u4E00\u4E2A\uFF08\u975E\u5E38\u4E0D\u5B8C\u6574\u7684\uFF09\u5217\u8868\u3002"),fu.forEach(a),Sp=h(s),ia=m(s,"H3",{id:!0});var iu=u(ia);Ir=e(iu,"\u5904\u7406\u5185\u5B58\u4E0D\u8DB3\u9519\u8BEF"),iu.forEach(a),Mp=h(s),Ps=m(s,"P",{});var De=u(Ps);Hr=e(De,"\u5185\u5B58\u4E0D\u8DB3\u7684\u8FF9\u8C61\u662F\u201C\u5206\u914D\u5F20\u91CF\u65F6\u51FA\u73B0 OOM\u201D\u4E4B\u7C7B\u7684\u9519\u8BEF\u2014\u2014OOM \u662F\u201C\u5185\u5B58\u4E0D\u8DB3\u201D\u7684\u7F29\u5199\u3002 \u5728\u5904\u7406\u5927\u578B\u8BED\u8A00\u6A21\u578B\u65F6\uFF0C\u8FD9\u662F\u4E00\u4E2A\u975E\u5E38\u5E38\u89C1\u7684\u5371\u9669\u3002 \u5982\u679C\u9047\u5230\u8FD9\u79CD\u60C5\u51B5\uFF0C\u4E00\u4E2A\u597D\u7684\u7B56\u7565\u662F\u5C06\u6279\u91CF\u5927\u5C0F\u51CF\u534A\u5E76\u91CD\u8BD5\u3002 \u4F46\u8BF7\u8BB0\u4F4F\uFF0C\u6709\u4E9B\u578B\u53F7"),pl=m(De,"EM",{});var du=u(pl);Rr=e(du,"\u975E\u5E38"),du.forEach(a),Vr=e(De,"\u5927\u3002 \u4F8B\u5982\uFF0C\u5168\u5C3A\u5BF8 GPT-2 \u7684\u53C2\u6570\u4E3A 1.5B\uFF0C\u8FD9\u610F\u5473\u7740\u60A8\u5C06\u9700\u8981 6 GB \u7684\u5185\u5B58\u6765\u5B58\u50A8\u6A21\u578B\uFF0C\u53E6\u5916\u9700\u8981 6 GB \u7684\u5185\u5B58\u7528\u4E8E\u68AF\u5EA6\u4E0B\u964D\uFF01 \u65E0\u8BBA\u60A8\u4F7F\u7528\u4EC0\u4E48\u6279\u91CF\u5927\u5C0F\uFF0C\u8BAD\u7EC3\u5B8C\u6574\u7684 GPT-2 \u6A21\u578B\u901A\u5E38\u9700\u8981\u8D85\u8FC7 20 GB \u7684 VRAM\uFF0C\u800C\u53EA\u6709\u5C11\u6570 GPU \u62E5\u6709\u3002 \u50CF\u201Cdistilbert-base-cased\u201D\u8FD9\u6837\u66F4\u8F7B\u91CF\u7EA7\u7684\u6A21\u578B\u66F4\u5BB9\u6613\u8FD0\u884C\uFF0C\u8BAD\u7EC3\u4E5F\u66F4\u5FEB\u3002"),De.forEach(a),Gp=h(s),i(Cs.$$.fragment,s),xp=h(s),es=m(s,"H3",{class:!0});var Ae=u(es);Ds=m(Ae,"A",{id:!0,class:!0,href:!0});var _u=u(Ds);el=m(_u,"SPAN",{});var $u=u(el);i(da.$$.fragment,$u),$u.forEach(a),_u.forEach(a),Xr=h(Ae),rl=m(Ae,"SPAN",{});var vu=u(rl);Jr=e(vu,"TensorFlow \u{1F99B}\u997F\u997F"),vu.forEach(a),Ae.forEach(a),Np=h(s),Z=m(s,"P",{});var _n=u(Z);Wr=e(_n,"\u60A8\u5E94\u8BE5\u6CE8\u610F\u7684 TensorFlow \u7684\u4E00\u4E2A\u7279\u6B8A\u602A\u7656\u662F\uFF0C\u5B83\u4F1A\u5728\u60A8\u52A0\u8F7D\u6A21\u578B\u6216\u8FDB\u884C\u4EFB\u4F55\u8BAD\u7EC3\u540E\u7ACB\u5373\u4E3A\u81EA\u5DF1\u5206\u914D "),tl=m(_n,"EM",{});var Eu=u(tl);Yr=e(Eu,"\u6240\u6709"),Eu.forEach(a),Zr=e(_n," GPU \u5185\u5B58\uFF0C\u7136\u540E\u6839\u636E\u9700\u8981\u5206\u914D\u8BE5\u5185\u5B58\u3002\u8FD9\u4E0E\u5176\u4ED6\u6846\u67B6\u7684\u884C\u4E3A\u4E0D\u540C\uFF0C\u4F8B\u5982 PyTorch\uFF0C\u540E\u8005\u6839\u636E CUDA \u7684\u9700\u8981\u5206\u914D\u5185\u5B58\uFF0C\u800C\u4E0D\u662F\u5728\u5185\u90E8\u8FDB\u884C\u3002 TensorFlow \u65B9\u6CD5\u7684\u4E00\u4E2A\u4F18\u70B9\u662F\uFF0C\u5F53\u60A8\u8017\u5C3D\u5185\u5B58\u65F6\uFF0C\u5B83\u901A\u5E38\u4F1A\u7ED9\u51FA\u6709\u7528\u7684\u9519\u8BEF\uFF0C\u5E76\u4E14\u5B83\u53EF\u4EE5\u4ECE\u8BE5\u72B6\u6001\u6062\u590D\u800C\u4E0D\u4F1A\u5BFC\u81F4\u6574\u4E2A CUDA \u5185\u6838\u5D29\u6E83\u3002\u4F46\u4E5F\u6709\u4E00\u4E2A\u91CD\u8981\u7684\u7F3A\u70B9\uFF1A\u5982\u679C\u4F60\u540C\u65F6\u8FD0\u884C\u4E24\u4E2A TensorFlow \u8FDB\u7A0B\uFF0C\u90A3\u4E48"),ml=m(_n,"STRONG",{});var yu=u(ml);Qr=e(yu,"\u4F60\u5C06\u5EA6\u8FC7\u4E00\u6BB5\u7CDF\u7CD5\u7684\u65F6\u5149"),yu.forEach(a),st=e(_n,"\u3002"),_n.forEach(a),Kp=h(s),Ja=m(s,"P",{});var wu=u(Ja);at=e(wu,"\u5982\u679C\u60A8\u5728 Colab \u4E0A\u8FD0\u884C\uFF0C\u5219\u65E0\u9700\u62C5\u5FC3\u8FD9\u4E00\u70B9\uFF0C\u4F46\u5982\u679C\u60A8\u5728\u672C\u5730\u8FD0\u884C\uFF0C\u8FD9\u7EDD\u5BF9\u662F\u60A8\u5E94\u8BE5\u5C0F\u5FC3\u7684\u4E8B\u60C5\u3002\u7279\u522B\u8981\u6CE8\u610F\uFF0C\u5173\u95ED\u7B14\u8BB0\u672C\u9009\u9879\u5361\u5E76\u4E0D\u4E00\u5B9A\u4F1A\u5173\u95ED\u8BE5\u7B14\u8BB0\u672C\uFF01\u60A8\u53EF\u80FD\u9700\u8981\u9009\u62E9\u6B63\u5728\u8FD0\u884C\u7684\u7B14\u8BB0\u672C\uFF08\u5E26\u6709\u7EFF\u8272\u56FE\u6807\u7684\u7B14\u8BB0\u672C\uFF09\u5E76\u5728\u76EE\u5F55\u5217\u8868\u4E2D\u624B\u52A8\u5173\u95ED\u5B83\u4EEC\u3002\u4EFB\u4F55\u4F7F\u7528 TensorFlow \u7684\u6B63\u5728\u8FD0\u884C\u7684\u7B14\u8BB0\u672C\u4ECD\u53EF\u80FD\u5360\u7528\u5927\u91CF GPU \u5185\u5B58\uFF0C\u8FD9\u610F\u5473\u7740\u60A8\u542F\u52A8\u7684\u4EFB\u4F55\u65B0\u7B14\u8BB0\u672C\u90FD\u53EF\u80FD\u4F1A\u9047\u5230\u4E00\u4E9B\u975E\u5E38\u5947\u602A\u7684\u95EE\u9898\u3002"),wu.forEach(a),Lp=h(s),As=m(s,"P",{});var Oe=u(As);nt=e(Oe,"\u5982\u679C\u60A8\u5F00\u59CB\u8FD0\u884C\u4E4B\u524D\u6B63\u786E\u7684\u4EE3\u7801\u5374\u6536\u5230\u6709\u5173 CUDA\u3001BLAS \u6216 cuBLAS \u7684\u9519\u8BEF\uFF0C\u8FD9\u901A\u5E38\u662F\u7F6A\u9B41\u7978\u9996\u3002\u60A8\u53EF\u4EE5\u4F7F\u7528\u7C7B\u4F3C "),ul=m(Oe,"CODE",{});var ku=u(ul);lt=e(ku,"nvidia-smi"),ku.forEach(a),pt=e(Oe," \u7684\u547D\u4EE4\u6765\u68C0\u67E5 - \u5F53\u60A8\u5173\u95ED\u6216\u91CD\u65B0\u542F\u52A8\u5F53\u524D\u7B14\u8BB0\u672C\u65F6\uFF0C\u60A8\u7684\u5927\u90E8\u5206\u5185\u5B58\u662F\u5426\u7A7A\u95F2\uFF0C\u6216\u8005\u662F\u5426\u4ECD\u5728\u4F7F\u7528\u4E2D\uFF1F\u5982\u679C\u5B83\u4ECD\u5728\u4F7F\u7528\u4E2D\uFF0C\u5219\u6709\u5176\u4ED6\u4E1C\u897F\u5728\u5360\u7528\u5B83\uFF01"),Oe.forEach(a),Up=h(s),_a=m(s,"H3",{id:!0});var Tu=u(_a);et=e(Tu,"\u68C0\u67E5\u60A8\u7684\u6570\u636E\uFF08\u518D\u6B21\uFF01\uFF09"),Tu.forEach(a),Bp=h(s),F=m(s,"P",{});var Q=u(F);rt=e(Q,"\u53EA\u6709\u5728\u7406\u8BBA\u4E0A\u53EF\u4EE5\u4ECE\u60A8\u7684\u6570\u636E\u4E2D\u5B66\u5230\u4EFB\u4F55\u4E1C\u897F\u65F6\uFF0C\u60A8\u7684\u6A21\u578B\u624D\u4F1A\u5B66\u5230\u4E00\u4E9B\u4E1C\u897F\u3002 \u5982\u679C\u5B58\u5728\u635F\u574F\u6570\u636E\u7684\u9519\u8BEF\u6216\u6807\u7B7E\u662F\u968F\u673A\u5C5E\u6027\u7684\uFF0C\u90A3\u4E48\u60A8\u5F88\u53EF\u80FD\u4E0D\u4F1A\u5728\u6570\u636E\u96C6\u4E0A\u83B7\u5F97\u4EFB\u4F55\u77E5\u8BC6\u3002\u8FD9\u91CC\u4E00\u4E2A\u6709\u7528\u7684\u5DE5\u5177\u662F"),cl=m(Q,"CODE",{});var Pu=u(cl);tt=e(Pu,"tokenizer.decode()"),Pu.forEach(a),mt=e(Q,"\u3002 \u8FD9\u4F1A\u5C06 "),hl=m(Q,"CODE",{});var Cu=u(hl);ut=e(Cu,"input_ids"),Cu.forEach(a),ct=e(Q," \u8F6C\u6362\u56DE\u5B57\u7B26\u4E32\uFF0C\u56E0\u6B64\u60A8\u53EF\u4EE5\u67E5\u770B\u6570\u636E\u5E76\u67E5\u770B\u60A8\u7684\u8BAD\u7EC3\u6570\u636E\u662F\u5426\u6B63\u5728\u6559\u6388\u60A8\u5E0C\u671B\u5B83\u6559\u6388\u7684\u5185\u5BB9\u3002 \u4F8B\u5982\uFF0C\u50CF\u6211\u4EEC\u4E0A\u9762\u6240\u505A\u7684\u90A3\u6837\u4ECE "),bl=m(Q,"CODE",{});var Du=u(bl);ht=e(Du,"tf.data.Dataset"),Du.forEach(a),bt=e(Q," \u4E2D\u83B7\u53D6 "),jl=m(Q,"CODE",{});var Au=u(jl);jt=e(Au,"batch"),Au.forEach(a),ot=e(Q," \u540E\uFF0C\u60A8\u53EF\u4EE5\u50CF\u8FD9\u6837\u89E3\u7801\u7B2C\u4E00\u4E2A\u5143\u7D20\uFF1A"),Q.forEach(a),Ip=h(s),i($a.$$.fragment,s),Hp=h(s),Wa=m(s,"P",{});var Ou=u(Wa);ft=e(Ou,"Then you can compare it with the first label, like so:"),Ou.forEach(a),Rp=h(s),i(va.$$.fragment,s),Vp=h(s),Ya=m(s,"P",{});var qu=u(Ya);it=e(qu,"\u4E00\u65E6\u60A8\u53EF\u4EE5\u50CF\u8FD9\u6837\u67E5\u770B\u60A8\u7684\u6570\u636E\uFF0C\u60A8\u53EF\u4EE5\u95EE\u81EA\u5DF1\u4EE5\u4E0B\u95EE\u9898\uFF1A"),qu.forEach(a),Xp=h(s),N=m(s,"UL",{});var Fs=u(N);ol=m(Fs,"LI",{});var zu=u(ol);dt=e(zu,"\u89E3\u7801\u540E\u7684\u6570\u636E\u662F\u5426\u53EF\u4EE5\u7406\u89E3\uFF1F"),zu.forEach(a),_t=h(Fs),fl=m(Fs,"LI",{});var gu=u(fl);$t=e(gu,"\u4F60\u8BA4\u540C\u8FD9\u4E9B\u6807\u7B7E\u5417\uFF1F"),gu.forEach(a),vt=h(Fs),il=m(Fs,"LI",{});var Fu=u(il);Et=e(Fu,"\u6709\u6CA1\u6709\u4E00\u4E2A\u6807\u7B7E\u6BD4\u5176\u4ED6\u6807\u7B7E\u66F4\u5E38\u89C1\uFF1F"),Fu.forEach(a),yt=h(Fs),dl=m(Fs,"LI",{});var Su=u(dl);wt=e(Su,"\u5982\u679C\u6A21\u578B\u9884\u6D4B\u968F\u673A\u7684\u7B54\u6848/\u603B\u662F\u76F8\u540C\u7684\u7B54\u6848\uFF0C\u90A3\u4E48loss/\u8BC4\u4F30\u6307\u6807\u5E94\u8BE5\u662F\u591A\u5C11\uFF1F"),Su.forEach(a),Fs.forEach(a),Jp=h(s),Za=m(s,"P",{});var Mu=u(Za);kt=e(Mu,"\u67E5\u770B\u60A8\u7684\u6570\u636E\u540E\uFF0C\u67E5\u770B\u6A21\u578B\u7684\u4E00\u4E9B\u9884\u6D4B\u5E76\u5BF9\u5176\u8FDB\u884C\u89E3\u7801\u3002 \u5982\u679C\u6A21\u578B\u603B\u662F\u9884\u6D4B\u540C\u6837\u7684\u4E8B\u60C5\uFF0C\u90A3\u53EF\u80FD\u662F\u56E0\u4E3A\u4F60\u7684\u6570\u636E\u96C6\u504F\u5411\u4E00\u4E2A\u7C7B\u522B\uFF08\u9488\u5BF9\u5206\u7C7B\u95EE\u9898\uFF09\uFF1B \u8FC7\u91C7\u6837\u7A00\u6709\u7C7B\u7B49\u6280\u672F\u53EF\u80FD\u4F1A\u6709\u6240\u5E2E\u52A9\u3002"),Mu.forEach(a),Wp=h(s),Qa=m(s,"P",{});var Gu=u(Qa);Tt=e(Gu,"\u5982\u679C\u60A8\u5728\u521D\u59CB\u6A21\u578B\u4E0A\u83B7\u5F97\u7684loss/\u8BC4\u4F30\u6307\u6807\u4E0E\u60A8\u671F\u671B\u7684\u968F\u673A\u9884\u6D4B\u7684loss/\u8BC4\u4F30\u6307\u6807\u975E\u5E38\u4E0D\u540C\uFF0C\u8BF7\u4ED4\u7EC6\u68C0\u67E5\u60A8\u7684loss\u6216\u8BC4\u4F30\u6307\u6807\u7684\u8BA1\u7B97\u65B9\u5F0F\uFF0C\u56E0\u4E3A\u90A3\u91CC\u53EF\u80FD\u5B58\u5728\u9519\u8BEF\u3002 \u5982\u679C\u60A8\u4F7F\u7528\u6700\u540E\u6DFB\u52A0\u7684\u591A\u4E2Aloss\uFF0C\u8BF7\u786E\u4FDD\u5B83\u4EEC\u5177\u6709\u76F8\u540C\u7684\u89C4\u6A21\u3002"),Gu.forEach(a),Yp=h(s),sn=m(s,"P",{});var xu=u(sn);Pt=e(xu,"\u5F53\u60A8\u786E\u5B9A\u60A8\u7684\u6570\u636E\u662F\u5B8C\u7F8E\u7684\u65F6\uFF0C\u60A8\u53EF\u4EE5\u901A\u8FC7\u4E00\u4E2A\u7B80\u5355\u7684\u6D4B\u8BD5\u6765\u67E5\u770B\u6A21\u578B\u662F\u5426\u80FD\u591F\u5BF9\u5176\u8FDB\u884C\u8BAD\u7EC3\u3002"),xu.forEach(a),Zp=h(s),Ea=m(s,"H3",{id:!0});var Nu=u(Ea);Ct=e(Nu,"\u5728\u4E00\u6279\u4E0A\u8FC7\u5EA6\u62DF\u5408\u4F60\u7684\u6A21\u578B"),Nu.forEach(a),Qp=h(s),an=m(s,"P",{});var Ku=u(an);Dt=e(Ku,"\u8FC7\u5EA6\u62DF\u5408\u901A\u5E38\u662F\u6211\u4EEC\u5728\u8BAD\u7EC3\u65F6\u5C3D\u91CF\u907F\u514D\u7684\u4E8B\u60C5\uFF0C\u56E0\u4E3A\u8FD9\u610F\u5473\u7740\u6A21\u578B\u6CA1\u6709\u5B66\u4E60\u8BC6\u522B\u6211\u4EEC\u60F3\u8981\u7684\u4E00\u822C\u7279\u5F81\uFF0C\u800C\u53EA\u662F\u8BB0\u4F4F\u4E86\u8BAD\u7EC3\u6837\u672C\u3002 \u4F46\u662F\uFF0C\u4E00\u904D\u53C8\u4E00\u904D\u5730\u5C1D\u8BD5\u5728\u4E00\u4E2A\u6279\u6B21\u4E0A\u8BAD\u7EC3\u60A8\u7684\u6A21\u578B\u662F\u4E00\u4E2A\u5F88\u597D\u7684\u6D4B\u8BD5\uFF0C\u53EF\u4EE5\u68C0\u67E5\u60A8\u6784\u5EFA\u7684\u95EE\u9898\u662F\u5426\u53EF\u4EE5\u901A\u8FC7\u60A8\u5C1D\u8BD5\u8BAD\u7EC3\u7684\u6A21\u578B\u6765\u89E3\u51B3\u3002 \u5B83\u8FD8\u5C06\u5E2E\u52A9\u60A8\u67E5\u770B\u60A8\u7684\u521D\u59CB\u5B66\u4E60\u7387\u662F\u5426\u592A\u9AD8\u3002"),Ku.forEach(a),se=h(s),nn=m(s,"P",{});var Lu=u(nn);At=e(Lu,"\u4E00\u65E6\u4F60\u5B9A\u4E49\u4E86\u4F60\u7684\u201C\u6A21\u578B\u201D\uFF0C\u8FD9\u6837\u505A\u771F\u7684\u5F88\u5BB9\u6613\uFF1B \u53EA\u9700\u83B7\u53D6\u4E00\u6279\u8BAD\u7EC3\u6570\u636E\uFF0C\u7136\u540E\u5C06\u8BE5\u201C\u6279\u6B21\u201D\u89C6\u4E3A\u60A8\u7684\u6574\u4E2A\u6570\u636E\u96C6\uFF0C\u5E76\u5728\u5176\u4E0Afit\u5927\u91CFepoch\uFF1A"),Lu.forEach(a),ae=h(s),i(ya.$$.fragment,s),ne=h(s),i(Os.$$.fragment,s),le=h(s),ln=m(s,"P",{});var Uu=u(ln);Ot=e(Uu,"\u751F\u6210\u7684\u6A21\u578B\u5728\u201C\u6279\u6B21\u201D\u4E0A\u5E94\u8BE5\u6709\u63A5\u8FD1\u5B8C\u7F8E\u7684\u7ED3\u679C\uFF0C\u635F\u5931\u8FC5\u901F\u4E0B\u964D\u5230 0\uFF08\u6216\u60A8\u6B63\u5728\u4F7F\u7528\u7684\u635F\u5931\u7684\u6700\u5C0F\u503C\uFF09\u3002"),Uu.forEach(a),pe=h(s),pn=m(s,"P",{});var Bu=u(pn);qt=e(Bu,"\u5982\u679C\u4F60\u6CA1\u6709\u8BBE\u6CD5\u8BA9\u4F60\u7684\u6A21\u578B\u83B7\u5F97\u8FD9\u6837\u7684\u5B8C\u7F8E\u7ED3\u679C\uFF0C\u8FD9\u610F\u5473\u7740\u4F60\u6784\u5EFA\u95EE\u9898\u6216\u6570\u636E\u7684\u65B9\u5F0F\u6709\u95EE\u9898\uFF0C\u6240\u4EE5\u4F60\u5E94\u8BE5\u4FEE\u590D\u5B83\u3002 \u53EA\u6709\u5F53\u4F60\u8BBE\u6CD5\u901A\u8FC7\u8FC7\u62DF\u5408\u6D4B\u8BD5\u65F6\uFF0C\u4F60\u624D\u80FD\u786E\u5B9A\u4F60\u7684\u6A21\u578B\u5B9E\u9645\u4E0A\u53EF\u4EE5\u5B66\u5230\u4E00\u4E9B\u4E1C\u897F\u3002"),Bu.forEach(a),ee=h(s),i(qs.$$.fragment,s),re=h(s),wa=m(s,"H3",{id:!0});var Iu=u(wa);zt=e(Iu,"\u5728\u4F60\u6709\u7B2C\u4E00\u4E2A\u57FA\u7EBF\u4E4B\u524D\u4E0D\u8981\u8C03\u6574\u4EFB\u4F55\u4E1C\u897F"),Iu.forEach(a),te=h(s),en=m(s,"P",{});var Hu=u(en);gt=e(Hu,"\u8D85\u53C2\u6570\u8C03\u6574\u603B\u662F\u88AB\u5F3A\u8C03\u4E3A\u673A\u5668\u5B66\u4E60\u4E2D\u6700\u96BE\u7684\u90E8\u5206\uFF0C\u4F46\u8FD9\u53EA\u662F\u5E2E\u52A9\u60A8\u5728\u6307\u6807\u4E0A\u83B7\u5F97\u4E00\u70B9\u70B9\u63D0\u5347\u7684\u6700\u540E\u4E00\u6B65\u3002 \u4F8B\u5982\u5C06\u9ED8\u8BA4\u7684 Adam \u5B66\u4E60\u7387 1e-3 \u4E0E Transformer \u6A21\u578B\u4E00\u8D77\u4F7F\u7528\uFF0C\u5F53\u7136\u4F1A\u4F7F\u5B66\u4E60\u8FDB\u884C\u5F97\u975E\u5E38\u7F13\u6162\u6216\u5B8C\u5168\u505C\u6B62\uFF0C\u4F46\u5927\u591A\u6570\u65F6\u5019\u201C\u5408\u7406\u201D\u7684\u8D85\u53C2\u6570\uFF0C\u4F8B\u5982\u4ECE 1e-5 \u5230 5e-5 \u7684\u5B66\u4E60\u7387\uFF0C\u4F1A\u5F88\u597D\u5730\u7ED9\u4F60\u5E26\u6765\u597D\u7684\u7ED3\u679C\u3002\u56E0\u6B64\uFF0C\u5728\u60A8\u83B7\u5F97\u8D85\u51FA\u6570\u636E\u96C6\u57FA\u7EBF\u7684\u4E1C\u897F\u4E4B\u524D\uFF0C\u4E0D\u8981\u5F00\u59CB\u8FDB\u884C\u8017\u65F6\u4E14\u6602\u8D35\u7684\u8D85\u53C2\u6570\u641C\u7D22\u3002"),Hu.forEach(a),me=h(s),rn=m(s,"P",{});var Ru=u(rn);Ft=e(Ru,"\u4E00\u65E6\u4F60\u6709\u4E00\u4E2A\u8DB3\u591F\u597D\u7684\u6A21\u578B\uFF0C\u4F60\u5C31\u53EF\u4EE5\u5F00\u59CB\u7A0D\u5FAE\u8C03\u6574\u4E00\u4E0B\u3002 \u4E0D\u8981\u5C1D\u8BD5\u4F7F\u7528\u4E0D\u540C\u7684\u8D85\u53C2\u6570\u542F\u52A8\u4E00\u5343\u6B21\u8FD0\u884C\uFF0C\u800C\u662F\u6BD4\u8F83\u4E00\u4E2A\u8D85\u53C2\u6570\u7684\u4E0D\u540C\u503C\u7684\u51E0\u6B21\u8FD0\u884C\uFF0C\u4EE5\u4E86\u89E3\u54EA\u4E2A\u5F71\u54CD\u6700\u5927\u3002"),Ru.forEach(a),ue=h(s),tn=m(s,"P",{});var Vu=u(tn);St=e(Vu,"\u5982\u679C\u60A8\u6B63\u5728\u8C03\u6574\u6A21\u578B\u672C\u8EAB\uFF0C\u4E0D\u8981\u5C1D\u8BD5\u4EFB\u4F55\u60A8\u65E0\u6CD5\u5408\u7406\u8BC1\u660E\u7684\u4E8B\u60C5\u3002 \u59CB\u7EC8\u786E\u4FDD\u60A8\u8FD4\u56DE\u8FC7\u62DF\u5408\u6D4B\u8BD5\u4EE5\u9A8C\u8BC1\u60A8\u7684\u66F4\u6539\u6CA1\u6709\u4EA7\u751F\u4EFB\u4F55\u610F\u5916\u540E\u679C\u3002"),Vu.forEach(a),ce=h(s),ka=m(s,"H3",{id:!0});var Xu=u(ka);Mt=e(Xu,"\u8BF7\u6C42\u5E2E\u5FD9"),Xu.forEach(a),he=h(s),zs=m(s,"P",{});var qe=u(zs);Gt=e(qe,"\u5E0C\u671B\u60A8\u4F1A\u5728\u672C\u8282\u4E2D\u627E\u5230\u4E00\u4E9B\u53EF\u4EE5\u5E2E\u52A9\u60A8\u89E3\u51B3\u95EE\u9898\u7684\u5EFA\u8BAE\uFF0C\u4F46\u5982\u679C\u4E0D\u662F\u8FD9\u6837\uFF0C\u8BF7\u8BB0\u4F4F\u60A8\u53EF\u4EE5\u968F\u65F6\u5728 "),Ta=m(qe,"A",{href:!0,rel:!0});var Ju=u(Ta);xt=e(Ju,"\u8BBA\u575B"),Ju.forEach(a),Nt=e(qe," \u4E0A\u5411\u793E\u533A\u63D0\u95EE\u3002"),qe.forEach(a),be=h(s),mn=m(s,"P",{});var Wu=u(mn);Kt=e(Wu,"\u4EE5\u4E0B\u662F\u4E00\u4E9B\u53EF\u80FD\u6709\u7528\u7684\u989D\u5916\u8D44\u6E90\uFF1A"),Wu.forEach(a),je=h(s),K=m(s,"UL",{});var Ss=u(K);un=m(Ss,"LI",{});var sm=u(un);Pa=m(sm,"A",{href:!0,rel:!0});var Yu=u(Pa);Lt=e(Yu,"\u201C\u4F5C\u4E3A\u5DE5\u7A0B\u6700\u4F73\u5B9E\u8DF5\u5DE5\u5177\u7684\u518D\u73B0\u6027\u201D"),Yu.forEach(a),Ut=e(sm,"\uFF0C\u4F5C\u8005\uFF1AJoel Grus"),sm.forEach(a),Bt=h(Ss),cn=m(Ss,"LI",{});var am=u(cn);Ca=m(am,"A",{href:!0,rel:!0});var Zu=u(Ca);It=e(Zu,"\u201C\u795E\u7ECF\u7F51\u7EDC\u8C03\u8BD5\u6E05\u5355\u201D"),Zu.forEach(a),Ht=e(am," \u4F5C\u8005\uFF1ACecelia Shao"),am.forEach(a),Rt=h(Ss),hn=m(Ss,"LI",{});var nm=u(hn);Da=m(nm,"A",{href:!0,rel:!0});var Qu=u(Da);Vt=e(Qu,"\u201C\u5982\u4F55\u5BF9\u673A\u5668\u5B66\u4E60\u4EE3\u7801\u8FDB\u884C\u5355\u5143\u6D4B\u8BD5\u201D"),Qu.forEach(a),Xt=e(nm," by Chase Roberts"),nm.forEach(a),Jt=h(Ss),bn=m(Ss,"LI",{});var lm=u(bn);Aa=m(lm,"A",{href:!0,rel:!0});var sc=u(Aa);Wt=e(sc,"\u201C\u8BAD\u7EC3\u795E\u7ECF\u7F51\u7EDC\u7684\u79D8\u8BC0\u201D"),sc.forEach(a),Yt=e(lm,"\u4F5C\u8005\uFF1AAndrej Karpathy"),lm.forEach(a),Ss.forEach(a),oe=h(s),jn=m(s,"P",{});var ac=u(jn);Zt=e(ac,"\u5F53\u7136\uFF0C\u5E76\u4E0D\u662F\u4F60\u5728\u8BAD\u7EC3\u795E\u7ECF\u7F51\u7EDC\u65F6\u9047\u5230\u7684\u6BCF\u4E00\u4E2A\u95EE\u9898\u90FD\u662F\u4F60\u81EA\u5DF1\u7684\u9519\uFF01 \u5982\u679C\u60A8\u5728 \u{1F917} Transformers \u6216 \u{1F917} Datasets \u5E93\u4E2D\u9047\u5230\u770B\u8D77\u6765\u4E0D\u6B63\u786E\u7684\u5185\u5BB9\uFF0C\u60A8\u53EF\u80FD\u9047\u5230\u4E86\u9519\u8BEF\u3002 \u4F60\u5E94\u8BE5\u544A\u8BC9\u6211\u4EEC\u8FD9\u4E00\u5207\uFF0C\u5728\u4E0B\u4E00\u8282\u4E2D\uFF0C\u6211\u4EEC\u5C06\u51C6\u786E\u89E3\u91CA\u5982\u4F55\u505A\u5230\u8FD9\u4E00\u70B9\u3002"),ac.forEach(a),this.h()},h(){o(b,"name","hf:doc:metadata"),o(b,"content",JSON.stringify(ic)),o(P,"id","debugging-the-training-pipeline"),o(P,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(P,"href","#debugging-the-training-pipeline"),o(A,"class","relative group"),o(H,"href","/course/chapter7"),o(T,"id","debugging-the-training-pipeline"),o(T,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(T,"href","#debugging-the-training-pipeline"),o(y,"class","relative group"),o(Ns,"href","https://huggingface.co/datasets/glue"),o(Ns,"rel","nofollow"),o(Ks,"href","https://huggingface.co/datasets/glue"),o(Ks,"rel","nofollow"),o(Bs,"id",""),o(Js,"id",""),o(ca,"id",""),o(ha,"href","https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/Adam"),o(ha,"rel","nofollow"),o(fa,"id",""),o(ia,"id",""),o(Ds,"id","tensorflow"),o(Ds,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),o(Ds,"href","#tensorflow"),o(es,"class","relative group"),o(_a,"id",""),o(Ea,"id",""),o(wa,"id",""),o(ka,"id",""),o(Ta,"href","https://discuss.huggingface.co/"),o(Ta,"rel","nofollow"),o(Pa,"href","https://docs.google.com/presentation/d/1yHLPvPhUs2KGI5ZWo0sU-PKU3GimAk3iTsI38Z-B5Gw/edit#slide=id.p"),o(Pa,"rel","nofollow"),o(Ca,"href","https://towardsdatascience.com/checklist-for-debugging-neural-networks-d8b2a9434f21"),o(Ca,"rel","nofollow"),o(Da,"href","https://medium.com/@keeper6928/how-to-unit-test-machine-learning-code-57cf6fd81765"),o(Da,"rel","nofollow"),o(Aa,"href","http://karpathy.github.io/2019/04/25/recipe/"),o(Aa,"rel","nofollow")},m(s,l){n(document.head,b),r(s,w,l),d(j,s,l),r(s,E,l),r(s,A,l),n(A,P),n(P,O),d(g,O,null),n(A,ss),n(A,as),n(as,Ms),r(s,I,l),d(L,s,l),r(s,ts,l),r(s,z,l),n(z,G),n(z,H),n(H,ns),n(z,Gs),n(z,ls),n(ls,ms),n(z,R),r(s,us,l),r(s,y,l),n(y,T),n(T,cs),d(V,cs,null),n(y,ga),n(y,hs),n(hs,bs),r(s,xs,l),d(X,s,l),r(s,kl,l),r(s,js,l),n(js,ze),n(js,$n),n($n,ge),n(js,Fe),r(s,Tl,l),r(s,os,l),n(os,Se),n(os,vn),n(vn,Me),n(os,Ge),r(s,Pl,l),r(s,fs,l),n(fs,xe),n(fs,Ns),n(Ns,Ne),n(fs,Ke),r(s,Cl,l),r(s,is,l),n(is,Le),n(is,En),n(En,Ue),n(is,Be),r(s,Dl,l),r(s,ds,l),n(ds,Ie),n(ds,yn),n(yn,He),n(ds,Re),r(s,Al,l),r(s,_s,l),n(_s,Ve),n(_s,Ks),n(Ks,Xe),n(_s,Je),r(s,Ol,l),d(Ls,s,l),r(s,ql,l),r(s,Fa,l),n(Fa,We),r(s,zl,l),r(s,Sa,l),n(Sa,Ye),r(s,gl,l),d(Us,s,l),r(s,Fl,l),r(s,Ma,l),n(Ma,Ze),r(s,Sl,l),r(s,Bs,l),n(Bs,Qe),r(s,Ml,l),r(s,Ga,l),n(Ga,s0),r(s,Gl,l),r(s,D,l),n(D,a0),n(D,wn),n(wn,n0),n(D,l0),n(D,kn),n(kn,p0),n(D,e0),n(D,Tn),n(Tn,r0),n(D,t0),n(D,Pn),n(Pn,m0),n(D,u0),n(D,Cn),n(Cn,c0),n(D,h0),n(D,Dn),n(Dn,b0),n(D,j0),r(s,xl,l),d(Is,s,l),r(s,Nl,l),r(s,U,l),n(U,An),n(An,o0),n(U,f0),n(U,On),n(On,i0),n(U,d0),n(U,qn),n(qn,_0),n(U,$0),r(s,Kl,l),d(Hs,s,l),r(s,Ll,l),r(s,x,l),n(x,v0),n(x,zn),n(zn,E0),n(x,y0),n(x,gn),n(gn,w0),n(x,k0),n(x,Fn),n(Fn,T0),n(x,P0),r(s,Ul,l),r(s,$s,l),n($s,C0),n($s,Sn),n(Sn,D0),n($s,A0),r(s,Bl,l),r(s,vs,l),n(vs,O0),n(vs,Mn),n(Mn,q0),n(vs,z0),r(s,Il,l),d(Rs,s,l),r(s,Hl,l),r(s,xa,l),n(xa,g0),r(s,Rl,l),d(Es,s,l),r(s,Vl,l),r(s,ys,l),n(ys,F0),n(ys,Gn),n(Gn,S0),n(ys,M0),r(s,Xl,l),d(Vs,s,l),r(s,Jl,l),r(s,Na,l),n(Na,G0),r(s,Wl,l),r(s,Xs,l),n(Xs,xn),n(xn,x0),n(Xs,N0),r(s,Yl,l),r(s,Js,l),n(Js,K0),r(s,Zl,l),r(s,B,l),n(B,Nn),n(Nn,L0),n(B,U0),n(B,Kn),n(Kn,B0),n(B,I0),n(B,Ln),n(Ln,H0),n(B,R0),r(s,Ql,l),r(s,ws,l),n(ws,V0),n(ws,Un),n(Un,X0),n(ws,J0),r(s,sp,l),d(Ws,s,l),r(s,ap,l),d(Ys,s,l),r(s,np,l),r(s,C,l),n(C,W0),n(C,Bn),n(Bn,Y0),n(C,Z0),n(C,In),n(In,Q0),n(C,sr),n(C,Hn),n(Hn,ar),n(C,nr),n(C,Rn),n(Rn,lr),n(C,pr),n(C,Vn),n(Vn,er),n(C,rr),n(C,Xn),n(Xn,tr),n(C,mr),n(C,Jn),n(Jn,ur),n(C,cr),r(s,lp,l),r(s,J,l),n(J,hr),n(J,Wn),n(Wn,br),n(J,jr),n(J,Yn),n(Yn,or),n(J,fr),r(s,pp,l),d(Zs,s,l),r(s,ep,l),r(s,Ka,l),n(Ka,ir),r(s,rp,l),d(Qs,s,l),r(s,tp,l),r(s,ps,l),n(ps,Zn),n(Zn,dr),n(ps,_r),n(ps,Qn),n(Qn,$r),n(ps,vr),r(s,mp,l),d(sa,s,l),r(s,up,l),d(aa,s,l),r(s,cp,l),r(s,La,l),n(La,Er),r(s,hp,l),d(na,s,l),r(s,bp,l),d(la,s,l),r(s,jp,l),r(s,Ua,l),n(Ua,yr),r(s,op,l),d(pa,s,l),r(s,fp,l),d(ea,s,l),r(s,ip,l),r(s,W,l),n(W,wr),n(W,sl),n(sl,kr),n(W,Tr),n(W,al),n(al,Pr),n(W,Cr),r(s,dp,l),d(ra,s,l),r(s,_p,l),d(ta,s,l),r(s,$p,l),r(s,Ba,l),n(Ba,Dr),r(s,vp,l),d(ma,s,l),r(s,Ep,l),d(ua,s,l),r(s,yp,l),r(s,Ia,l),n(Ia,Ar),r(s,wp,l),r(s,ca,l),n(ca,Or),r(s,kp,l),r(s,Y,l),n(Y,qr),n(Y,nl),n(nl,zr),n(Y,gr),n(Y,ll),n(ll,Fr),n(Y,Sr),r(s,Tp,l),r(s,ks,l),n(ks,Mr),n(ks,ha),n(ha,Gr),n(ks,xr),r(s,Pp,l),r(s,Ha,l),n(Ha,Nr),r(s,Cp,l),d(ba,s,l),r(s,Dp,l),d(Ts,s,l),r(s,Ap,l),r(s,Ra,l),n(Ra,Kr),r(s,Op,l),d(ja,s,l),r(s,qp,l),d(oa,s,l),r(s,zp,l),r(s,Va,l),n(Va,Lr),r(s,gp,l),r(s,fa,l),n(fa,Ur),r(s,Fp,l),r(s,Xa,l),n(Xa,Br),r(s,Sp,l),r(s,ia,l),n(ia,Ir),r(s,Mp,l),r(s,Ps,l),n(Ps,Hr),n(Ps,pl),n(pl,Rr),n(Ps,Vr),r(s,Gp,l),d(Cs,s,l),r(s,xp,l),r(s,es,l),n(es,Ds),n(Ds,el),d(da,el,null),n(es,Xr),n(es,rl),n(rl,Jr),r(s,Np,l),r(s,Z,l),n(Z,Wr),n(Z,tl),n(tl,Yr),n(Z,Zr),n(Z,ml),n(ml,Qr),n(Z,st),r(s,Kp,l),r(s,Ja,l),n(Ja,at),r(s,Lp,l),r(s,As,l),n(As,nt),n(As,ul),n(ul,lt),n(As,pt),r(s,Up,l),r(s,_a,l),n(_a,et),r(s,Bp,l),r(s,F,l),n(F,rt),n(F,cl),n(cl,tt),n(F,mt),n(F,hl),n(hl,ut),n(F,ct),n(F,bl),n(bl,ht),n(F,bt),n(F,jl),n(jl,jt),n(F,ot),r(s,Ip,l),d($a,s,l),r(s,Hp,l),r(s,Wa,l),n(Wa,ft),r(s,Rp,l),d(va,s,l),r(s,Vp,l),r(s,Ya,l),n(Ya,it),r(s,Xp,l),r(s,N,l),n(N,ol),n(ol,dt),n(N,_t),n(N,fl),n(fl,$t),n(N,vt),n(N,il),n(il,Et),n(N,yt),n(N,dl),n(dl,wt),r(s,Jp,l),r(s,Za,l),n(Za,kt),r(s,Wp,l),r(s,Qa,l),n(Qa,Tt),r(s,Yp,l),r(s,sn,l),n(sn,Pt),r(s,Zp,l),r(s,Ea,l),n(Ea,Ct),r(s,Qp,l),r(s,an,l),n(an,Dt),r(s,se,l),r(s,nn,l),n(nn,At),r(s,ae,l),d(ya,s,l),r(s,ne,l),d(Os,s,l),r(s,le,l),r(s,ln,l),n(ln,Ot),r(s,pe,l),r(s,pn,l),n(pn,qt),r(s,ee,l),d(qs,s,l),r(s,re,l),r(s,wa,l),n(wa,zt),r(s,te,l),r(s,en,l),n(en,gt),r(s,me,l),r(s,rn,l),n(rn,Ft),r(s,ue,l),r(s,tn,l),n(tn,St),r(s,ce,l),r(s,ka,l),n(ka,Mt),r(s,he,l),r(s,zs,l),n(zs,Gt),n(zs,Ta),n(Ta,xt),n(zs,Nt),r(s,be,l),r(s,mn,l),n(mn,Kt),r(s,je,l),r(s,K,l),n(K,un),n(un,Pa),n(Pa,Lt),n(un,Ut),n(K,Bt),n(K,cn),n(cn,Ca),n(Ca,It),n(cn,Ht),n(K,Rt),n(K,hn),n(hn,Da),n(Da,Vt),n(hn,Xt),n(K,Jt),n(K,bn),n(bn,Aa),n(Aa,Wt),n(bn,Yt),r(s,oe,l),r(s,jn,l),n(jn,Zt),fe=!0},p(s,[l]){const Oa={};l&1&&(Oa.fw=s[0]),j.$set(Oa);const _l={};l&2&&(_l.$$scope={dirty:l,ctx:s}),Es.$set(_l);const $l={};l&2&&($l.$$scope={dirty:l,ctx:s}),Ts.$set($l);const vl={};l&2&&(vl.$$scope={dirty:l,ctx:s}),Cs.$set(vl);const rs={};l&2&&(rs.$$scope={dirty:l,ctx:s}),Os.$set(rs);const El={};l&2&&(El.$$scope={dirty:l,ctx:s}),qs.$set(El)},i(s){fe||(_(j.$$.fragment,s),_(g.$$.fragment,s),_(L.$$.fragment,s),_(V.$$.fragment,s),_(X.$$.fragment,s),_(Ls.$$.fragment,s),_(Us.$$.fragment,s),_(Is.$$.fragment,s),_(Hs.$$.fragment,s),_(Rs.$$.fragment,s),_(Es.$$.fragment,s),_(Vs.$$.fragment,s),_(Ws.$$.fragment,s),_(Ys.$$.fragment,s),_(Zs.$$.fragment,s),_(Qs.$$.fragment,s),_(sa.$$.fragment,s),_(aa.$$.fragment,s),_(na.$$.fragment,s),_(la.$$.fragment,s),_(pa.$$.fragment,s),_(ea.$$.fragment,s),_(ra.$$.fragment,s),_(ta.$$.fragment,s),_(ma.$$.fragment,s),_(ua.$$.fragment,s),_(ba.$$.fragment,s),_(Ts.$$.fragment,s),_(ja.$$.fragment,s),_(oa.$$.fragment,s),_(Cs.$$.fragment,s),_(da.$$.fragment,s),_($a.$$.fragment,s),_(va.$$.fragment,s),_(ya.$$.fragment,s),_(Os.$$.fragment,s),_(qs.$$.fragment,s),fe=!0)},o(s){$(j.$$.fragment,s),$(g.$$.fragment,s),$(L.$$.fragment,s),$(V.$$.fragment,s),$(X.$$.fragment,s),$(Ls.$$.fragment,s),$(Us.$$.fragment,s),$(Is.$$.fragment,s),$(Hs.$$.fragment,s),$(Rs.$$.fragment,s),$(Es.$$.fragment,s),$(Vs.$$.fragment,s),$(Ws.$$.fragment,s),$(Ys.$$.fragment,s),$(Zs.$$.fragment,s),$(Qs.$$.fragment,s),$(sa.$$.fragment,s),$(aa.$$.fragment,s),$(na.$$.fragment,s),$(la.$$.fragment,s),$(pa.$$.fragment,s),$(ea.$$.fragment,s),$(ra.$$.fragment,s),$(ta.$$.fragment,s),$(ma.$$.fragment,s),$(ua.$$.fragment,s),$(ba.$$.fragment,s),$(Ts.$$.fragment,s),$(ja.$$.fragment,s),$(oa.$$.fragment,s),$(Cs.$$.fragment,s),$(da.$$.fragment,s),$($a.$$.fragment,s),$(va.$$.fragment,s),$(ya.$$.fragment,s),$(Os.$$.fragment,s),$(qs.$$.fragment,s),fe=!1},d(s){a(b),s&&a(w),v(j,s),s&&a(E),s&&a(A),v(g),s&&a(I),v(L,s),s&&a(ts),s&&a(z),s&&a(us),s&&a(y),v(V),s&&a(xs),v(X,s),s&&a(kl),s&&a(js),s&&a(Tl),s&&a(os),s&&a(Pl),s&&a(fs),s&&a(Cl),s&&a(is),s&&a(Dl),s&&a(ds),s&&a(Al),s&&a(_s),s&&a(Ol),v(Ls,s),s&&a(ql),s&&a(Fa),s&&a(zl),s&&a(Sa),s&&a(gl),v(Us,s),s&&a(Fl),s&&a(Ma),s&&a(Sl),s&&a(Bs),s&&a(Ml),s&&a(Ga),s&&a(Gl),s&&a(D),s&&a(xl),v(Is,s),s&&a(Nl),s&&a(U),s&&a(Kl),v(Hs,s),s&&a(Ll),s&&a(x),s&&a(Ul),s&&a($s),s&&a(Bl),s&&a(vs),s&&a(Il),v(Rs,s),s&&a(Hl),s&&a(xa),s&&a(Rl),v(Es,s),s&&a(Vl),s&&a(ys),s&&a(Xl),v(Vs,s),s&&a(Jl),s&&a(Na),s&&a(Wl),s&&a(Xs),s&&a(Yl),s&&a(Js),s&&a(Zl),s&&a(B),s&&a(Ql),s&&a(ws),s&&a(sp),v(Ws,s),s&&a(ap),v(Ys,s),s&&a(np),s&&a(C),s&&a(lp),s&&a(J),s&&a(pp),v(Zs,s),s&&a(ep),s&&a(Ka),s&&a(rp),v(Qs,s),s&&a(tp),s&&a(ps),s&&a(mp),v(sa,s),s&&a(up),v(aa,s),s&&a(cp),s&&a(La),s&&a(hp),v(na,s),s&&a(bp),v(la,s),s&&a(jp),s&&a(Ua),s&&a(op),v(pa,s),s&&a(fp),v(ea,s),s&&a(ip),s&&a(W),s&&a(dp),v(ra,s),s&&a(_p),v(ta,s),s&&a($p),s&&a(Ba),s&&a(vp),v(ma,s),s&&a(Ep),v(ua,s),s&&a(yp),s&&a(Ia),s&&a(wp),s&&a(ca),s&&a(kp),s&&a(Y),s&&a(Tp),s&&a(ks),s&&a(Pp),s&&a(Ha),s&&a(Cp),v(ba,s),s&&a(Dp),v(Ts,s),s&&a(Ap),s&&a(Ra),s&&a(Op),v(ja,s),s&&a(qp),v(oa,s),s&&a(zp),s&&a(Va),s&&a(gp),s&&a(fa),s&&a(Fp),s&&a(Xa),s&&a(Sp),s&&a(ia),s&&a(Mp),s&&a(Ps),s&&a(Gp),v(Cs,s),s&&a(xp),s&&a(es),v(da),s&&a(Np),s&&a(Z),s&&a(Kp),s&&a(Ja),s&&a(Lp),s&&a(As),s&&a(Up),s&&a(_a),s&&a(Bp),s&&a(F),s&&a(Ip),v($a,s),s&&a(Hp),s&&a(Wa),s&&a(Rp),v(va,s),s&&a(Vp),s&&a(Ya),s&&a(Xp),s&&a(N),s&&a(Jp),s&&a(Za),s&&a(Wp),s&&a(Qa),s&&a(Yp),s&&a(sn),s&&a(Zp),s&&a(Ea),s&&a(Qp),s&&a(an),s&&a(se),s&&a(nn),s&&a(ae),v(ya,s),s&&a(ne),v(Os,s),s&&a(le),s&&a(ln),s&&a(pe),s&&a(pn),s&&a(ee),v(qs,s),s&&a(re),s&&a(wa),s&&a(te),s&&a(en),s&&a(me),s&&a(rn),s&&a(ue),s&&a(tn),s&&a(ce),s&&a(ka),s&&a(he),s&&a(zs),s&&a(be),s&&a(mn),s&&a(je),s&&a(K),s&&a(oe),s&&a(jn)}}}const ic={local:"debugging-the-training-pipeline",sections:[{local:"debugging-the-training-pipeline",sections:[{local:"",title:"\u68C0\u67E5\u60A8\u7684\u6570\u636E"},{local:"",title:"\u68C0\u67E5\u4F60\u7684\u6A21\u578B"},{local:"",title:"\u68C0\u67E5\u4F60\u7684\u8D85\u53C2\u6570"}],title:"Debugging the training pipeline"},{local:"",sections:[{local:"",title:"\u5904\u7406\u5185\u5B58\u4E0D\u8DB3\u9519\u8BEF"},{local:"tensorflow",title:"TensorFlow \u{1F99B}\u997F\u997F"},{local:"",title:"\u68C0\u67E5\u60A8\u7684\u6570\u636E\uFF08\u518D\u6B21\uFF01\uFF09"},{local:"",title:"\u5728\u4E00\u6279\u4E0A\u8FC7\u5EA6\u62DF\u5408\u4F60\u7684\u6A21\u578B"},{local:"",title:"\u5728\u4F60\u6709\u7B2C\u4E00\u4E2A\u57FA\u7EBF\u4E4B\u524D\u4E0D\u8981\u8C03\u6574\u4EFB\u4F55\u4E1C\u897F"},{local:"",title:"\u8BF7\u6C42\u5E2E\u5FD9"}],title:"\u5176\u4ED6\u6F5C\u5728\u95EE\u9898"}],title:"Debugging the training pipeline"};function dc(M,b,w){let j="pt";return rc(()=>{const E=new URLSearchParams(window.location.search);w(0,j=E.get("fw")||"pt")}),[j]}class Tc extends nc{constructor(b){super();lc(this,b,dc,fc,pc,{})}}export{Tc as default,ic as metadata};
