import{S as qy,i as Ky,s as ew,e as o,k as f,w as c,t as s,M as tw,c as a,d as t,m as p,a as r,x as m,h,b as u,N as M,G as l,g as i,y as d,L as lw,q as g,o as v,B as y,v as ow}from"../../chunks/vendor-hf-doc-builder.js";import{I as w}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as b}from"../../chunks/CodeBlock-hf-doc-builder.js";import{C as aw}from"../../chunks/CourseFloatingBanner-hf-doc-builder.js";function rw(ld){let A,nn,S,te,ea,De,Ih,ta,jh,sn,Qe,hn,Yl,Ah,un,qe,od,fn,$,Sh,la,xh,Gh,oa,Zh,Nh,pn,le,Ke,Wh,et,Ch,Ph,Lh,tt,Rh,lt,Hh,zh,cn,ot,Vh,at,Bh,mn,rt,aa,Yh,Xh,dn,Xl,nt,Fl,ad,gn,oe,Fh,ra,Oh,Dh,vn,ae,Qh,na,qh,Kh,yn,x,re,ia,it,eu,sa,tu,wn,st,rd,bn,Ol,lu,Mn,ne,ht,ou,ha,au,ru,nu,ut,iu,ua,su,hu,_n,ie,uu,fa,fu,pu,En,ft,cu,pt,mu,Tn,se,du,pa,gu,vu,$n,ct,nd,Jn,mt,id,Un,G,he,ca,dt,yu,ma,wu,kn,ue,da,gt,bu,Mu,ga,_u,In,Z,fe,va,vt,Eu,ya,Tu,jn,Dl,wa,yt,$u,An,J,Ju,ba,Uu,ku,wt,Iu,ju,Sn,N,pe,Ma,bt,Au,_a,Su,xn,Ql,xu,Gn,ce,Mt,Gu,Ea,Zu,Nu,Wu,_t,Cu,Ta,Pu,Lu,Zn,W,me,$a,Et,Ru,Ja,Hu,Nn,de,zu,ql,Vu,Tt,Bu,Yu,Wn,C,ge,Ua,$t,Xu,ka,Fu,Cn,P,ve,Ia,Jt,Ou,ja,Du,Pn,Kl,ye,Qu,Aa,qu,Ku,Sa,ef,Ln,Ut,sd,Rn,eo,xa,Ga,tf,Hn,kt,hd,zn,L,we,Za,It,lf,Na,of,Vn,jt,Bn,At,Yn,R,be,Wa,St,af,Ca,r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i,Ze,Sr,dc,gc,ko,vc,xr,yc,Oi,wl,wc,Gr,bc,Di,Io,Mc,Qi,jo,_c,qi,X,Ne,Zr,bl,Ec,Nr,Tc,Ki,F,We,Wr,Ml,$c,Ao,Jc,Cr,Uc,es,T,kc,_l,Ic,jc,Pr,Ac,Sc,El,xc,ts,Tl,ls,So,Gc,os,$l,as,xo,Zc,rs,Jl,ns,O,Ce,Lr,Ul,Nc,Rr,Wc,is,Go,Cc,ss,Zo,No,Pc,Hr,Lc,hs,kl,gd,us,Pe,Rc,Il,Hc,zc,fs,Wo,Vc,ps,D,Le,zr,jl,Bc,Vr,Yc,cs,Co,Xc,ms,Al,ds,Q,Re,Br,Sl,Fc,Yr,Oc,gs,Po,Lo,Dc,Xr,Qc,vs,xl,ys,q,He,Fr,Gl,qc,Or,Kc,ws,Zl,em,Nl,tm,bs,K,ze,Dr,Wl,lm,Qr,om,Ms,Ro,am,_s,Ho,zo,vd,Es,Cl,rm,Pl,nm,Ts,Ll,im,Rl,sm,$s,Vo,hm,Js,Ve,Be,Hl,um,fm,qr,pm,cm,mm,Ye,zl,dm,gm,Kr,vm,ym,Us,Bo,wm,ks,Yo,bm,Is,Xo,Mm,js,ee,Xe,en,Vl,_m,tn,Em,As;return De=new w({}),Qe=new aw({props:{classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/deep-rl-class/blob/main/notebooks/unit5/unit5.ipynb"}],askForHelpUrl:"http://hf.co/join/discord"}}),it=new w({}),dt=new w({}),vt=new w({}),bt=new w({}),Et=new w({}),$t=new w({}),Jt=new w({}),It=new w({}),jt=new b({props:{code:"JTIzJTIwQ2xvbmUlMjB0aGUlMjByZXBvc2l0b3J5JTBBZ2l0JTIwY2xvbmUlMjAtLWRlcHRoJTIwMSUyMGh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRlVuaXR5LVRlY2hub2xvZ2llcyUyRm1sLWFnZW50cw==",highlighted:`<span class="hljs-comment"># Clone the repository</span>
git <span class="hljs-built_in">clone</span> --depth 1 https://github.com/Unity-Technologies/ml-agents`}}),At=new b({props:{code:"JTIzJTIwR28lMjBpbnNpZGUlMjB0aGUlMjByZXBvc2l0b3J5JTIwYW5kJTIwaW5zdGFsbCUyMHRoZSUyMHBhY2thZ2UlMEFjZCUyMG1sLWFnZW50cyUwQXBpcCUyMGluc3RhbGwlMjAtZSUyMC4lMkZtbC1hZ2VudHMtZW52cyUwQXBpcCUyMGluc3RhbGwlMjAtZSUyMC4lMkZtbC1hZ2VudHM=",highlighted:`<span class="hljs-comment"># Go inside the repository and install the package</span>
<span class="hljs-built_in">cd</span> ml-agents
pip install -e ./ml-agents-envs
pip install -e ./ml-agents`}}),St=new w({}),Zt=new w({}),Nt=new b({props:{code:"JTIzJTIwSGVyZSUyQyUyMHdlJTIwY3JlYXRlJTIwdHJhaW5pbmctZW52cy1leGVjdXRhYmxlcyUyMGFuZCUyMGxpbnV4JTBBbWtkaXIlMjAuJTJGdHJhaW5pbmctZW52cy1leGVjdXRhYmxlcyUwQW1rZGlyJTIwLiUyRnRyYWluaW5nLWVudnMtZXhlY3V0YWJsZXMlMkZsaW51eA==",highlighted:`<span class="hljs-comment"># Here, we create training-envs-executables and linux</span>
<span class="hljs-built_in">mkdir</span> ./training-envs-executables
<span class="hljs-built_in">mkdir</span> ./training-envs-executables/linux`}}),Lt=new b({props:{code:"d2dldCUyMC0tbG9hZC1jb29raWVzJTIwJTJGdG1wJTJGY29va2llcy50eHQlMjAlMjJodHRwcyUzQSUyRiUyRmRvY3MuZ29vZ2xlLmNvbSUyRnVjJTNGZXhwb3J0JTNEZG93bmxvYWQlMjZjb25maXJtJTNEJTI0KHdnZXQlMjAtLXF1aWV0JTIwLS1zYXZlLWNvb2tpZXMlMjAlMkZ0bXAlMkZjb29raWVzLnR4dCUyMC0ta2VlcC1zZXNzaW9uLWNvb2tpZXMlMjAtLW5vLWNoZWNrLWNlcnRpZmljYXRlJTIwJ2h0dHBzJTNBJTJGJTJGZG9jcy5nb29nbGUuY29tJTJGdWMlM0ZleHBvcnQlM0Rkb3dubG9hZCUyNmlkJTNEMVlISExqeWo2Z2FaM0dlbXgxaFFncXJQZ1NTMlpobUI1JyUyMC1PLSUyMCU3QyUyMHNlZCUyMC1ybiUyMCdzJTJGLipjb25maXJtJTNEKCU1QjAtOUEtWmEtel8lNUQlMkIpLiolMkYlNUMxJTVDbiUyRnAnKSUyNmlkJTNEMVlISExqeWo2Z2FaM0dlbXgxaFFncXJQZ1NTMlpobUI1JTIyJTIwLU8lMjAuJTJGdHJhaW5pbmctZW52cy1leGVjdXRhYmxlcyUyRmxpbnV4JTJGU25vd2JhbGxUYXJnZXQuemlwJTIwJTI2JTI2JTIwcm0lMjAtcmYlMjAlMkZ0bXAlMkZjb29raWVzLnR4dA==",highlighted:'wget --load-cookies /tmp/cookies.txt <span class="hljs-string">&quot;https://docs.google.com/uc?export=download&amp;confirm=<span class="hljs-subst">$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate &#x27;https://docs.google.com/uc?export=download&amp;id=1YHHLjyj6gaZ3Gemx1hQgqrPgSS2ZhmB5&#x27; -O- | sed -rn &#x27;s/.*confirm=([0-9A-Za-z_]+)</span>.*/\\1\\n/p&#x27;)&amp;id=1YHHLjyj6gaZ3Gemx1hQgqrPgSS2ZhmB5&quot;</span> -O ./training-envs-executables/linux/SnowballTarget.zip &amp;&amp; <span class="hljs-built_in">rm</span> -rf /tmp/cookies.txt'}}),Rt=new b({props:{code:"dW56aXAlMjAtZCUyMC4lMkZ0cmFpbmluZy1lbnZzLWV4ZWN1dGFibGVzJTJGbGludXglMkYlMjAuJTJGdHJhaW5pbmctZW52cy1leGVjdXRhYmxlcyUyRmxpbnV4JTJGU25vd2JhbGxUYXJnZXQuemlw",highlighted:"unzip -d ./training-envs-executables/linux/ ./training-envs-executables/linux/SnowballTarget.zip"}}),Ht=new b({props:{code:"Y2htb2QlMjAtUiUyMDc1NSUyMC4lM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lMjAlMjAlMjBuZXR3b3JrX3NldHRpbmdzJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwbm9ybWFsaXplJTNBJTIwZmFsc2UlMEElMjAlMjAlMjAlMjAlMjAlMjBoaWRkZW5fdW5pdHMlM0ElMjAyNTYlMEElMjAlMjAlMjAlMjAlMjAlMjBudW1fbGF5ZXJzJTNBJTIwMiUwQSUyMCUyMCUyMCUyMCUyMCUyMHZpc19lbmNvZGVfdHlwZSUzQSUyMHNpbXBsZSUwQSUyMCUyMCUyMCUyMHJld2FyZF9zaWduYWxzJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwZXh0cmluc2ljJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZ2FtbWElM0ElMjAwLjk5JTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3RyZW5ndGglM0ElMjAxLjA=",highlighted:`<span class="hljs-attr">behaviors:</span>
  <span class="hljs-attr">SnowballTarget:</span>
    <span class="hljs-attr">trainer_type:</span> <span class="hljs-string">ppo</span>
    <span class="hljs-attr">summary_freq:</span> <span class="hljs-number">10000</span>
    <span class="hljs-attr">keep_checkpoints:</span> <span class="hljs-number">10</span>
    <span class="hljs-attr">checkpoint_interval:</span> <span class="hljs-number">50000</span>
    <span class="hljs-attr">max_steps:</span> <span class="hljs-number">200000</span>
    <span class="hljs-attr">time_horizon:</span> <span class="hljs-number">64</span>
    <span class="hljs-attr">threaded:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">hyperparameters:</span>
      <span class="hljs-attr">learning_rate:</span> <span class="hljs-number">0.0003</span>
      <span class="hljs-attr">learning_rate_schedule:</span> <span class="hljs-string">linear</span>
      <span class="hljs-attr">batch_size:</span> <span class="hljs-number">128</span>
      <span class="hljs-attr">buffer_size:</span> <span class="hljs-number">2048</span>
      <span class="hljs-attr">beta:</span> <span class="hljs-number">0.005</span>
      <span class="hljs-attr">epsilon:</span> <span class="hljs-number">0.2</span>
      <span class="hljs-attr">lambd:</span> <span class="hljs-number">0.95</span>
      <span class="hljs-attr">num_epoch:</span> <span class="hljs-number">3</span>
    <span class="hljs-attr">network_settings:</span>
      <span class="hljs-attr">normalize:</span> <span class="hljs-literal">false</span>
      <span class="hljs-attr">hidden_units:</span> <span class="hljs-number">256</span>
      <span class="hljs-attr">num_layers:</span> <span class="hljs-number">2</span>
      <span class="hljs-attr">vis_encode_type:</span> <span class="hljs-string">simple</span>
    <span class="hljs-attr">reward_signals:</span>
      <span class="hljs-attr">extrinsic:</span>
        <span class="hljs-attr">gamma:</span> <span class="hljs-number">0.99</span>
        <span class="hljs-attr">strength:</span> <span class="hljs-number">1.0</span>`}}),Dt=new w({}),el=new b({props:{code:"bWxhZ2VudHMtbGVhcm4lMjAuJTJGY29uZmlnJTJGcHBvJTJGU25vd2JhbGxUYXJnZXQueWFtbCUyMC0tZW52JTNELiUyRnRyYWluaW5nLWVudnMtZXhlY3V0YWJsZXMlMkZsaW51eCUyRlNub3diYWxsVGFyZ2V0JTJGU25vd2JhbGxUYXJnZXQlMjAtLXJ1bi1pZCUzRCUyMlNub3diYWxsVGFyZ2V0MSUyMiUyMC0tbm8tZ3JhcGhpY3M=",highlighted:'mlagents-learn ./config/ppo/SnowballTarget.yaml --<span class="hljs-built_in">env</span>=./training-envs-executables/linux/SnowballTarget/SnowballTarget --run-id=<span class="hljs-string">&quot;SnowballTarget1&quot;</span> --no-graphics'}}),tl=new w({}),nl=new b({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`}}),fl=new b({props:{code:"bWxhZ2VudHMtcHVzaC10by1oZiUyMCUyMC0tcnVuLWlkJTNEJTIwJTIzJTIwQWRkJTIweW91ciUyMHJ1biUyMGlkJTIwJTIwLS1sb2NhbC1kaXIlM0QlMjAlMjMlMjBZb3VyJTIwbG9jYWwlMjBkaXIlMjAlMjAtLXJlcG8taWQlM0QlMjAlMjMlMjBZb3VyJTIwcmVwbyUyMGlkJTIwJTIwLS1jb21taXQtbWVzc2FnZSUzRCUyMCUyMyUyMFlvdXIlMjBjb21taXQlMjBtZXNzYWdl",highlighted:'mlagents-push-to-hf  --run-<span class="hljs-built_in">id</span>= <span class="hljs-comment"># Add your run id  --local-dir= # Your local dir  --repo-id= # Your repo id  --commit-message= # Your commit message</span>'}}),pl=new b({props:{code:"WW91ciUyMG1vZGVsJTIwaXMlMjBwdXNoZWQlMjB0byUyMHRoZSUyMGh1Yi4lMjBZb3UlMjBjYW4lMjB2aWV3JTIweW91ciUyMG1vZGVsJTIwaGVyZSUzQSUyMGh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZUaG9tYXNTaW1vbmluaSUyRnBwby1Tbm93YmFsbFRhcmdldA==",highlighted:'Your model is pushed to the hub. You can view your model here: https:<span class="hljs-regexp">//</span>huggingface.co<span class="hljs-regexp">/ThomasSimonini/</span>ppo-SnowballTarget'}}),dl=new w({}),bl=new w({}),Ml=new w({}),Tl=new b({props:{code:"IXdnZXQlMjAtLWxvYWQtY29va2llcyUyMCUyRnRtcCUyRmNvb2tpZXMudHh0JTIwJTIyaHR0cHMlM0ElMkYlMkZkb2NzLmdvb2dsZS5jb20lMkZ1YyUzRmV4cG9ydCUzRGRvd25sb2FkJTI2Y29uZmlybSUzRCUyNCh3Z2V0JTIwLS1xdWlldCUyMC0tc2F2ZS1jb29raWVzJTIwJTJGdG1wJTJGY29va2llcy50eHQlMjAtLWtlZXAtc2Vzc2lvbi1jb29raWVzJTIwLS1uby1jaGVjay1jZXJ0aWZpY2F0ZSUyMCdodHRwcyUzQSUyRiUyRmRvY3MuZ29vZ2xlLmNvbSUyRnVjJTNGZXhwb3J0JTNEZG93bmxvYWQlMjZpZCUzRDFVaUZOZEtsc0gwTlR1MzJ4Vi1naVlVRVZLVjQtdmM3SCclMjAtTy0lMjAlN0MlMjBzZWQlMjAtcm4lMjAncyUyRi4qY29uZmlybSUzRCglNUIwLTlBLVphLXpfJTVEJTJCKS4qJTJGJTVDMSU1Q24lMkZwJyklMjZpZCUzRDFVaUZOZEtsc0gwTlR1MzJ4Vi1naVlVRVZLVjQtdmM3SCUyMiUyMC1PJTIwLiUyRnRyYWluaW5nLWVudnMtZXhlY3V0YWJsZXMlMkZsaW51eCUyRlB5cmFtaWRzLnppcCUyMCUyNiUyNiUyMHJtJTIwLXJmJTIwJTJGdG1wJTJGY29va2llcy50eHQ=",highlighted:'!wget --load-cookies /tmp/cookies.txt <span class="hljs-string">&quot;https://docs.google.com/uc?export=download&amp;confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate &#x27;https://docs.google.com/uc?export=download&amp;id=1UiFNdKlsH0NTu32xV-giYUEVKV4-vc7H&#x27; -O- | sed -rn &#x27;s/.*confirm=([0-9A-Za-z_]+).*/\\1\\n/p&#x27;)&amp;id=1UiFNdKlsH0NTu32xV-giYUEVKV4-vc7H&quot;</span> -O ./training-envs-executables/linux/Pyramids.<span class="hljs-built_in">zip</span> &amp;&amp; rm -rf /tmp/cookies.txt'}}),$l=new b({props:{code:"JTI1JTI1Y2FwdHVyZSUwQSF1bnppcCUyMC1kJTIwLiUyRnRyYWluaW5nLWVudnMtZXhlY3V0YWJsZXMlMkZsaW51eCUyRiUyMC4lMkZ0cmFpbmluZy1lbnZzLWV4ZWN1dGFibGVzJTJGbGludXglMkZQeXJhbWlkcy56aXA=",highlighted:`%%capture
!unzip -d ./training-envs-executables/linux/ ./training-envs-executables/linux/Pyramids.<span class="hljs-built_in">zip</span>`}}),Jl=new b({props:{code:"Y2htb2QlMjAtUiUyMDc1NSUyMC4lMkZ0cmFpbmluZy1lbnZzLWV4ZWN1dGFibGVzJTJGbGludXglMkZQeXJhbWlkcyUyRlB5cmFtaWRz",highlighted:'<span class="hljs-built_in">chmod</span> -R 755 ./training-envs-executables/linux/Pyramids/Pyramids'}}),Ul=new w({}),jl=new w({}),Al=new b({props:{code:"bWxhZ2VudHMtbGVhcm4lMjAuJTJGY29uZmlnJTJGcHBvJTJGUHlyYW1pZHNSTkQueWFtbCUyMC0tZW52JTNELiUyRnRyYWluaW5nLWVudnMtZXhlY3V0YWJsZXMlMkZsaW51eCUyRlB5cmFtaWRzJTJGUHlyYW1pZHMlMjAtLXJ1bi1pZCUzRCUyMlB5cmFtaWRzJTIwVHJhaW5pbmclMjIlMjAtLW5vLWdyYXBoaWNz",highlighted:'mlagents-learn ./config/ppo/PyramidsRND.yaml --env=./training-envs-executables/linux/Pyramids/Pyramids --run-<span class="hljs-built_in">id</span>=<span class="hljs-string">&quot;Pyramids Training&quot;</span> --no-graphics'}}),Sl=new w({}),xl=new b({props:{code:"bWxhZ2VudHMtcHVzaC10by1oZiUyMCUyMC0tcnVuLWlkJTNEJTIwJTIzJTIwQWRkJTIweW91ciUyMHJ1biUyMGlkJTIwJTIwLS1sb2NhbC1kaXIlM0QlMjAlMjMlMjBZb3VyJTIwbG9jYWwlMjBkaXIlMjAlMjAtLXJlcG8taWQlM0QlMjAlMjMlMjBZb3VyJTIwcmVwbyUyMGlkJTIwJTIwLS1jb21taXQtbWVzc2FnZSUzRCUyMCUyMyUyMFlvdXIlMjBjb21taXQlMjBtZXNzYWdl",highlighted:'mlagents-push-to-hf  --run-<span class="hljs-built_in">id</span>= <span class="hljs-comment"># Add your run id  --local-dir= # Your local dir  --repo-id= # Your repo id  --commit-message= # Your commit message</span>'}}),Gl=new w({}),Wl=new w({}),Vl=new w({}),{c(){A=o("meta"),nn=f(),S=o("h1"),te=o("a"),ea=o("span"),c(De.$$.fragment),Ih=f(),ta=o("span"),jh=s("Hands-on"),sn=f(),c(Qe.$$.fragment),hn=f(),Yl=o("p"),Ah=s("We learned what ML-Agents is and how it works. We also studied the two environments we\u2019re going to use. Now we\u2019re ready to train our agents!"),un=f(),qe=o("img"),fn=f(),$=o("p"),Sh=s("To validate this hands-on for the certification process, you "),la=o("strong"),xh=s("just need to push your trained models to the Hub."),Gh=s(`
There are `),oa=o("strong"),Zh=s("no minimum results to attain"),Nh=s(" in order to validate this Hands On. But if you want to get nice results, you can try to reach the following:"),pn=f(),le=o("ul"),Ke=o("li"),Wh=s("For "),et=o("a"),Ch=s("Pyramids"),Ph=s(": Mean Reward = 1.75"),Lh=f(),tt=o("li"),Rh=s("For "),lt=o("a"),Hh=s("SnowballTarget"),zh=s(": Mean Reward = 15 or 30 targets shoot in an episode."),cn=f(),ot=o("p"),Vh=s("For more information about the certification process, check this section \u{1F449} "),at=o("a"),Bh=s("https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),mn=f(),rt=o("p"),aa=o("strong"),Yh=s("To start the hands-on, click on Open In Colab button"),Xh=s(" \u{1F447} :"),dn=f(),Xl=o("p"),nt=o("a"),Fl=o("img"),gn=f(),oe=o("p"),Fh=s("We strongly "),ra=o("strong"),Oh=s("recommend students use Google Colab for the hands-on exercises"),Dh=s(" instead of running them on their personal computers."),vn=f(),ae=o("p"),Qh=s("By using Google Colab, "),na=o("strong"),qh=s("you can focus on learning and experimenting without worrying about the technical aspects"),Kh=s(" of setting up your environments."),yn=f(),x=o("h1"),re=o("a"),ia=o("span"),c(it.$$.fragment),eu=f(),sa=o("span"),tu=s("Unit 5: An Introduction to ML-Agents"),wn=f(),st=o("img"),bn=f(),Ol=o("p"),lu=s("In this notebook, you\u2019ll learn about ML-Agents and train two agents."),Mn=f(),ne=o("ul"),ht=o("li"),ou=s("The first one will learn to "),ha=o("strong"),au=s("shoot snowballs onto spawning targets"),ru=s("."),nu=f(),ut=o("li"),iu=s("The second needs to press a button to spawn a pyramid, then navigate to the pyramid, knock it over, "),ua=o("strong"),su=s("and move to the gold brick at the top"),hu=s(". To do that, it will need to explore its environment, and we will use a technique called curiosity."),_n=f(),ie=o("p"),uu=s("After that, you\u2019ll be able "),fa=o("strong"),fu=s("to watch your agents playing directly on your browser"),pu=s("."),En=f(),ft=o("p"),cu=s("For more information about the certification process, check this section \u{1F449} "),pt=o("a"),mu=s("https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),Tn=f(),se=o("p"),du=s("\u2B07\uFE0F Here is an example of what "),pa=o("strong"),gu=s("you will achieve at the end of this unit."),vu=s(" \u2B07\uFE0F"),$n=f(),ct=o("img"),Jn=f(),mt=o("img"),Un=f(),G=o("h3"),he=o("a"),ca=o("span"),c(dt.$$.fragment),yu=f(),ma=o("span"),wu=s("\u{1F3AE} Environments:"),kn=f(),ue=o("ul"),da=o("li"),gt=o("a"),bu=s("Pyramids"),Mu=f(),ga=o("li"),_u=s("SnowballTarget"),In=f(),Z=o("h3"),fe=o("a"),va=o("span"),c(vt.$$.fragment),Eu=f(),ya=o("span"),Tu=s("\u{1F4DA} RL-Library:"),jn=f(),Dl=o("ul"),wa=o("li"),yt=o("a"),$u=s("ML-Agents"),An=f(),J=o("p"),Ju=s("We\u2019re constantly trying to improve our tutorials, so "),ba=o("strong"),Uu=s("if you find some issues in this notebook"),ku=s(", please "),wt=o("a"),Iu=s("open an issue on the GitHub Repo"),ju=s("."),Sn=f(),N=o("h2"),pe=o("a"),Ma=o("span"),c(bt.$$.fragment),Au=f(),_a=o("span"),Su=s("Objectives of this notebook \u{1F3C6}"),xn=f(),Ql=o("p"),xu=s("At the end of the notebook, you will:"),Gn=f(),ce=o("ul"),Mt=o("li"),Gu=s("Understand how "),Ea=o("strong"),Zu=s("ML-Agents"),Nu=s(" works and the environment library."),Wu=f(),_t=o("li"),Cu=s("Be able to "),Ta=o("strong"),Pu=s("train agents in Unity Environments"),Lu=s("."),Zn=f(),W=o("h2"),me=o("a"),$a=o("span"),c(Et.$$.fragment),Ru=f(),Ja=o("span"),Hu=s("Prerequisites \u{1F3D7}\uFE0F"),Nn=s(`

Before diving into the notebook, you need to:
`),de=o("p"),zu=s("\u{1F532} \u{1F4DA} "),ql=o("strong"),Vu=s("Study "),Tt=o("a"),Bu=s("what ML-Agents is and how it works by reading Unit 5"),Yu=s("  \u{1F917}"),Wn=f(),C=o("h1"),ge=o("a"),Ua=o("span"),c($t.$$.fragment),Xu=f(),ka=o("span"),Fu=s("Let's train our agents \u{1F680}"),Cn=f(),P=o("h2"),ve=o("a"),Ia=o("span"),c(Jt.$$.fragment),Ou=f(),ja=o("span"),Du=s("Set the GPU \u{1F4AA}"),Pn=f(),Kl=o("ul"),ye=o("li"),Qu=s("To "),Aa=o("strong"),qu=s("accelerate the agent\u2019s training, we\u2019ll use a GPU"),Ku=s(". To do that, go to "),Sa=o("code"),ef=s("Runtime > Change Runtime type"),Ln=f(),Ut=o("img"),Rn=f(),eo=o("ul"),xa=o("li"),Ga=o("code"),tf=s("Hardware Accelerator > GPU"),Hn=f(),kt=o("img"),zn=f(),L=o("h2"),we=o("a"),Za=o("span"),c(It.$$.fragment),lf=f(),Na=o("span"),of=s("Clone the repository and install the dependencies \u{1F53D}"),Vn=s(`

- We need to clone the repository that **contains the experimental version of the library that allows you to push your trained agent to the Hub.**

	`),c(jt.$$.fragment),Bn=f(),c(At.$$.fragment),Yn=f(),R=o("h2"),be=o("a"),Wa=o("span"),c(St.$$.fragment),af=f(),Ca=o("span"),rf=s("SnowballTarget \u26C4"),Xn=f(),xt=o("p"),nf=s(`If you need a refresher on how this environment works check this section \u{1F449}
`),Gt=o("a"),sf=s("https://huggingface.co/deep-rl-course/unit5/snowball-target"),Fn=f(),H=o("h3"),Me=o("a"),Pa=o("span"),c(Zt.$$.fragment),hf=f(),to=o("span"),uf=s("Download and move the environment zip file in "),La=o("code"),ff=s("./training-envs-executables/linux/"),On=f(),U=o("ul"),Ra=o("li"),pf=s("Our environment executable is in a zip file."),cf=f(),lo=o("li"),mf=s("We need to download it and place it to "),Ha=o("code"),df=s("./training-envs-executables/linux/"),gf=f(),za=o("li"),vf=s("We use a linux executable because we use colab, and colab machines OS is Ubuntu (linux)"),Dn=f(),c(Nt.$$.fragment),Qn=f(),k=o("p"),yf=s("Download the file SnowballTarget.zip from "),Wt=o("a"),wf=s("https://drive.google.com/file/d/1YHHLjyj6gaZ3Gemx1hQgqrPgSS2ZhmB5"),bf=s(" using "),Va=o("code"),Mf=s("wget"),_f=s("."),qn=f(),Ct=o("p"),Ef=s("Check out the full solution to download large files from GDrive "),Pt=o("a"),Tf=s("here"),Kn=f(),c(Lt.$$.fragment),ei=f(),oo=o("p"),$f=s("We unzip the executable.zip file"),ti=f(),c(Rt.$$.fragment),li=f(),ao=o("p"),Jf=s("Make sure your file is accessible"),oi=f(),c(Ht.$$.fragment),ai=f(),z=o("h3"),_e=o("a"),Ba=o("span"),c(zt.$$.fragment),Uf=f(),Ya=o("span"),kf=s("Define the SnowballTarget config file"),ri=s(`

- In ML-Agents, you define the **training hyperparameters in config.yaml files.**
`),Vt=o("p"),If=s("There are multiple hyperparameters. To understand them better, you should read the explanation for each one in "),Bt=o("a"),jf=s("the documentation"),ni=f(),Ee=o("p"),Af=s("You need to create a "),Xa=o("code"),Sf=s("SnowballTarget.yaml"),xf=s(" config file in ./content/ml-agents/config/ppo/"),ii=f(),I=o("p"),Gf=s("We\u2019ll give you a preliminary version of this config (to copy and paste into your "),Fa=o("code"),Zf=s("SnowballTarget.yaml file"),Nf=s("), "),Oa=o("strong"),Wf=s("but you should modify it"),Cf=s("."),si=f(),c(Yt.$$.fragment),hi=f(),Xt=o("img"),ui=f(),Ft=o("img"),fi=f(),Te=o("p"),Pf=s("As an experiment, try to modify some other hyperparameters. Unity provides very "),Ot=o("a"),Lf=s("good documentation explaining each of them here"),Rf=s("."),pi=f(),ro=o("p"),Hf=s("Now that you\u2019ve created the config file and understand what most hyperparameters do, we\u2019re ready to train our agent \u{1F525}."),ci=f(),V=o("h3"),$e=o("a"),Da=o("span"),c(Dt.$$.fragment),zf=f(),Qa=o("span"),Vf=s("Train the agent"),mi=f(),Qt=o("p"),Bf=s("To train our agent, we need to "),qa=o("strong"),Yf=s("launch mlagents-learn and select the executable containing the environment."),di=f(),no=o("p"),Xf=s("We define four parameters:"),gi=f(),_=o("ol"),io=o("li"),Ka=o("code"),Ff=s("mlagents-learn <config>"),Of=s(": the path where the hyperparameter config file is."),Df=f(),so=o("li"),er=o("code"),Qf=s("--env"),qf=s(": where the environment executable is."),Kf=f(),ho=o("li"),tr=o("code"),ep=s("--run_id"),tp=s(": the name you want to give to your training run id."),lp=f(),uo=o("li"),lr=o("code"),op=s("--no-graphics"),ap=s(": to not launch the visualization during the training."),vi=f(),qt=o("img"),yi=f(),Je=o("p"),rp=s("Train the model and use the "),or=o("code"),np=s("--resume"),ip=s(" flag to continue training in case of interruption."),wi=f(),fo=o("blockquote"),Kt=o("p"),sp=s("It will fail the first time if and when you use "),ar=o("code"),hp=s("--resume"),up=s(". Try rerunning the block to bypass the error."),bi=f(),po=o("p"),fp=s("The training will take 10 to 35min depending on your config. Go take a \u2615\uFE0F you deserve it \u{1F917}."),Mi=f(),c(el.$$.fragment),_i=f(),B=o("h3"),Ue=o("a"),rr=o("span"),c(tl.$$.fragment),pp=f(),nr=o("span"),cp=s("Push the agent to the Hugging Face Hub"),Ei=f(),co=o("ul"),mo=o("li"),mp=s("Now that we\u2019ve trained our agent, we\u2019re "),ir=o("strong"),dp=s("ready to push it to the Hub and visualize it playing on your browser\u{1F525}."),Ti=f(),go=o("p"),gp=s("To be able to share your model with the community, there are three more steps to follow:"),$i=f(),ll=o("p"),vp=s("1\uFE0F\u20E3 (If it\u2019s not already done) create an account to HF \u27A1 "),ol=o("a"),yp=s("https://huggingface.co/join"),Ji=f(),vo=o("p"),wp=s("2\uFE0F\u20E3 Sign in and store your authentication token from the Hugging Face website."),Ui=f(),yo=o("ul"),ke=o("li"),bp=s("Create a new token ("),al=o("a"),Mp=s("https://huggingface.co/settings/tokens"),_p=s(") "),sr=o("strong"),Ep=s("with write role"),ki=f(),rl=o("img"),Ii=f(),Ie=o("ul"),hr=o("li"),Tp=s("Copy the token"),$p=f(),ur=o("li"),Jp=s("Run the cell below and paste the token"),ji=f(),c(nl.$$.fragment),Ai=f(),il=o("p"),Up=s("If you don\u2019t want to use Google Colab or a Jupyter Notebook, you need to use this command instead: "),fr=o("code"),kp=s("huggingface-cli login"),Si=f(),je=o("p"),Ip=s("Then we need to run "),pr=o("code"),jp=s("mlagents-push-to-hf"),Ap=s("."),xi=f(),wo=o("p"),Sp=s("And we define four parameters:"),Gi=f(),E=o("ol"),bo=o("li"),cr=o("code"),xp=s("--run-id"),Gp=s(": the name of the training run id."),Zp=f(),sl=o("li"),mr=o("code"),Np=s("--local-dir"),Wp=s(": where the agent was saved, it\u2019s results/"),Mo=o("run_id"),Cp=s(", so in my case results/First Training."),Pp=f(),hl=o("li"),dr=o("code"),Lp=s("--repo-id"),Rp=s(": the name of the Hugging Face repo you want to create or update. It\u2019s always "),Ae=o("your"),Hp=s("/"),Se=o("the"),zp=s("If the repo does not exist "),gr=o("strong"),Vp=s("it will be created automatically"),Bp=f(),_o=o("li"),vr=o("code"),Yp=s("--commit-message"),Xp=s(": since HF repos are git repositories you need to give a commit message."),Zi=f(),ul=o("img"),Ni=f(),Eo=o("p"),Fp=s("For instance:"),Wi=f(),To=o("p"),yr=o("code"),Op=s('mlagents-push-to-hf --run-id="SnowballTarget1" --local-dir="./results/SnowballTarget1" --repo-id="ThomasSimonini/ppo-SnowballTarget" --commit-message="First Push"'),Ci=f(),c(fl.$$.fragment),Pi=f(),$o=o("p"),Dp=s("If everything worked you should see this at the end of the process (but with a different url \u{1F606}) :"),Li=f(),c(pl.$$.fragment),Ri=f(),cl=o("p"),Qp=s("It\u2019s the link to your model. It contains a model card that explains how to use it, your Tensorboard, and your config file. "),wr=o("strong"),qp=s("What\u2019s awesome is that it\u2019s a git repository, which means you can have different commits, update your repository with a new push, etc."),Hi=f(),ml=o("p"),Kp=s("But now comes the best: "),br=o("strong"),ec=s("being able to visualize your agent online \u{1F440}."),zi=f(),Y=o("h3"),xe=o("a"),Mr=o("span"),c(dl.$$.fragment),tc=f(),_r=o("span"),lc=s("Watch your agent playing \u{1F440}"),Vi=f(),Jo=o("p"),oc=s("This step it\u2019s simple:"),Bi=f(),j=o("ol"),Er=o("li"),Tr=o("p"),ac=s("Remember your repo-id"),rc=f(),$r=o("li"),Uo=o("p"),nc=s("Go here: "),gl=o("a"),ic=s("https://huggingface.co/spaces/ThomasSimonini/ML-Agents-SnowballTarget"),sc=f(),Jr=o("li"),Ur=o("p"),hc=s("Launch the game and put it in full screen by clicking on the bottom right button"),Yi=f(),vl=o("img"),Xi=f(),Ge=o("ol"),kr=o("li"),Ir=o("p"),uc=s("In step 1, choose your model repository, which is the model id (in my case ThomasSimonini/ppo-SnowballTarget)."),fc=f(),jr=o("li"),yl=o("p"),pc=s("In step 2, "),Ar=o("strong"),cc=s("choose what model you want to replay"),mc=s(":"),Fi=f(),Ze=o("ul"),Sr=o("li"),dc=s("I have multiple ones since we saved a model every 500000 timesteps."),gc=f(),ko=o("li"),vc=s("But if I want the more recent I choose "),xr=o("code"),yc=s("SnowballTarget.onnx"),Oi=f(),wl=o("p"),wc=s("\u{1F449} It\u2019s nice to "),Gr=o("strong"),bc=s("try different model stages to see the improvement of the agent."),Di=f(),Io=o("p"),Mc=s("And don\u2019t hesitate to share the best score your agent gets on discord in the #rl-i-made-this channel \u{1F525}"),Qi=f(),jo=o("p"),_c=s("Now let\u2019s try a more challenging environment called Pyramids."),qi=f(),X=o("h2"),Ne=o("a"),Zr=o("span"),c(bl.$$.fragment),Ec=f(),Nr=o("span"),Tc=s("Pyramids \u{1F3C6}"),Ki=f(),F=o("h3"),We=o("a"),Wr=o("span"),c(Ml.$$.fragment),$c=f(),Ao=o("span"),Jc=s("Download and move the environment zip file in "),Cr=o("code"),Uc=s("./training-envs-executables/linux/"),es=s(`

- Our environment executable is in a zip file.
- We need to download it and place it into \`./training-envs-executables/linux/\`
- We use a linux executable because we're using colab, and the colab machine's OS is Ubuntu (linux)
`),T=o("p"),kc=s("Download the file Pyramids.zip from "),_l=o("a"),Ic=s("https://drive.google.com/uc?export=download&id=1UiFNdKlsH0NTu32xV-giYUEVKV4-vc7H"),jc=s(" using "),Pr=o("code"),Ac=s("wget"),Sc=s(". Check out the full solution to download large files from GDrive "),El=o("a"),xc=s("here"),ts=f(),c(Tl.$$.fragment),ls=f(),So=o("p"),Gc=s("Unzip it"),os=f(),c($l.$$.fragment),as=f(),xo=o("p"),Zc=s("Make sure your file is accessible"),rs=f(),c(Jl.$$.fragment),ns=f(),O=o("h3"),Ce=o("a"),Lr=o("span"),c(Ul.$$.fragment),Nc=f(),Rr=o("span"),Wc=s("Modify the PyramidsRND config file"),is=s(`

  
- Contrary to the first environment, which was a custom one, **Pyramids was made by the Unity team**.
- So the PyramidsRND config file already exists and is in ./content/ml-agents/config/ppo/PyramidsRND.yaml
- You might ask why "RND" is in PyramidsRND. RND stands for *random network distillation* it's a way to generate curiosity rewards. If you want to know more about that, we wrote an article explaining this technique: https://medium.com/data-from-the-trenches/curiosity-driven-learning-through-random-network-distillation-488ffd8e5938
`),Go=o("p"),Cc=s("For this training, we\u2019ll modify one thing:"),ss=f(),Zo=o("ul"),No=o("li"),Pc=s(`The total training steps hyperparameter is too high since we can hit the benchmark (mean reward = 1.75) in only 1M training steps.
\u{1F449} To do that, we go to config/ppo/PyramidsRND.yaml,`),Hr=o("strong"),Lc=s("and change max_steps to 1000000."),hs=f(),kl=o("img"),us=f(),Pe=o("p"),Rc=s("As an experiment, you should also try to modify some other hyperparameters. Unity provides very "),Il=o("a"),Hc=s("good documentation explaining each of them here"),zc=s("."),fs=f(),Wo=o("p"),Vc=s("We\u2019re now ready to train our agent \u{1F525}."),ps=f(),D=o("h3"),Le=o("a"),zr=o("span"),c(jl.$$.fragment),Bc=f(),Vr=o("span"),Yc=s("Train the agent"),cs=f(),Co=o("p"),Xc=s("The training will take 30 to 45min depending on your machine, go take a \u2615\uFE0F you deserve it \u{1F917}."),ms=f(),c(Al.$$.fragment),ds=f(),Q=o("h3"),Re=o("a"),Br=o("span"),c(Sl.$$.fragment),Fc=f(),Yr=o("span"),Oc=s("Push the agent to the Hugging Face Hub"),gs=f(),Po=o("ul"),Lo=o("li"),Dc=s("Now that we trained our agent, we\u2019re "),Xr=o("strong"),Qc=s("ready to push it to the Hub to be able to visualize it playing on your browser\u{1F525}."),vs=f(),c(xl.$$.fragment),ys=f(),q=o("h3"),He=o("a"),Fr=o("span"),c(Gl.$$.fragment),qc=f(),Or=o("span"),Kc=s("Watch your agent playing \u{1F440}"),ws=f(),Zl=o("p"),em=s("\u{1F449} "),Nl=o("a"),tm=s("https://huggingface.co/spaces/unity/ML-Agents-Pyramids"),bs=f(),K=o("h3"),ze=o("a"),Dr=o("span"),c(Wl.$$.fragment),lm=f(),Qr=o("span"),om=s("\u{1F381} Bonus: Why not train on another environment?"),Ms=s(`

  
Now that you know how to train an agent using MLAgents, **why not try another environment?**
`),Ro=o("p"),am=s("MLAgents provides 17 different environments and we\u2019re building some custom ones. The best way to learn is to try things on your own, have fun."),_s=f(),Ho=o("p"),zo=o("img"),Es=f(),Cl=o("p"),rm=s("You have the full list of the one currently available environments on Hugging Face here \u{1F449} "),Pl=o("a"),nm=s("https://github.com/huggingface/ml-agents#the-environments"),Ts=f(),Ll=o("p"),im=s("For the demos to visualize your agent \u{1F449} "),Rl=o("a"),sm=s("https://huggingface.co/unity"),$s=f(),Vo=o("p"),hm=s("For now we have integrated:"),Js=f(),Ve=o("ul"),Be=o("li"),Hl=o("a"),um=s("Worm"),fm=s(" demo where you teach a "),qr=o("strong"),pm=s("worm to crawl"),cm=s("."),mm=f(),Ye=o("li"),zl=o("a"),dm=s("Walker"),gm=s(" demo where you teach an agent "),Kr=o("strong"),vm=s("to walk towards a goal"),ym=s("."),Us=f(),Bo=o("p"),wm=s("That\u2019s all for today. Congrats on finishing this tutorial!"),ks=f(),Yo=o("p"),bm=s("The best way to learn is to practice and try stuff. Why not try another environment? ML-Agents has 18 different environments, but you can also create your own. Check the documentation and have fun!"),Is=f(),Xo=o("p"),Mm=s("See you on Unit 6 \u{1F525},"),js=f(),ee=o("h2"),Xe=o("a"),en=o("span"),c(Vl.$$.fragment),_m=f(),tn=o("span"),Em=s("Keep Learning, Stay awesome \u{1F917}"),this.h()},l(e){const n=tw('[data-svelte="svelte-1phssyn"]',document.head);A=a(n,"META",{name:!0,content:!0}),n.forEach(t),nn=p(e),S=a(e,"H1",{class:!0});var Ss=r(S);te=a(Ss,"A",{id:!0,class:!0,href:!0});var yd=r(te);ea=a(yd,"SPAN",{});var wd=r(ea);m(De.$$.fragment,wd),wd.forEach(t),yd.forEach(t),Ih=p(Ss),ta=a(Ss,"SPAN",{});var bd=r(ta);jh=h(bd,"Hands-on"),bd.forEach(t),Ss.forEach(t),sn=p(e),m(Qe.$$.fragment,e),hn=p(e),Yl=a(e,"P",{});var Md=r(Yl);Ah=h(Md,"We learned what ML-Agents is and how it works. We also studied the two environments we\u2019re going to use. Now we\u2019re ready to train our agents!"),Md.forEach(t),un=p(e),qe=a(e,"IMG",{src:!0,alt:!0}),fn=p(e),$=a(e,"P",{});var Fo=r($);Sh=h(Fo,"To validate this hands-on for the certification process, you "),la=a(Fo,"STRONG",{});var _d=r(la);xh=h(_d,"just need to push your trained models to the Hub."),_d.forEach(t),Gh=h(Fo,`
There are `),oa=a(Fo,"STRONG",{});var Ed=r(oa);Zh=h(Ed,"no minimum results to attain"),Ed.forEach(t),Nh=h(Fo," in order to validate this Hands On. But if you want to get nice results, you can try to reach the following:"),Fo.forEach(t),pn=p(e),le=a(e,"UL",{});var xs=r(le);Ke=a(xs,"LI",{});var Gs=r(Ke);Wh=h(Gs,"For "),et=a(Gs,"A",{href:!0,rel:!0});var Td=r(et);Ch=h(Td,"Pyramids"),Td.forEach(t),Ph=h(Gs,": Mean Reward = 1.75"),Gs.forEach(t),Lh=p(xs),tt=a(xs,"LI",{});var Zs=r(tt);Rh=h(Zs,"For "),lt=a(Zs,"A",{href:!0,rel:!0});var $d=r(lt);Hh=h($d,"SnowballTarget"),$d.forEach(t),zh=h(Zs,": Mean Reward = 15 or 30 targets shoot in an episode."),Zs.forEach(t),xs.forEach(t),cn=p(e),ot=a(e,"P",{});var Tm=r(ot);Vh=h(Tm,"For more information about the certification process, check this section \u{1F449} "),at=a(Tm,"A",{href:!0,rel:!0});var Jd=r(at);Bh=h(Jd,"https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),Jd.forEach(t),Tm.forEach(t),mn=p(e),rt=a(e,"P",{});var $m=r(rt);aa=a($m,"STRONG",{});var Ud=r(aa);Yh=h(Ud,"To start the hands-on, click on Open In Colab button"),Ud.forEach(t),Xh=h($m," \u{1F447} :"),$m.forEach(t),dn=p(e),Xl=a(e,"P",{});var kd=r(Xl);nt=a(kd,"A",{href:!0,rel:!0});var Id=r(nt);Fl=a(Id,"IMG",{src:!0,alt:!0}),Id.forEach(t),kd.forEach(t),gn=p(e),oe=a(e,"P",{});var Ns=r(oe);Fh=h(Ns,"We strongly "),ra=a(Ns,"STRONG",{});var jd=r(ra);Oh=h(jd,"recommend students use Google Colab for the hands-on exercises"),jd.forEach(t),Dh=h(Ns," instead of running them on their personal computers."),Ns.forEach(t),vn=p(e),ae=a(e,"P",{});var Ws=r(ae);Qh=h(Ws,"By using Google Colab, "),na=a(Ws,"STRONG",{});var Ad=r(na);qh=h(Ad,"you can focus on learning and experimenting without worrying about the technical aspects"),Ad.forEach(t),Kh=h(Ws," of setting up your environments."),Ws.forEach(t),yn=p(e),x=a(e,"H1",{class:!0});var Cs=r(x);re=a(Cs,"A",{id:!0,class:!0,href:!0});var Sd=r(re);ia=a(Sd,"SPAN",{});var xd=r(ia);m(it.$$.fragment,xd),xd.forEach(t),Sd.forEach(t),eu=p(Cs),sa=a(Cs,"SPAN",{});var Gd=r(sa);tu=h(Gd,"Unit 5: An Introduction to ML-Agents"),Gd.forEach(t),Cs.forEach(t),wn=p(e),st=a(e,"IMG",{src:!0,alt:!0}),bn=p(e),Ol=a(e,"P",{});var Zd=r(Ol);lu=h(Zd,"In this notebook, you\u2019ll learn about ML-Agents and train two agents."),Zd.forEach(t),Mn=p(e),ne=a(e,"UL",{});var Ps=r(ne);ht=a(Ps,"LI",{});var Ls=r(ht);ou=h(Ls,"The first one will learn to "),ha=a(Ls,"STRONG",{});var Nd=r(ha);au=h(Nd,"shoot snowballs onto spawning targets"),Nd.forEach(t),ru=h(Ls,"."),Ls.forEach(t),nu=p(Ps),ut=a(Ps,"LI",{});var Rs=r(ut);iu=h(Rs,"The second needs to press a button to spawn a pyramid, then navigate to the pyramid, knock it over, "),ua=a(Rs,"STRONG",{});var Wd=r(ua);su=h(Wd,"and move to the gold brick at the top"),Wd.forEach(t),hu=h(Rs,". To do that, it will need to explore its environment, and we will use a technique called curiosity."),Rs.forEach(t),Ps.forEach(t),_n=p(e),ie=a(e,"P",{});var Hs=r(ie);uu=h(Hs,"After that, you\u2019ll be able "),fa=a(Hs,"STRONG",{});var Cd=r(fa);fu=h(Cd,"to watch your agents playing directly on your browser"),Cd.forEach(t),pu=h(Hs,"."),Hs.forEach(t),En=p(e),ft=a(e,"P",{});var Jm=r(ft);cu=h(Jm,"For more information about the certification process, check this section \u{1F449} "),pt=a(Jm,"A",{href:!0,rel:!0});var Pd=r(pt);mu=h(Pd,"https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),Pd.forEach(t),Jm.forEach(t),Tn=p(e),se=a(e,"P",{});var zs=r(se);du=h(zs,"\u2B07\uFE0F Here is an example of what "),pa=a(zs,"STRONG",{});var Ld=r(pa);gu=h(Ld,"you will achieve at the end of this unit."),Ld.forEach(t),vu=h(zs," \u2B07\uFE0F"),zs.forEach(t),$n=p(e),ct=a(e,"IMG",{src:!0,alt:!0}),Jn=p(e),mt=a(e,"IMG",{src:!0,alt:!0}),Un=p(e),G=a(e,"H3",{class:!0});var Vs=r(G);he=a(Vs,"A",{id:!0,class:!0,href:!0});var Rd=r(he);ca=a(Rd,"SPAN",{});var Hd=r(ca);m(dt.$$.fragment,Hd),Hd.forEach(t),Rd.forEach(t),yu=p(Vs),ma=a(Vs,"SPAN",{});var zd=r(ma);wu=h(zd,"\u{1F3AE} Environments:"),zd.forEach(t),Vs.forEach(t),kn=p(e),ue=a(e,"UL",{});var Bs=r(ue);da=a(Bs,"LI",{});var Vd=r(da);gt=a(Vd,"A",{href:!0,rel:!0});var Bd=r(gt);bu=h(Bd,"Pyramids"),Bd.forEach(t),Vd.forEach(t),Mu=p(Bs),ga=a(Bs,"LI",{});var Yd=r(ga);_u=h(Yd,"SnowballTarget"),Yd.forEach(t),Bs.forEach(t),In=p(e),Z=a(e,"H3",{class:!0});var Ys=r(Z);fe=a(Ys,"A",{id:!0,class:!0,href:!0});var Xd=r(fe);va=a(Xd,"SPAN",{});var Fd=r(va);m(vt.$$.fragment,Fd),Fd.forEach(t),Xd.forEach(t),Eu=p(Ys),ya=a(Ys,"SPAN",{});var Od=r(ya);Tu=h(Od,"\u{1F4DA} RL-Library:"),Od.forEach(t),Ys.forEach(t),jn=p(e),Dl=a(e,"UL",{});var Dd=r(Dl);wa=a(Dd,"LI",{});var Qd=r(wa);yt=a(Qd,"A",{href:!0,rel:!0});var qd=r(yt);$u=h(qd,"ML-Agents"),qd.forEach(t),Qd.forEach(t),Dd.forEach(t),An=p(e),J=a(e,"P",{});var Oo=r(J);Ju=h(Oo,"We\u2019re constantly trying to improve our tutorials, so "),ba=a(Oo,"STRONG",{});var Kd=r(ba);Uu=h(Kd,"if you find some issues in this notebook"),Kd.forEach(t),ku=h(Oo,", please "),wt=a(Oo,"A",{href:!0,rel:!0});var eg=r(wt);Iu=h(eg,"open an issue on the GitHub Repo"),eg.forEach(t),ju=h(Oo,"."),Oo.forEach(t),Sn=p(e),N=a(e,"H2",{class:!0});var Xs=r(N);pe=a(Xs,"A",{id:!0,class:!0,href:!0});var tg=r(pe);Ma=a(tg,"SPAN",{});var lg=r(Ma);m(bt.$$.fragment,lg),lg.forEach(t),tg.forEach(t),Au=p(Xs),_a=a(Xs,"SPAN",{});var og=r(_a);Su=h(og,"Objectives of this notebook \u{1F3C6}"),og.forEach(t),Xs.forEach(t),xn=p(e),Ql=a(e,"P",{});var ag=r(Ql);xu=h(ag,"At the end of the notebook, you will:"),ag.forEach(t),Gn=p(e),ce=a(e,"UL",{});var Fs=r(ce);Mt=a(Fs,"LI",{});var Os=r(Mt);Gu=h(Os,"Understand how "),Ea=a(Os,"STRONG",{});var rg=r(Ea);Zu=h(rg,"ML-Agents"),rg.forEach(t),Nu=h(Os," works and the environment library."),Os.forEach(t),Wu=p(Fs),_t=a(Fs,"LI",{});var Ds=r(_t);Cu=h(Ds,"Be able to "),Ta=a(Ds,"STRONG",{});var ng=r(Ta);Pu=h(ng,"train agents in Unity Environments"),ng.forEach(t),Lu=h(Ds,"."),Ds.forEach(t),Fs.forEach(t),Zn=p(e),W=a(e,"H2",{class:!0});var Qs=r(W);me=a(Qs,"A",{id:!0,class:!0,href:!0});var ig=r(me);$a=a(ig,"SPAN",{});var sg=r($a);m(Et.$$.fragment,sg),sg.forEach(t),ig.forEach(t),Ru=p(Qs),Ja=a(Qs,"SPAN",{});var hg=r(Ja);Hu=h(hg,"Prerequisites \u{1F3D7}\uFE0F"),hg.forEach(t),Qs.forEach(t),Nn=h(e,`

Before diving into the notebook, you need to:
`),de=a(e,"P",{});var qs=r(de);zu=h(qs,"\u{1F532} \u{1F4DA} "),ql=a(qs,"STRONG",{});var Um=r(ql);Vu=h(Um,"Study "),Tt=a(Um,"A",{href:!0,rel:!0});var ug=r(Tt);Bu=h(ug,"what ML-Agents is and how it works by reading Unit 5"),ug.forEach(t),Um.forEach(t),Yu=h(qs,"  \u{1F917}"),qs.forEach(t),Wn=p(e),C=a(e,"H1",{class:!0});var Ks=r(C);ge=a(Ks,"A",{id:!0,class:!0,href:!0});var fg=r(ge);Ua=a(fg,"SPAN",{});var pg=r(Ua);m($t.$$.fragment,pg),pg.forEach(t),fg.forEach(t),Xu=p(Ks),ka=a(Ks,"SPAN",{});var cg=r(ka);Fu=h(cg,"Let's train our agents \u{1F680}"),cg.forEach(t),Ks.forEach(t),Cn=p(e),P=a(e,"H2",{class:!0});var eh=r(P);ve=a(eh,"A",{id:!0,class:!0,href:!0});var mg=r(ve);Ia=a(mg,"SPAN",{});var dg=r(Ia);m(Jt.$$.fragment,dg),dg.forEach(t),mg.forEach(t),Ou=p(eh),ja=a(eh,"SPAN",{});var gg=r(ja);Du=h(gg,"Set the GPU \u{1F4AA}"),gg.forEach(t),eh.forEach(t),Pn=p(e),Kl=a(e,"UL",{});var vg=r(Kl);ye=a(vg,"LI",{});var ln=r(ye);Qu=h(ln,"To "),Aa=a(ln,"STRONG",{});var yg=r(Aa);qu=h(yg,"accelerate the agent\u2019s training, we\u2019ll use a GPU"),yg.forEach(t),Ku=h(ln,". To do that, go to "),Sa=a(ln,"CODE",{});var wg=r(Sa);ef=h(wg,"Runtime > Change Runtime type"),wg.forEach(t),ln.forEach(t),vg.forEach(t),Ln=p(e),Ut=a(e,"IMG",{src:!0,alt:!0}),Rn=p(e),eo=a(e,"UL",{});var bg=r(eo);xa=a(bg,"LI",{});var Mg=r(xa);Ga=a(Mg,"CODE",{});var _g=r(Ga);tf=h(_g,"Hardware Accelerator > GPU"),_g.forEach(t),Mg.forEach(t),bg.forEach(t),Hn=p(e),kt=a(e,"IMG",{src:!0,alt:!0}),zn=p(e),L=a(e,"H2",{class:!0});var th=r(L);we=a(th,"A",{id:!0,class:!0,href:!0});var Eg=r(we);Za=a(Eg,"SPAN",{});var Tg=r(Za);m(It.$$.fragment,Tg),Tg.forEach(t),Eg.forEach(t),lf=p(th),Na=a(th,"SPAN",{});var $g=r(Na);of=h($g,"Clone the repository and install the dependencies \u{1F53D}"),$g.forEach(t),th.forEach(t),Vn=h(e,`

- We need to clone the repository that **contains the experimental version of the library that allows you to push your trained agent to the Hub.**

	`),m(jt.$$.fragment,e),Bn=p(e),m(At.$$.fragment,e),Yn=p(e),R=a(e,"H2",{class:!0});var lh=r(R);be=a(lh,"A",{id:!0,class:!0,href:!0});var Jg=r(be);Wa=a(Jg,"SPAN",{});var Ug=r(Wa);m(St.$$.fragment,Ug),Ug.forEach(t),Jg.forEach(t),af=p(lh),Ca=a(lh,"SPAN",{});var kg=r(Ca);rf=h(kg,"SnowballTarget \u26C4"),kg.forEach(t),lh.forEach(t),Xn=p(e),xt=a(e,"P",{});var km=r(xt);nf=h(km,`If you need a refresher on how this environment works check this section \u{1F449}
`),Gt=a(km,"A",{href:!0,rel:!0});var Ig=r(Gt);sf=h(Ig,"https://huggingface.co/deep-rl-course/unit5/snowball-target"),Ig.forEach(t),km.forEach(t),Fn=p(e),H=a(e,"H3",{class:!0});var oh=r(H);Me=a(oh,"A",{id:!0,class:!0,href:!0});var jg=r(Me);Pa=a(jg,"SPAN",{});var Ag=r(Pa);m(Zt.$$.fragment,Ag),Ag.forEach(t),jg.forEach(t),hf=p(oh),to=a(oh,"SPAN",{});var Im=r(to);uf=h(Im,"Download and move the environment zip file in "),La=a(Im,"CODE",{});var Sg=r(La);ff=h(Sg,"./training-envs-executables/linux/"),Sg.forEach(t),Im.forEach(t),oh.forEach(t),On=p(e),U=a(e,"UL",{});var Do=r(U);Ra=a(Do,"LI",{});var xg=r(Ra);pf=h(xg,"Our environment executable is in a zip file."),xg.forEach(t),cf=p(Do),lo=a(Do,"LI",{});var jm=r(lo);mf=h(jm,"We need to download it and place it to "),Ha=a(jm,"CODE",{});var Gg=r(Ha);df=h(Gg,"./training-envs-executables/linux/"),Gg.forEach(t),jm.forEach(t),gf=p(Do),za=a(Do,"LI",{});var Zg=r(za);vf=h(Zg,"We use a linux executable because we use colab, and colab machines OS is Ubuntu (linux)"),Zg.forEach(t),Do.forEach(t),Dn=p(e),m(Nt.$$.fragment,e),Qn=p(e),k=a(e,"P",{});var Qo=r(k);yf=h(Qo,"Download the file SnowballTarget.zip from "),Wt=a(Qo,"A",{href:!0,rel:!0});var Ng=r(Wt);wf=h(Ng,"https://drive.google.com/file/d/1YHHLjyj6gaZ3Gemx1hQgqrPgSS2ZhmB5"),Ng.forEach(t),bf=h(Qo," using "),Va=a(Qo,"CODE",{});var Wg=r(Va);Mf=h(Wg,"wget"),Wg.forEach(t),_f=h(Qo,"."),Qo.forEach(t),qn=p(e),Ct=a(e,"P",{});var Am=r(Ct);Ef=h(Am,"Check out the full solution to download large files from GDrive "),Pt=a(Am,"A",{href:!0,rel:!0});var Cg=r(Pt);Tf=h(Cg,"here"),Cg.forEach(t),Am.forEach(t),Kn=p(e),m(Lt.$$.fragment,e),ei=p(e),oo=a(e,"P",{});var Pg=r(oo);$f=h(Pg,"We unzip the executable.zip file"),Pg.forEach(t),ti=p(e),m(Rt.$$.fragment,e),li=p(e),ao=a(e,"P",{});var Lg=r(ao);Jf=h(Lg,"Make sure your file is accessible"),Lg.forEach(t),oi=p(e),m(Ht.$$.fragment,e),ai=p(e),z=a(e,"H3",{class:!0});var ah=r(z);_e=a(ah,"A",{id:!0,class:!0,href:!0});var Rg=r(_e);Ba=a(Rg,"SPAN",{});var Hg=r(Ba);m(zt.$$.fragment,Hg),Hg.forEach(t),Rg.forEach(t),Uf=p(ah),Ya=a(ah,"SPAN",{});var zg=r(Ya);kf=h(zg,"Define the SnowballTarget config file"),zg.forEach(t),ah.forEach(t),ri=h(e,`

- In ML-Agents, you define the **training hyperparameters in config.yaml files.**
`),Vt=a(e,"P",{});var Sm=r(Vt);If=h(Sm,"There are multiple hyperparameters. To understand them better, you should read the explanation for each one in "),Bt=a(Sm,"A",{href:!0,rel:!0});var Vg=r(Bt);jf=h(Vg,"the documentation"),Vg.forEach(t),Sm.forEach(t),ni=p(e),Ee=a(e,"P",{});var rh=r(Ee);Af=h(rh,"You need to create a "),Xa=a(rh,"CODE",{});var Bg=r(Xa);Sf=h(Bg,"SnowballTarget.yaml"),Bg.forEach(t),xf=h(rh," config file in ./content/ml-agents/config/ppo/"),rh.forEach(t),ii=p(e),I=a(e,"P",{});var qo=r(I);Gf=h(qo,"We\u2019ll give you a preliminary version of this config (to copy and paste into your "),Fa=a(qo,"CODE",{});var Yg=r(Fa);Zf=h(Yg,"SnowballTarget.yaml file"),Yg.forEach(t),Nf=h(qo,"), "),Oa=a(qo,"STRONG",{});var Xg=r(Oa);Wf=h(Xg,"but you should modify it"),Xg.forEach(t),Cf=h(qo,"."),qo.forEach(t),si=p(e),m(Yt.$$.fragment,e),hi=p(e),Xt=a(e,"IMG",{src:!0,alt:!0}),ui=p(e),Ft=a(e,"IMG",{src:!0,alt:!0}),fi=p(e),Te=a(e,"P",{});var nh=r(Te);Pf=h(nh,"As an experiment, try to modify some other hyperparameters. Unity provides very "),Ot=a(nh,"A",{href:!0,rel:!0});var Fg=r(Ot);Lf=h(Fg,"good documentation explaining each of them here"),Fg.forEach(t),Rf=h(nh,"."),nh.forEach(t),pi=p(e),ro=a(e,"P",{});var Og=r(ro);Hf=h(Og,"Now that you\u2019ve created the config file and understand what most hyperparameters do, we\u2019re ready to train our agent \u{1F525}."),Og.forEach(t),ci=p(e),V=a(e,"H3",{class:!0});var ih=r(V);$e=a(ih,"A",{id:!0,class:!0,href:!0});var Dg=r($e);Da=a(Dg,"SPAN",{});var Qg=r(Da);m(Dt.$$.fragment,Qg),Qg.forEach(t),Dg.forEach(t),zf=p(ih),Qa=a(ih,"SPAN",{});var qg=r(Qa);Vf=h(qg,"Train the agent"),qg.forEach(t),ih.forEach(t),mi=p(e),Qt=a(e,"P",{});var xm=r(Qt);Bf=h(xm,"To train our agent, we need to "),qa=a(xm,"STRONG",{});var Kg=r(qa);Yf=h(Kg,"launch mlagents-learn and select the executable containing the environment."),Kg.forEach(t),xm.forEach(t),di=p(e),no=a(e,"P",{});var ev=r(no);Xf=h(ev,"We define four parameters:"),ev.forEach(t),gi=p(e),_=a(e,"OL",{});var Fe=r(_);io=a(Fe,"LI",{});var Gm=r(io);Ka=a(Gm,"CODE",{});var tv=r(Ka);Ff=h(tv,"mlagents-learn <config>"),tv.forEach(t),Of=h(Gm,": the path where the hyperparameter config file is."),Gm.forEach(t),Df=p(Fe),so=a(Fe,"LI",{});var Zm=r(so);er=a(Zm,"CODE",{});var lv=r(er);Qf=h(lv,"--env"),lv.forEach(t),qf=h(Zm,": where the environment executable is."),Zm.forEach(t),Kf=p(Fe),ho=a(Fe,"LI",{});var Nm=r(ho);tr=a(Nm,"CODE",{});var ov=r(tr);ep=h(ov,"--run_id"),ov.forEach(t),tp=h(Nm,": the name you want to give to your training run id."),Nm.forEach(t),lp=p(Fe),uo=a(Fe,"LI",{});var Wm=r(uo);lr=a(Wm,"CODE",{});var av=r(lr);op=h(av,"--no-graphics"),av.forEach(t),ap=h(Wm,": to not launch the visualization during the training."),Wm.forEach(t),Fe.forEach(t),vi=p(e),qt=a(e,"IMG",{src:!0,alt:!0}),yi=p(e),Je=a(e,"P",{});var sh=r(Je);rp=h(sh,"Train the model and use the "),or=a(sh,"CODE",{});var rv=r(or);np=h(rv,"--resume"),rv.forEach(t),ip=h(sh," flag to continue training in case of interruption."),sh.forEach(t),wi=p(e),fo=a(e,"BLOCKQUOTE",{});var nv=r(fo);Kt=a(nv,"P",{});var hh=r(Kt);sp=h(hh,"It will fail the first time if and when you use "),ar=a(hh,"CODE",{});var iv=r(ar);hp=h(iv,"--resume"),iv.forEach(t),up=h(hh,". Try rerunning the block to bypass the error."),hh.forEach(t),nv.forEach(t),bi=p(e),po=a(e,"P",{});var sv=r(po);fp=h(sv,"The training will take 10 to 35min depending on your config. Go take a \u2615\uFE0F you deserve it \u{1F917}."),sv.forEach(t),Mi=p(e),m(el.$$.fragment,e),_i=p(e),B=a(e,"H3",{class:!0});var uh=r(B);Ue=a(uh,"A",{id:!0,class:!0,href:!0});var hv=r(Ue);rr=a(hv,"SPAN",{});var uv=r(rr);m(tl.$$.fragment,uv),uv.forEach(t),hv.forEach(t),pp=p(uh),nr=a(uh,"SPAN",{});var fv=r(nr);cp=h(fv,"Push the agent to the Hugging Face Hub"),fv.forEach(t),uh.forEach(t),Ei=p(e),co=a(e,"UL",{});var pv=r(co);mo=a(pv,"LI",{});var Cm=r(mo);mp=h(Cm,"Now that we\u2019ve trained our agent, we\u2019re "),ir=a(Cm,"STRONG",{});var cv=r(ir);dp=h(cv,"ready to push it to the Hub and visualize it playing on your browser\u{1F525}."),cv.forEach(t),Cm.forEach(t),pv.forEach(t),Ti=p(e),go=a(e,"P",{});var mv=r(go);gp=h(mv,"To be able to share your model with the community, there are three more steps to follow:"),mv.forEach(t),$i=p(e),ll=a(e,"P",{});var Pm=r(ll);vp=h(Pm,"1\uFE0F\u20E3 (If it\u2019s not already done) create an account to HF \u27A1 "),ol=a(Pm,"A",{href:!0,rel:!0});var dv=r(ol);yp=h(dv,"https://huggingface.co/join"),dv.forEach(t),Pm.forEach(t),Ji=p(e),vo=a(e,"P",{});var gv=r(vo);wp=h(gv,"2\uFE0F\u20E3 Sign in and store your authentication token from the Hugging Face website."),gv.forEach(t),Ui=p(e),yo=a(e,"UL",{});var vv=r(yo);ke=a(vv,"LI",{});var on=r(ke);bp=h(on,"Create a new token ("),al=a(on,"A",{href:!0,rel:!0});var yv=r(al);Mp=h(yv,"https://huggingface.co/settings/tokens"),yv.forEach(t),_p=h(on,") "),sr=a(on,"STRONG",{});var wv=r(sr);Ep=h(wv,"with write role"),wv.forEach(t),on.forEach(t),vv.forEach(t),ki=p(e),rl=a(e,"IMG",{src:!0,alt:!0}),Ii=p(e),Ie=a(e,"UL",{});var fh=r(Ie);hr=a(fh,"LI",{});var bv=r(hr);Tp=h(bv,"Copy the token"),bv.forEach(t),$p=p(fh),ur=a(fh,"LI",{});var Mv=r(ur);Jp=h(Mv,"Run the cell below and paste the token"),Mv.forEach(t),fh.forEach(t),ji=p(e),m(nl.$$.fragment,e),Ai=p(e),il=a(e,"P",{});var Lm=r(il);Up=h(Lm,"If you don\u2019t want to use Google Colab or a Jupyter Notebook, you need to use this command instead: "),fr=a(Lm,"CODE",{});var _v=r(fr);kp=h(_v,"huggingface-cli login"),_v.forEach(t),Lm.forEach(t),Si=p(e),je=a(e,"P",{});var ph=r(je);Ip=h(ph,"Then we need to run "),pr=a(ph,"CODE",{});var Ev=r(pr);jp=h(Ev,"mlagents-push-to-hf"),Ev.forEach(t),Ap=h(ph,"."),ph.forEach(t),xi=p(e),wo=a(e,"P",{});var Tv=r(wo);Sp=h(Tv,"And we define four parameters:"),Tv.forEach(t),Gi=p(e),E=a(e,"OL",{});var Oe=r(E);bo=a(Oe,"LI",{});var Rm=r(bo);cr=a(Rm,"CODE",{});var $v=r(cr);xp=h($v,"--run-id"),$v.forEach(t),Gp=h(Rm,": the name of the training run id."),Rm.forEach(t),Zp=p(Oe),sl=a(Oe,"LI",{});var ch=r(sl);mr=a(ch,"CODE",{});var Jv=r(mr);Np=h(Jv,"--local-dir"),Jv.forEach(t),Wp=h(ch,": where the agent was saved, it\u2019s results/"),Mo=a(ch,"RUN_ID",{name:!0});var Uv=r(Mo);Cp=h(Uv,", so in my case results/First Training."),Uv.forEach(t),ch.forEach(t),Pp=p(Oe),hl=a(Oe,"LI",{});var mh=r(hl);dr=a(mh,"CODE",{});var kv=r(dr);Lp=h(kv,"--repo-id"),kv.forEach(t),Rp=h(mh,": the name of the Hugging Face repo you want to create or update. It\u2019s always "),Ae=a(mh,"YOUR",{huggingface:!0,username:!0});var Hm=r(Ae);Hp=h(Hm,"/"),Se=a(Hm,"THE",{repo:!0,name:!0});var zm=r(Se);zp=h(zm,"If the repo does not exist "),gr=a(zm,"STRONG",{});var Iv=r(gr);Vp=h(Iv,"it will be created automatically"),Iv.forEach(t),zm.forEach(t),Hm.forEach(t),mh.forEach(t),Bp=p(Oe),_o=a(Oe,"LI",{});var Vm=r(_o);vr=a(Vm,"CODE",{});var jv=r(vr);Yp=h(jv,"--commit-message"),jv.forEach(t),Xp=h(Vm,": since HF repos are git repositories you need to give a commit message."),Vm.forEach(t),Oe.forEach(t),Zi=p(e),ul=a(e,"IMG",{src:!0,alt:!0}),Ni=p(e),Eo=a(e,"P",{});var Av=r(Eo);Fp=h(Av,"For instance:"),Av.forEach(t),Wi=p(e),To=a(e,"P",{});var Sv=r(To);yr=a(Sv,"CODE",{});var xv=r(yr);Op=h(xv,'mlagents-push-to-hf --run-id="SnowballTarget1" --local-dir="./results/SnowballTarget1" --repo-id="ThomasSimonini/ppo-SnowballTarget" --commit-message="First Push"'),xv.forEach(t),Sv.forEach(t),Ci=p(e),m(fl.$$.fragment,e),Pi=p(e),$o=a(e,"P",{});var Gv=r($o);Dp=h(Gv,"If everything worked you should see this at the end of the process (but with a different url \u{1F606}) :"),Gv.forEach(t),Li=p(e),m(pl.$$.fragment,e),Ri=p(e),cl=a(e,"P",{});var Bm=r(cl);Qp=h(Bm,"It\u2019s the link to your model. It contains a model card that explains how to use it, your Tensorboard, and your config file. "),wr=a(Bm,"STRONG",{});var Zv=r(wr);qp=h(Zv,"What\u2019s awesome is that it\u2019s a git repository, which means you can have different commits, update your repository with a new push, etc."),Zv.forEach(t),Bm.forEach(t),Hi=p(e),ml=a(e,"P",{});var Ym=r(ml);Kp=h(Ym,"But now comes the best: "),br=a(Ym,"STRONG",{});var Nv=r(br);ec=h(Nv,"being able to visualize your agent online \u{1F440}."),Nv.forEach(t),Ym.forEach(t),zi=p(e),Y=a(e,"H3",{class:!0});var dh=r(Y);xe=a(dh,"A",{id:!0,class:!0,href:!0});var Wv=r(xe);Mr=a(Wv,"SPAN",{});var Cv=r(Mr);m(dl.$$.fragment,Cv),Cv.forEach(t),Wv.forEach(t),tc=p(dh),_r=a(dh,"SPAN",{});var Pv=r(_r);lc=h(Pv,"Watch your agent playing \u{1F440}"),Pv.forEach(t),dh.forEach(t),Vi=p(e),Jo=a(e,"P",{});var Lv=r(Jo);oc=h(Lv,"This step it\u2019s simple:"),Lv.forEach(t),Bi=p(e),j=a(e,"OL",{});var Ko=r(j);Er=a(Ko,"LI",{});var Rv=r(Er);Tr=a(Rv,"P",{});var Hv=r(Tr);ac=h(Hv,"Remember your repo-id"),Hv.forEach(t),Rv.forEach(t),rc=p(Ko),$r=a(Ko,"LI",{});var zv=r($r);Uo=a(zv,"P",{});var Xm=r(Uo);nc=h(Xm,"Go here: "),gl=a(Xm,"A",{href:!0,rel:!0});var Vv=r(gl);ic=h(Vv,"https://huggingface.co/spaces/ThomasSimonini/ML-Agents-SnowballTarget"),Vv.forEach(t),Xm.forEach(t),zv.forEach(t),sc=p(Ko),Jr=a(Ko,"LI",{});var Bv=r(Jr);Ur=a(Bv,"P",{});var Yv=r(Ur);hc=h(Yv,"Launch the game and put it in full screen by clicking on the bottom right button"),Yv.forEach(t),Bv.forEach(t),Ko.forEach(t),Yi=p(e),vl=a(e,"IMG",{src:!0,alt:!0}),Xi=p(e),Ge=a(e,"OL",{});var gh=r(Ge);kr=a(gh,"LI",{});var Xv=r(kr);Ir=a(Xv,"P",{});var Fv=r(Ir);uc=h(Fv,"In step 1, choose your model repository, which is the model id (in my case ThomasSimonini/ppo-SnowballTarget)."),Fv.forEach(t),Xv.forEach(t),fc=p(gh),jr=a(gh,"LI",{});var Ov=r(jr);yl=a(Ov,"P",{});var vh=r(yl);pc=h(vh,"In step 2, "),Ar=a(vh,"STRONG",{});var Dv=r(Ar);cc=h(Dv,"choose what model you want to replay"),Dv.forEach(t),mc=h(vh,":"),vh.forEach(t),Ov.forEach(t),gh.forEach(t),Fi=p(e),Ze=a(e,"UL",{});var yh=r(Ze);Sr=a(yh,"LI",{});var Qv=r(Sr);dc=h(Qv,"I have multiple ones since we saved a model every 500000 timesteps."),Qv.forEach(t),gc=p(yh),ko=a(yh,"LI",{});var Fm=r(ko);vc=h(Fm,"But if I want the more recent I choose "),xr=a(Fm,"CODE",{});var qv=r(xr);yc=h(qv,"SnowballTarget.onnx"),qv.forEach(t),Fm.forEach(t),yh.forEach(t),Oi=p(e),wl=a(e,"P",{});var Om=r(wl);wc=h(Om,"\u{1F449} It\u2019s nice to "),Gr=a(Om,"STRONG",{});var Kv=r(Gr);bc=h(Kv,"try different model stages to see the improvement of the agent."),Kv.forEach(t),Om.forEach(t),Di=p(e),Io=a(e,"P",{});var ey=r(Io);Mc=h(ey,"And don\u2019t hesitate to share the best score your agent gets on discord in the #rl-i-made-this channel \u{1F525}"),ey.forEach(t),Qi=p(e),jo=a(e,"P",{});var ty=r(jo);_c=h(ty,"Now let\u2019s try a more challenging environment called Pyramids."),ty.forEach(t),qi=p(e),X=a(e,"H2",{class:!0});var wh=r(X);Ne=a(wh,"A",{id:!0,class:!0,href:!0});var ly=r(Ne);Zr=a(ly,"SPAN",{});var oy=r(Zr);m(bl.$$.fragment,oy),oy.forEach(t),ly.forEach(t),Ec=p(wh),Nr=a(wh,"SPAN",{});var ay=r(Nr);Tc=h(ay,"Pyramids \u{1F3C6}"),ay.forEach(t),wh.forEach(t),Ki=p(e),F=a(e,"H3",{class:!0});var bh=r(F);We=a(bh,"A",{id:!0,class:!0,href:!0});var ry=r(We);Wr=a(ry,"SPAN",{});var ny=r(Wr);m(Ml.$$.fragment,ny),ny.forEach(t),ry.forEach(t),$c=p(bh),Ao=a(bh,"SPAN",{});var Dm=r(Ao);Jc=h(Dm,"Download and move the environment zip file in "),Cr=a(Dm,"CODE",{});var iy=r(Cr);Uc=h(iy,"./training-envs-executables/linux/"),iy.forEach(t),Dm.forEach(t),bh.forEach(t),es=h(e,`

- Our environment executable is in a zip file.
- We need to download it and place it into \`./training-envs-executables/linux/\`
- We use a linux executable because we're using colab, and the colab machine's OS is Ubuntu (linux)
`),T=a(e,"P",{});var Bl=r(T);kc=h(Bl,"Download the file Pyramids.zip from "),_l=a(Bl,"A",{href:!0,rel:!0});var sy=r(_l);Ic=h(sy,"https://drive.google.com/uc?export=download&id=1UiFNdKlsH0NTu32xV-giYUEVKV4-vc7H"),sy.forEach(t),jc=h(Bl," using "),Pr=a(Bl,"CODE",{});var hy=r(Pr);Ac=h(hy,"wget"),hy.forEach(t),Sc=h(Bl,". Check out the full solution to download large files from GDrive "),El=a(Bl,"A",{href:!0,rel:!0});var uy=r(El);xc=h(uy,"here"),uy.forEach(t),Bl.forEach(t),ts=p(e),m(Tl.$$.fragment,e),ls=p(e),So=a(e,"P",{});var fy=r(So);Gc=h(fy,"Unzip it"),fy.forEach(t),os=p(e),m($l.$$.fragment,e),as=p(e),xo=a(e,"P",{});var py=r(xo);Zc=h(py,"Make sure your file is accessible"),py.forEach(t),rs=p(e),m(Jl.$$.fragment,e),ns=p(e),O=a(e,"H3",{class:!0});var Mh=r(O);Ce=a(Mh,"A",{id:!0,class:!0,href:!0});var cy=r(Ce);Lr=a(cy,"SPAN",{});var my=r(Lr);m(Ul.$$.fragment,my),my.forEach(t),cy.forEach(t),Nc=p(Mh),Rr=a(Mh,"SPAN",{});var dy=r(Rr);Wc=h(dy,"Modify the PyramidsRND config file"),dy.forEach(t),Mh.forEach(t),is=h(e,`

  
- Contrary to the first environment, which was a custom one, **Pyramids was made by the Unity team**.
- So the PyramidsRND config file already exists and is in ./content/ml-agents/config/ppo/PyramidsRND.yaml
- You might ask why "RND" is in PyramidsRND. RND stands for *random network distillation* it's a way to generate curiosity rewards. If you want to know more about that, we wrote an article explaining this technique: https://medium.com/data-from-the-trenches/curiosity-driven-learning-through-random-network-distillation-488ffd8e5938
`),Go=a(e,"P",{});var gy=r(Go);Cc=h(gy,"For this training, we\u2019ll modify one thing:"),gy.forEach(t),ss=p(e),Zo=a(e,"UL",{});var vy=r(Zo);No=a(vy,"LI",{});var Qm=r(No);Pc=h(Qm,`The total training steps hyperparameter is too high since we can hit the benchmark (mean reward = 1.75) in only 1M training steps.
\u{1F449} To do that, we go to config/ppo/PyramidsRND.yaml,`),Hr=a(Qm,"STRONG",{});var yy=r(Hr);Lc=h(yy,"and change max_steps to 1000000."),yy.forEach(t),Qm.forEach(t),vy.forEach(t),hs=p(e),kl=a(e,"IMG",{src:!0,alt:!0}),us=p(e),Pe=a(e,"P",{});var _h=r(Pe);Rc=h(_h,"As an experiment, you should also try to modify some other hyperparameters. Unity provides very "),Il=a(_h,"A",{href:!0,rel:!0});var wy=r(Il);Hc=h(wy,"good documentation explaining each of them here"),wy.forEach(t),zc=h(_h,"."),_h.forEach(t),fs=p(e),Wo=a(e,"P",{});var by=r(Wo);Vc=h(by,"We\u2019re now ready to train our agent \u{1F525}."),by.forEach(t),ps=p(e),D=a(e,"H3",{class:!0});var Eh=r(D);Le=a(Eh,"A",{id:!0,class:!0,href:!0});var My=r(Le);zr=a(My,"SPAN",{});var _y=r(zr);m(jl.$$.fragment,_y),_y.forEach(t),My.forEach(t),Bc=p(Eh),Vr=a(Eh,"SPAN",{});var Ey=r(Vr);Yc=h(Ey,"Train the agent"),Ey.forEach(t),Eh.forEach(t),cs=p(e),Co=a(e,"P",{});var Ty=r(Co);Xc=h(Ty,"The training will take 30 to 45min depending on your machine, go take a \u2615\uFE0F you deserve it \u{1F917}."),Ty.forEach(t),ms=p(e),m(Al.$$.fragment,e),ds=p(e),Q=a(e,"H3",{class:!0});var Th=r(Q);Re=a(Th,"A",{id:!0,class:!0,href:!0});var $y=r(Re);Br=a($y,"SPAN",{});var Jy=r(Br);m(Sl.$$.fragment,Jy),Jy.forEach(t),$y.forEach(t),Fc=p(Th),Yr=a(Th,"SPAN",{});var Uy=r(Yr);Oc=h(Uy,"Push the agent to the Hugging Face Hub"),Uy.forEach(t),Th.forEach(t),gs=p(e),Po=a(e,"UL",{});var ky=r(Po);Lo=a(ky,"LI",{});var qm=r(Lo);Dc=h(qm,"Now that we trained our agent, we\u2019re "),Xr=a(qm,"STRONG",{});var Iy=r(Xr);Qc=h(Iy,"ready to push it to the Hub to be able to visualize it playing on your browser\u{1F525}."),Iy.forEach(t),qm.forEach(t),ky.forEach(t),vs=p(e),m(xl.$$.fragment,e),ys=p(e),q=a(e,"H3",{class:!0});var $h=r(q);He=a($h,"A",{id:!0,class:!0,href:!0});var jy=r(He);Fr=a(jy,"SPAN",{});var Ay=r(Fr);m(Gl.$$.fragment,Ay),Ay.forEach(t),jy.forEach(t),qc=p($h),Or=a($h,"SPAN",{});var Sy=r(Or);Kc=h(Sy,"Watch your agent playing \u{1F440}"),Sy.forEach(t),$h.forEach(t),ws=p(e),Zl=a(e,"P",{});var Km=r(Zl);em=h(Km,"\u{1F449} "),Nl=a(Km,"A",{href:!0,rel:!0});var xy=r(Nl);tm=h(xy,"https://huggingface.co/spaces/unity/ML-Agents-Pyramids"),xy.forEach(t),Km.forEach(t),bs=p(e),K=a(e,"H3",{class:!0});var Jh=r(K);ze=a(Jh,"A",{id:!0,class:!0,href:!0});var Gy=r(ze);Dr=a(Gy,"SPAN",{});var Zy=r(Dr);m(Wl.$$.fragment,Zy),Zy.forEach(t),Gy.forEach(t),lm=p(Jh),Qr=a(Jh,"SPAN",{});var Ny=r(Qr);om=h(Ny,"\u{1F381} Bonus: Why not train on another environment?"),Ny.forEach(t),Jh.forEach(t),Ms=h(e,`

  
Now that you know how to train an agent using MLAgents, **why not try another environment?**
`),Ro=a(e,"P",{});var Wy=r(Ro);am=h(Wy,"MLAgents provides 17 different environments and we\u2019re building some custom ones. The best way to learn is to try things on your own, have fun."),Wy.forEach(t),_s=p(e),Ho=a(e,"P",{});var Cy=r(Ho);zo=a(Cy,"IMG",{src:!0,alt:!0}),Cy.forEach(t),Es=p(e),Cl=a(e,"P",{});var ed=r(Cl);rm=h(ed,"You have the full list of the one currently available environments on Hugging Face here \u{1F449} "),Pl=a(ed,"A",{href:!0,rel:!0});var Py=r(Pl);nm=h(Py,"https://github.com/huggingface/ml-agents#the-environments"),Py.forEach(t),ed.forEach(t),Ts=p(e),Ll=a(e,"P",{});var td=r(Ll);im=h(td,"For the demos to visualize your agent \u{1F449} "),Rl=a(td,"A",{href:!0,rel:!0});var Ly=r(Rl);sm=h(Ly,"https://huggingface.co/unity"),Ly.forEach(t),td.forEach(t),$s=p(e),Vo=a(e,"P",{});var Ry=r(Vo);hm=h(Ry,"For now we have integrated:"),Ry.forEach(t),Js=p(e),Ve=a(e,"UL",{});var Uh=r(Ve);Be=a(Uh,"LI",{});var an=r(Be);Hl=a(an,"A",{href:!0,rel:!0});var Hy=r(Hl);um=h(Hy,"Worm"),Hy.forEach(t),fm=h(an," demo where you teach a "),qr=a(an,"STRONG",{});var zy=r(qr);pm=h(zy,"worm to crawl"),zy.forEach(t),cm=h(an,"."),an.forEach(t),mm=p(Uh),Ye=a(Uh,"LI",{});var rn=r(Ye);zl=a(rn,"A",{href:!0,rel:!0});var Vy=r(zl);dm=h(Vy,"Walker"),Vy.forEach(t),gm=h(rn," demo where you teach an agent "),Kr=a(rn,"STRONG",{});var By=r(Kr);vm=h(By,"to walk towards a goal"),By.forEach(t),ym=h(rn,"."),rn.forEach(t),Uh.forEach(t),Us=p(e),Bo=a(e,"P",{});var Yy=r(Bo);wm=h(Yy,"That\u2019s all for today. Congrats on finishing this tutorial!"),Yy.forEach(t),ks=p(e),Yo=a(e,"P",{});var Xy=r(Yo);bm=h(Xy,"The best way to learn is to practice and try stuff. Why not try another environment? ML-Agents has 18 different environments, but you can also create your own. Check the documentation and have fun!"),Xy.forEach(t),Is=p(e),Xo=a(e,"P",{});var Fy=r(Xo);Mm=h(Fy,"See you on Unit 6 \u{1F525},"),Fy.forEach(t),js=p(e),ee=a(e,"H2",{class:!0});var kh=r(ee);Xe=a(kh,"A",{id:!0,class:!0,href:!0});var Oy=r(Xe);en=a(Oy,"SPAN",{});var Dy=r(en);m(Vl.$$.fragment,Dy),Dy.forEach(t),Oy.forEach(t),_m=p(kh),tn=a(kh,"SPAN",{});var Qy=r(tn);Em=h(Qy,"Keep Learning, Stay awesome \u{1F917}"),Qy.forEach(t),kh.forEach(t),this.h()},h(){u(A,"name","hf:doc:metadata"),u(A,"content",JSON.stringify(nw)),u(te,"id","handson"),u(te,"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"),u(te,"href","#handson"),u(S,"class","relative group"),M(qe.src,od="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/envs.png")||u(qe,"src",od),u(qe,"alt","Environments"),u(et,"href","https://huggingface.co/spaces/unity/ML-Agents-Pyramids"),u(et,"rel","nofollow"),u(lt,"href","https://huggingface.co/spaces/ThomasSimonini/ML-Agents-SnowballTarget"),u(lt,"rel","nofollow"),u(at,"href","https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),u(at,"rel","nofollow"),M(Fl.src,ad="https://colab.research.google.com/assets/colab-badge.svg")||u(Fl,"src",ad),u(Fl,"alt","Open In Colab"),u(nt,"href","https://colab.research.google.com/github/huggingface/deep-rl-class/blob/master/notebooks/unit5/unit5.ipynb"),u(nt,"rel","nofollow"),u(re,"id","unit-5-an-introduction-to-mlagents"),u(re,"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"),u(re,"href","#unit-5-an-introduction-to-mlagents"),u(x,"class","relative group"),M(st.src,rd="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/thumbnail.png")||u(st,"src",rd),u(st,"alt","Thumbnail"),u(pt,"href","https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),u(pt,"rel","nofollow"),M(ct.src,nd="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/pyramids.gif")||u(ct,"src",nd),u(ct,"alt","Pyramids"),M(mt.src,id="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballtarget.gif")||u(mt,"src",id),u(mt,"alt","SnowballTarget"),u(he,"id","environments"),u(he,"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"),u(he,"href","#environments"),u(G,"class","relative group"),u(gt,"href","https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Learning-Environment-Examples.md#pyramids"),u(gt,"rel","nofollow"),u(fe,"id","rllibrary"),u(fe,"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"),u(fe,"href","#rllibrary"),u(Z,"class","relative group"),u(yt,"href","https://github.com/Unity-Technologies/ml-agents"),u(yt,"rel","nofollow"),u(wt,"href","https://github.com/huggingface/deep-rl-class/issues"),u(wt,"rel","nofollow"),u(pe,"id","objectives-of-this-notebook"),u(pe,"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"),u(pe,"href","#objectives-of-this-notebook"),u(N,"class","relative group"),u(me,"id","prerequisites"),u(me,"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"),u(me,"href","#prerequisites"),u(W,"class","relative group"),u(Tt,"href","https://huggingface.co/deep-rl-course/unit5/introduction"),u(Tt,"rel","nofollow"),u(ge,"id","lets-train-our-agents"),u(ge,"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"),u(ge,"href","#lets-train-our-agents"),u(C,"class","relative group"),u(ve,"id","set-the-gpu"),u(ve,"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"),u(ve,"href","#set-the-gpu"),u(P,"class","relative group"),M(Ut.src,sd="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/notebooks/gpu-step1.jpg")||u(Ut,"src",sd),u(Ut,"alt","GPU Step 1"),M(kt.src,hd="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/notebooks/gpu-step2.jpg")||u(kt,"src",hd),u(kt,"alt","GPU Step 2"),u(we,"id","clone-the-repository-and-install-the-dependencies"),u(we,"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"),u(we,"href","#clone-the-repository-and-install-the-dependencies"),u(L,"class","relative group"),u(be,"id","snowballtarget"),u(be,"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"),u(be,"href","#snowballtarget"),u(R,"class","relative group"),u(Gt,"href","https://huggingface.co/deep-rl-course/unit5/snowball-target"),u(Gt,"rel","nofollow"),u(Me,"id","download-and-move-the-environment-zip-file-in-trainingenvsexecutableslinux"),u(Me,"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"),u(Me,"href","#download-and-move-the-environment-zip-file-in-trainingenvsexecutableslinux"),u(H,"class","relative group"),u(Wt,"href","https://drive.google.com/file/d/1YHHLjyj6gaZ3Gemx1hQgqrPgSS2ZhmB5"),u(Wt,"rel","nofollow"),u(Pt,"href","https://bcrf.biochem.wisc.edu/2021/02/05/download-google-drive-files-using-wget/"),u(Pt,"rel","nofollow"),u(_e,"id","define-the-snowballtarget-config-file"),u(_e,"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"),u(_e,"href","#define-the-snowballtarget-config-file"),u(z,"class","relative group"),u(Bt,"href","https://github.com/Unity-Technologies/ml-agents/blob/release_20_docs/docs/Training-Configuration-File.md"),u(Bt,"rel","nofollow"),M(Xt.src,ud="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballfight_config1.png")||u(Xt,"src",ud),u(Xt,"alt","Config SnowballTarget"),M(Ft.src,fd="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballfight_config2.png")||u(Ft,"src",fd),u(Ft,"alt","Config SnowballTarget"),u(Ot,"href","https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Training-Configuration-File.md"),u(Ot,"rel","nofollow"),u($e,"id","train-the-agent"),u($e,"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"),u($e,"href","#train-the-agent"),u(V,"class","relative group"),M(qt.src,pd="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/mlagentslearn.png")||u(qt,"src",pd),u(qt,"alt","MlAgents learn"),u(Ue,"id","push-the-agent-to-the-hugging-face-hub"),u(Ue,"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"),u(Ue,"href","#push-the-agent-to-the-hugging-face-hub"),u(B,"class","relative group"),u(ol,"href","https://huggingface.co/join"),u(ol,"rel","nofollow"),u(al,"href","https://huggingface.co/settings/tokens"),u(al,"rel","nofollow"),M(rl.src,cd="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/notebooks/create-token.jpg")||u(rl,"src",cd),u(rl,"alt","Create HF Token"),u(Mo,"name",""),u(Se,"repo",""),u(Se,"name",""),u(Ae,"huggingface",""),u(Ae,"username",""),M(ul.src,md="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/mlagentspushtohub.png")||u(ul,"src",md),u(ul,"alt","Push to Hub"),u(xe,"id","watch-your-agent-playing"),u(xe,"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"),u(xe,"href","#watch-your-agent-playing"),u(Y,"class","relative group"),u(gl,"href","https://huggingface.co/spaces/ThomasSimonini/ML-Agents-SnowballTarget"),u(gl,"rel","nofollow"),M(vl.src,dd="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballtarget_load.png")||u(vl,"src",dd),u(vl,"alt","Snowballtarget load"),u(Ne,"id","pyramids"),u(Ne,"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"),u(Ne,"href","#pyramids"),u(X,"class","relative group"),u(We,"id","download-and-move-the-environment-zip-file-in-trainingenvsexecutableslinux"),u(We,"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"),u(We,"href","#download-and-move-the-environment-zip-file-in-trainingenvsexecutableslinux"),u(F,"class","relative group"),u(_l,"href","https://drive.google.com/uc?export=download&id=1UiFNdKlsH0NTu32xV-giYUEVKV4-vc7H"),u(_l,"rel","nofollow"),u(El,"href","https://bcrf.biochem.wisc.edu/2021/02/05/download-google-drive-files-using-wget/"),u(El,"rel","nofollow"),u(Ce,"id","modify-the-pyramidsrnd-config-file"),u(Ce,"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"),u(Ce,"href","#modify-the-pyramidsrnd-config-file"),u(O,"class","relative group"),M(kl.src,gd="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/pyramids-config.png")||u(kl,"src",gd),u(kl,"alt","Pyramids config"),u(Il,"href","https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Training-Configuration-File.md"),u(Il,"rel","nofollow"),u(Le,"id","train-the-agent"),u(Le,"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"),u(Le,"href","#train-the-agent"),u(D,"class","relative group"),u(Re,"id","push-the-agent-to-the-hugging-face-hub"),u(Re,"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"),u(Re,"href","#push-the-agent-to-the-hugging-face-hub"),u(Q,"class","relative group"),u(He,"id","watch-your-agent-playing"),u(He,"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"),u(He,"href","#watch-your-agent-playing"),u(q,"class","relative group"),u(Nl,"href","https://huggingface.co/spaces/unity/ML-Agents-Pyramids"),u(Nl,"rel","nofollow"),u(ze,"id","bonus-why-not-train-on-another-environment"),u(ze,"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"),u(ze,"href","#bonus-why-not-train-on-another-environment"),u(K,"class","relative group"),M(zo.src,vd="https://miro.medium.com/max/1400/0*xERdThTRRM2k_U9f.png")||u(zo,"src",vd),u(zo,"alt","cover"),u(Pl,"href","https://github.com/huggingface/ml-agents#the-environments"),u(Pl,"rel","nofollow"),u(Rl,"href","https://huggingface.co/unity"),u(Rl,"rel","nofollow"),u(Hl,"href","https://huggingface.co/spaces/unity/ML-Agents-Worm"),u(Hl,"rel","nofollow"),u(zl,"href","https://huggingface.co/spaces/unity/ML-Agents-Walker"),u(zl,"rel","nofollow"),u(Xe,"id","keep-learning-stay-awesome"),u(Xe,"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"),u(Xe,"href","#keep-learning-stay-awesome"),u(ee,"class","relative group")},m(e,n){l(document.head,A),i(e,nn,n),i(e,S,n),l(S,te),l(te,ea),d(De,ea,null),l(S,Ih),l(S,ta),l(ta,jh),i(e,sn,n),d(Qe,e,n),i(e,hn,n),i(e,Yl,n),l(Yl,Ah),i(e,un,n),i(e,qe,n),i(e,fn,n),i(e,$,n),l($,Sh),l($,la),l(la,xh),l($,Gh),l($,oa),l(oa,Zh),l($,Nh),i(e,pn,n),i(e,le,n),l(le,Ke),l(Ke,Wh),l(Ke,et),l(et,Ch),l(Ke,Ph),l(le,Lh),l(le,tt),l(tt,Rh),l(tt,lt),l(lt,Hh),l(tt,zh),i(e,cn,n),i(e,ot,n),l(ot,Vh),l(ot,at),l(at,Bh),i(e,mn,n),i(e,rt,n),l(rt,aa),l(aa,Yh),l(rt,Xh),i(e,dn,n),i(e,Xl,n),l(Xl,nt),l(nt,Fl),i(e,gn,n),i(e,oe,n),l(oe,Fh),l(oe,ra),l(ra,Oh),l(oe,Dh),i(e,vn,n),i(e,ae,n),l(ae,Qh),l(ae,na),l(na,qh),l(ae,Kh),i(e,yn,n),i(e,x,n),l(x,re),l(re,ia),d(it,ia,null),l(x,eu),l(x,sa),l(sa,tu),i(e,wn,n),i(e,st,n),i(e,bn,n),i(e,Ol,n),l(Ol,lu),i(e,Mn,n),i(e,ne,n),l(ne,ht),l(ht,ou),l(ht,ha),l(ha,au),l(ht,ru),l(ne,nu),l(ne,ut),l(ut,iu),l(ut,ua),l(ua,su),l(ut,hu),i(e,_n,n),i(e,ie,n),l(ie,uu),l(ie,fa),l(fa,fu),l(ie,pu),i(e,En,n),i(e,ft,n),l(ft,cu),l(ft,pt),l(pt,mu),i(e,Tn,n),i(e,se,n),l(se,du),l(se,pa),l(pa,gu),l(se,vu),i(e,$n,n),i(e,ct,n),i(e,Jn,n),i(e,mt,n),i(e,Un,n),i(e,G,n),l(G,he),l(he,ca),d(dt,ca,null),l(G,yu),l(G,ma),l(ma,wu),i(e,kn,n),i(e,ue,n),l(ue,da),l(da,gt),l(gt,bu),l(ue,Mu),l(ue,ga),l(ga,_u),i(e,In,n),i(e,Z,n),l(Z,fe),l(fe,va),d(vt,va,null),l(Z,Eu),l(Z,ya),l(ya,Tu),i(e,jn,n),i(e,Dl,n),l(Dl,wa),l(wa,yt),l(yt,$u),i(e,An,n),i(e,J,n),l(J,Ju),l(J,ba),l(ba,Uu),l(J,ku),l(J,wt),l(wt,Iu),l(J,ju),i(e,Sn,n),i(e,N,n),l(N,pe),l(pe,Ma),d(bt,Ma,null),l(N,Au),l(N,_a),l(_a,Su),i(e,xn,n),i(e,Ql,n),l(Ql,xu),i(e,Gn,n),i(e,ce,n),l(ce,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),g(vt.$$.fragment,e),g(bt.$$.fragment,e),g(Et.$$.fragment,e),g($t.$$.fragment,e),g(Jt.$$.fragment,e),g(It.$$.fragment,e),g(jt.$$.fragment,e),g(At.$$.fragment,e),g(St.$$.fragment,e),g(Zt.$$.fragment,e),g(Nt.$$.fragment,e),g(Lt.$$.fragment,e),g(Rt.$$.fragment,e),g(Ht.$$.fragment,e),g(zt.$$.fragment,e),g(Yt.$$.fragment,e),g(Dt.$$.fragment,e),g(el.$$.fragment,e),g(tl.$$.fragment,e),g(nl.$$.fragment,e),g(fl.$$.fragment,e),g(pl.$$.fragment,e),g(dl.$$.fragment,e),g(bl.$$.fragment,e),g(Ml.$$.fragment,e),g(Tl.$$.fragment,e),g($l.$$.fragment,e),g(Jl.$$.fragment,e),g(Ul.$$.fragment,e),g(jl.$$.fragment,e),g(Al.$$.fragment,e),g(Sl.$$.fragment,e),g(xl.$$.fragment,e),g(Gl.$$.fragment,e),g(Wl.$$.fragment,e),g(Vl.$$.fragment,e),As=!0)},o(e){v(De.$$.fragment,e),v(Qe.$$.fragment,e),v(it.$$.fragment,e),v(dt.$$.fragment,e),v(vt.$$.fragment,e),v(bt.$$.fragment,e),v(Et.$$.fragment,e),v($t.$$.fragment,e),v(Jt.$$.fragment,e),v(It.$$.fragment,e),v(jt.$$.fragment,e),v(At.$$.fragment,e),v(St.$$.fragment,e),v(Zt.$$.fragment,e),v(Nt.$$.fragment,e),v(Lt.$$.fragment,e),v(Rt.$$.fragment,e),v(Ht.$$.fragment,e),v(zt.$$.fragment,e),v(Yt.$$.fragment,e),v(Dt.$$.fragment,e),v(el.$$.fragment,e),v(tl.$$.fragment,e),v(nl.$$.fragment,e),v(fl.$$.fragment,e),v(pl.$$.fragment,e),v(dl.$$.fragment,e),v(bl.$$.fragment,e),v(Ml.$$.fragment,e),v(Tl.$$.fragment,e),v($l.$$.fragment,e),v(Jl.$$.fragment,e),v(Ul.$$.fragment,e),v(jl.$$.fragment,e),v(Al.$$.fragment,e),v(Sl.$$.fragment,e),v(xl.$$.fragment,e),v(Gl.$$.fragment,e),v(Wl.$$.fragment,e),v(Vl.$$.fragment,e),As=!1},d(e){t(A),e&&t(nn),e&&t(S),y(De),e&&t(sn),y(Qe,e),e&&t(hn),e&&t(Yl),e&&t(un),e&&t(qe),e&&t(fn),e&&t($),e&&t(pn),e&&t(le),e&&t(cn),e&&t(ot),e&&t(mn),e&&t(rt),e&&t(dn),e&&t(Xl),e&&t(gn),e&&t(oe),e&&t(vn),e&&t(ae),e&&t(yn),e&&t(x),y(it),e&&t(wn),e&&t(st),e&&t(bn),e&&t(Ol),e&&t(Mn),e&&t(ne),e&&t(_n),e&&t(ie),e&&t(En),e&&t(ft),e&&t(Tn),e&&t(se),e&&t($n),e&&t(ct),e&&t(Jn),e&&t(mt),e&&t(Un),e&&t(G),y(dt),e&&t(kn),e&&t(ue),e&&t(In),e&&t(Z),y(vt),e&&t(jn),e&&t(Dl),e&&t(An),e&&t(J),e&&t(Sn),e&&t(N),y(bt),e&&t(xn),e&&t(Ql),e&&t(Gn),e&&t(ce),e&&t(Zn),e&&t(W),y(Et),e&&t(Nn),e&&t(de),e&&t(Wn),e&&t(C),y($t),e&&t(Cn),e&&t(P),y(Jt),e&&t(Pn),e&&t(Kl),e&&t(Ln),e&&t(Ut),e&&t(Rn),e&&t(eo),e&&t(Hn),e&&t(kt),e&&t(zn),e&&t(L),y(It),e&&t(Vn),y(jt,e),e&&t(Bn),y(At,e),e&&t(Yn),e&&t(R),y(St),e&&t(Xn),e&&t(xt),e&&t(Fn),e&&t(H),y(Zt),e&&t(On),e&&t(U),e&&t(Dn),y(Nt,e),e&&t(Qn),e&&t(k),e&&t(qn),e&&t(Ct),e&&t(Kn),y(Lt,e),e&&t(ei),e&&t(oo),e&&t(ti),y(Rt,e),e&&t(li),e&&t(ao),e&&t(oi),y(Ht,e),e&&t(ai),e&&t(z),y(zt),e&&t(ri),e&&t(Vt),e&&t(ni),e&&t(Ee),e&&t(ii),e&&t(I),e&&t(si),y(Yt,e),e&&t(hi),e&&t(Xt),e&&t(ui),e&&t(Ft),e&&t(fi),e&&t(Te),e&&t(pi),e&&t(ro),e&&t(ci),e&&t(V),y(Dt),e&&t(mi),e&&t(Qt),e&&t(di),e&&t(no),e&&t(gi),e&&t(_),e&&t(vi),e&&t(qt),e&&t(yi),e&&t(Je),e&&t(wi),e&&t(fo),e&&t(bi),e&&t(po),e&&t(Mi),y(el,e),e&&t(_i),e&&t(B),y(tl),e&&t(Ei),e&&t(co),e&&t(Ti),e&&t(go),e&&t($i),e&&t(ll),e&&t(Ji),e&&t(vo),e&&t(Ui),e&&t(yo),e&&t(ki),e&&t(rl),e&&t(Ii),e&&t(Ie),e&&t(ji),y(nl,e),e&&t(Ai),e&&t(il),e&&t(Si),e&&t(je),e&&t(xi),e&&t(wo),e&&t(Gi),e&&t(E),e&&t(Zi),e&&t(ul),e&&t(Ni),e&&t(Eo),e&&t(Wi),e&&t(To),e&&t(Ci),y(fl,e),e&&t(Pi),e&&t($o),e&&t(Li),y(pl,e),e&&t(Ri),e&&t(cl),e&&t(Hi),e&&t(ml),e&&t(zi),e&&t(Y),y(dl),e&&t(Vi),e&&t(Jo),e&&t(Bi),e&&t(j),e&&t(Yi),e&&t(vl),e&&t(Xi),e&&t(Ge),e&&t(Fi),e&&t(Ze),e&&t(Oi),e&&t(wl),e&&t(Di),e&&t(Io),e&&t(Qi),e&&t(jo),e&&t(qi),e&&t(X),y(bl),e&&t(Ki),e&&t(F),y(Ml),e&&t(es),e&&t(T),e&&t(ts),y(Tl,e),e&&t(ls),e&&t(So),e&&t(os),y($l,e),e&&t(as),e&&t(xo),e&&t(rs),y(Jl,e),e&&t(ns),e&&t(O),y(Ul),e&&t(is),e&&t(Go),e&&t(ss),e&&t(Zo),e&&t(hs),e&&t(kl),e&&t(us),e&&t(Pe),e&&t(fs),e&&t(Wo),e&&t(ps),e&&t(D),y(jl),e&&t(cs),e&&t(Co),e&&t(ms),y(Al,e),e&&t(ds),e&&t(Q),y(Sl),e&&t(gs),e&&t(Po),e&&t(vs),y(xl,e),e&&t(ys),e&&t(q),y(Gl),e&&t(ws),e&&t(Zl),e&&t(bs),e&&t(K),y(Wl),e&&t(Ms),e&&t(Ro),e&&t(_s),e&&t(Ho),e&&t(Es),e&&t(Cl),e&&t(Ts),e&&t(Ll),e&&t($s),e&&t(Vo),e&&t(Js),e&&t(Ve),e&&t(Us),e&&t(Bo),e&&t(ks),e&&t(Yo),e&&t(Is),e&&t(Xo),e&&t(js),e&&t(ee),y(Vl)}}}const nw={local:"lets-train-our-agents",sections:[{local:"set-the-gpu",title:"Set the GPU \u{1F4AA}"},{local:"clone-the-repository-and-install-the-dependencies",title:"Clone the repository and install the dependencies \u{1F53D}"},{local:"snowballtarget",sections:[{local:"download-and-move-the-environment-zip-file-in-trainingenvsexecutableslinux",title:"Download and move the environment zip file in `./training-envs-executables/linux/`"},{local:"define-the-snowballtarget-config-file",title:"Define the SnowballTarget config file"},{local:"train-the-agent",title:"Train the agent"},{local:"push-the-agent-to-the-hugging-face-hub",title:"Push the agent to the Hugging Face Hub"},{local:"watch-your-agent-playing",title:"Watch your agent playing \u{1F440}"}],title:"SnowballTarget \u26C4"},{local:"pyramids",sections:[{local:"download-and-move-the-environment-zip-file-in-trainingenvsexecutableslinux",title:"Download and move the environment zip file in `./training-envs-executables/linux/`"},{local:"modify-the-pyramidsrnd-config-file",title:"Modify the PyramidsRND config file"},{local:"train-the-agent",title:"Train the agent"},{local:"push-the-agent-to-the-hugging-face-hub",title:"Push the agent to the Hugging Face Hub"},{local:"watch-your-agent-playing",title:"Watch your agent playing \u{1F440}"},{local:"bonus-why-not-train-on-another-environment",title:"\u{1F381} Bonus: Why not train on another environment?"}],title:"Pyramids \u{1F3C6}"},{local:"keep-learning-stay-awesome",title:"Keep Learning, Stay awesome \u{1F917}"}],title:"Let's train our agents \u{1F680}"};function iw(ld){return ow(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pw extends qy{constructor(A){super();Ky(this,A,iw,rw,ew,{})}}export{pw as default,nw as metadata};
