import{S as zy,i as Vy,s as By,e as o,k as f,w as c,t as s,M as Yy,c as a,d as t,m as p,a as n,x as m,h,b as u,N as M,G as l,g as i,y as g,L as Xy,q as d,o as v,B as y,v as Fy}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 Oy}from"../../chunks/CourseFloatingBanner-hf-doc-builder.js";function Qy(Fm){let A,ar,S,te,Do,Fe,$h,qo,Jh,nr,Oe,rr,zl,Uh,ir,Qe,Om,sr,$,kh,Ko,Ih,jh,ea,Ah,Sh,hr,le,De,xh,qe,Gh,Zh,Nh,Ke,Wh,et,Ch,Ph,ur,tt,Lh,lt,Rh,fr,ot,ta,Hh,zh,pr,Vl,at,Bl,Qm,cr,oe,Vh,la,Bh,Yh,mr,ae,Xh,oa,Fh,Oh,gr,x,ne,aa,nt,Qh,na,Dh,dr,rt,Dm,vr,Yl,qh,yr,re,it,Kh,ra,eu,tu,lu,st,ou,ia,au,nu,wr,ie,ru,sa,iu,su,br,ht,hu,ut,uu,Mr,se,fu,ha,pu,cu,_r,ft,qm,Er,pt,Km,Tr,G,he,ua,ct,mu,fa,gu,$r,ue,pa,mt,du,vu,ca,yu,Jr,Z,fe,ma,gt,wu,ga,bu,Ur,Xl,da,dt,Mu,kr,J,_u,va,Eu,Tu,vt,$u,Ju,Ir,N,pe,ya,yt,Uu,wa,ku,jr,Fl,Iu,Ar,ce,wt,ju,ba,Au,Su,xu,bt,Gu,Ma,Zu,Nu,Sr,W,me,_a,Mt,Wu,Ea,Cu,xr,ge,Pu,Ol,Lu,_t,Ru,Hu,Gr,C,de,Ta,Et,zu,$a,Vu,Zr,P,ve,Ja,Tt,Bu,Ua,Yu,Nr,Ql,ye,Xu,ka,Fu,Ou,Ia,Qu,Wr,$t,eg,Cr,Dl,ja,Aa,Du,Pr,Jt,tg,Lr,L,we,Sa,Ut,qu,xa,Ku,Rr,kt,Hr,It,z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sc,hc,$o,uc,An,fc,Yi,dl,pc,Sn,cc,Xi,Jo,mc,Fi,Uo,gc,Oi,X,Ge,xn,vl,dc,Gn,vc,Qi,F,Ze,Zn,yl,yc,ko,wc,Nn,bc,Di,T,Mc,wl,_c,Ec,Wn,Tc,$c,bl,Jc,qi,Ml,Ki,Io,Uc,es,_l,ts,jo,kc,ls,El,os,O,Ne,Cn,Tl,Ic,Pn,jc,as,Ao,Ac,ns,So,xo,Sc,Ln,xc,rs,$l,sg,is,We,Gc,Jl,Zc,Nc,ss,Go,Wc,hs,Q,Ce,Rn,Ul,Cc,Hn,Pc,us,Zo,Lc,fs,kl,ps,D,Pe,zn,Il,Rc,Vn,Hc,cs,No,Wo,zc,Bn,Vc,ms,jl,gs,q,Le,Yn,Al,Bc,Xn,Yc,ds,Sl,Xc,xl,Fc,vs,K,Re,Fn,Gl,Oc,On,Qc,ys,Co,Dc,ws,Po,Lo,hg,bs,Zl,qc,Nl,Kc,Ms,Wl,em,Cl,tm,_s,Ro,lm,Es,He,ze,Pl,om,am,Qn,nm,rm,im,Ve,Ll,sm,hm,Dn,um,fm,Ts,Ho,pm,$s,zo,cm,Js,Vo,mm,Us,ee,Be,qn,Rl,gm,Kn,dm,ks;return Fe=new w({}),Oe=new Oy({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"}}),nt=new w({}),ct=new w({}),gt=new w({}),yt=new w({}),Mt=new w({}),Et=new w({}),Tt=new w({}),Ut=new w({}),kt=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`}}),It=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`}}),jt=new w({}),xt=new w({}),Gt=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`}}),Ct=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'}}),Pt=new b({props:{code:"dW56aXAlMjAtZCUyMC4lMkZ0cmFpbmluZy1lbnZzLWV4ZWN1dGFibGVzJTJGbGludXglMkYlMjAuJTJGdHJhaW5pbmctZW52cy1leGVjdXRhYmxlcyUyRmxpbnV4JTJGU25vd2JhbGxUYXJnZXQuemlw",highlighted:"unzip -d ./training-envs-executables/linux/ ./training-envs-executables/linux/SnowballTarget.zip"}}),Lt=new b({props:{code:"Y2htb2QlMjAtUiUyMDc1NSUyMC4lMk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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>`}}),Ft=new w({}),qt=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'}}),Kt=new w({}),al=new b({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`}}),sl=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>'}}),hl=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'}}),pl=new w({}),vl=new w({}),yl=new w({}),Ml=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>`}}),El=new b({props:{code:"Y2htb2QlMjAtUiUyMDc1NSUyMC4lMkZ0cmFpbmluZy1lbnZzLWV4ZWN1dGFibGVzJTJGbGludXglMkZQeXJhbWlkcyUyRlB5cmFtaWRz",highlighted:'<span class="hljs-built_in">chmod</span> -R 755 ./training-envs-executables/linux/Pyramids/Pyramids'}}),Tl=new w({}),Ul=new w({}),kl=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'}}),Il=new w({}),jl=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>'}}),Al=new w({}),Gl=new w({}),Rl=new w({}),{c(){A=o("meta"),ar=f(),S=o("h1"),te=o("a"),Do=o("span"),c(Fe.$$.fragment),$h=f(),qo=o("span"),Jh=s("Hands-on"),nr=f(),c(Oe.$$.fragment),rr=f(),zl=o("p"),Uh=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!"),ir=f(),Qe=o("img"),sr=f(),$=o("p"),kh=s("To validate this hands-on for the certification process, you "),Ko=o("strong"),Ih=s("just need to push your trained models to the Hub."),jh=s(`
There are `),ea=o("strong"),Ah=s("no minimum results to attain"),Sh=s(" in order to validate this Hands On. But if you want to get nice results, you can try to reach the following:"),hr=f(),le=o("ul"),De=o("li"),xh=s("For "),qe=o("a"),Gh=s("Pyramids"),Zh=s(": Mean Reward = 1.75"),Nh=f(),Ke=o("li"),Wh=s("For "),et=o("a"),Ch=s("SnowballTarget"),Ph=s(": Mean Reward = 15 or 30 targets shoot in an episode."),ur=f(),tt=o("p"),Lh=s("For more information about the certification process, check this section \u{1F449} "),lt=o("a"),Rh=s("https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),fr=f(),ot=o("p"),ta=o("strong"),Hh=s("To start the hands-on, click on Open In Colab button"),zh=s(" \u{1F447} :"),pr=f(),Vl=o("p"),at=o("a"),Bl=o("img"),cr=f(),oe=o("p"),Vh=s("We strongly "),la=o("strong"),Bh=s("recommend students use Google Colab for the hands-on exercises"),Yh=s(" instead of running them on their personal computers."),mr=f(),ae=o("p"),Xh=s("By using Google Colab, "),oa=o("strong"),Fh=s("you can focus on learning and experimenting without worrying about the technical aspects"),Oh=s(" of setting up your environments."),gr=f(),x=o("h1"),ne=o("a"),aa=o("span"),c(nt.$$.fragment),Qh=f(),na=o("span"),Dh=s("Unit 5: An Introduction to ML-Agents"),dr=f(),rt=o("img"),vr=f(),Yl=o("p"),qh=s("In this notebook, you\u2019ll learn about ML-Agents and train two agents."),yr=f(),re=o("ul"),it=o("li"),Kh=s("The first one will learn to "),ra=o("strong"),eu=s("shoot snowballs onto spawning targets"),tu=s("."),lu=f(),st=o("li"),ou=s("The second needs to press a button to spawn a pyramid, then navigate to the pyramid, knock it over, "),ia=o("strong"),au=s("and move to the gold brick at the top"),nu=s(". To do that, it will need to explore its environment, and we will use a technique called curiosity."),wr=f(),ie=o("p"),ru=s("After that, you\u2019ll be able "),sa=o("strong"),iu=s("to watch your agents playing directly on your browser"),su=s("."),br=f(),ht=o("p"),hu=s("For more information about the certification process, check this section \u{1F449} "),ut=o("a"),uu=s("https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),Mr=f(),se=o("p"),fu=s("\u2B07\uFE0F Here is an example of what "),ha=o("strong"),pu=s("you will achieve at the end of this unit."),cu=s(" \u2B07\uFE0F"),_r=f(),ft=o("img"),Er=f(),pt=o("img"),Tr=f(),G=o("h3"),he=o("a"),ua=o("span"),c(ct.$$.fragment),mu=f(),fa=o("span"),gu=s("\u{1F3AE} Environments:"),$r=f(),ue=o("ul"),pa=o("li"),mt=o("a"),du=s("Pyramids"),vu=f(),ca=o("li"),yu=s("SnowballTarget"),Jr=f(),Z=o("h3"),fe=o("a"),ma=o("span"),c(gt.$$.fragment),wu=f(),ga=o("span"),bu=s("\u{1F4DA} RL-Library:"),Ur=f(),Xl=o("ul"),da=o("li"),dt=o("a"),Mu=s("ML-Agents"),kr=f(),J=o("p"),_u=s("We\u2019re constantly trying to improve our tutorials, so "),va=o("strong"),Eu=s("if you find some issues in this notebook"),Tu=s(", please "),vt=o("a"),$u=s("open an issue on the GitHub Repo"),Ju=s("."),Ir=f(),N=o("h2"),pe=o("a"),ya=o("span"),c(yt.$$.fragment),Uu=f(),wa=o("span"),ku=s("Objectives of this notebook \u{1F3C6}"),jr=f(),Fl=o("p"),Iu=s("At the end of the notebook, you will:"),Ar=f(),ce=o("ul"),wt=o("li"),ju=s("Understand how "),ba=o("strong"),Au=s("ML-Agents"),Su=s(" works and the environment library."),xu=f(),bt=o("li"),Gu=s("Be able to "),Ma=o("strong"),Zu=s("train agents in Unity Environments"),Nu=s("."),Sr=f(),W=o("h2"),me=o("a"),_a=o("span"),c(Mt.$$.fragment),Wu=f(),Ea=o("span"),Cu=s("Prerequisites \u{1F3D7}\uFE0F"),xr=s(`

Before diving into the notebook, you need to:
`),ge=o("p"),Pu=s("\u{1F532} \u{1F4DA} "),Ol=o("strong"),Lu=s("Study "),_t=o("a"),Ru=s("what ML-Agents is and how it works by reading Unit 5"),Hu=s("  \u{1F917}"),Gr=f(),C=o("h1"),de=o("a"),Ta=o("span"),c(Et.$$.fragment),zu=f(),$a=o("span"),Vu=s("Let's train our agents \u{1F680}"),Zr=f(),P=o("h2"),ve=o("a"),Ja=o("span"),c(Tt.$$.fragment),Bu=f(),Ua=o("span"),Yu=s("Set the GPU \u{1F4AA}"),Nr=f(),Ql=o("ul"),ye=o("li"),Xu=s("To "),ka=o("strong"),Fu=s("accelerate the agent\u2019s training, we\u2019ll use a GPU"),Ou=s(". To do that, go to "),Ia=o("code"),Qu=s("Runtime > Change Runtime type"),Wr=f(),$t=o("img"),Cr=f(),Dl=o("ul"),ja=o("li"),Aa=o("code"),Du=s("Hardware Accelerator > GPU"),Pr=f(),Jt=o("img"),Lr=f(),L=o("h2"),we=o("a"),Sa=o("span"),c(Ut.$$.fragment),qu=f(),xa=o("span"),Ku=s("Clone the repository and install the dependencies \u{1F53D}"),Rr=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(kt.$$.fragment),Hr=f(),c(It.$$.fragment),zr=f(),R=o("h2"),be=o("a"),Ga=o("span"),c(jt.$$.fragment),ef=f(),Za=o("span"),tf=s("SnowballTarget \u26C4"),Vr=f(),At=o("p"),lf=s(`If you need a refresher on how this environment works check this section \u{1F449}
`),St=o("a"),of=s("https://huggingface.co/deep-rl-course/unit5/snowball-target"),Br=f(),H=o("h3"),Me=o("a"),Na=o("span"),c(xt.$$.fragment),af=f(),ql=o("span"),nf=s("Download and move the environment zip file in "),Wa=o("code"),rf=s("./training-envs-executables/linux/"),Yr=f(),U=o("ul"),Ca=o("li"),sf=s("Our environment executable is in a zip file."),hf=f(),Kl=o("li"),uf=s("We need to download it and place it to "),Pa=o("code"),ff=s("./training-envs-executables/linux/"),pf=f(),La=o("li"),cf=s("We use a linux executable because we use colab, and colab machines OS is Ubuntu (linux)"),Xr=f(),c(Gt.$$.fragment),Fr=f(),k=o("p"),mf=s("Download the file SnowballTarget.zip from "),Zt=o("a"),gf=s("https://drive.google.com/file/d/1YHHLjyj6gaZ3Gemx1hQgqrPgSS2ZhmB5"),df=s(" using "),Ra=o("code"),vf=s("wget"),yf=s("."),Or=f(),Nt=o("p"),wf=s("Check out the full solution to download large files from GDrive "),Wt=o("a"),bf=s("here"),Qr=f(),c(Ct.$$.fragment),Dr=f(),eo=o("p"),Mf=s("We unzip the executable.zip file"),qr=f(),c(Pt.$$.fragment),Kr=f(),to=o("p"),_f=s("Make sure your file is accessible"),ei=f(),c(Lt.$$.fragment),ti=f(),z=o("h3"),_e=o("a"),Ha=o("span"),c(Rt.$$.fragment),Ef=f(),za=o("span"),Tf=s("Define the SnowballTarget config file"),li=s(`

- In ML-Agents, you define the **training hyperparameters in config.yaml files.**
`),Ht=o("p"),$f=s("There are multiple hyperparameters. To understand them better, you should read the explanation for each one in "),zt=o("a"),Jf=s("the documentation"),oi=f(),Ee=o("p"),Uf=s("You need to create a "),Va=o("code"),kf=s("SnowballTarget.yaml"),If=s(" config file in ./content/ml-agents/config/ppo/"),ai=f(),I=o("p"),jf=s("We\u2019ll give you a preliminary version of this config (to copy and paste into your "),Ba=o("code"),Af=s("SnowballTarget.yaml file"),Sf=s("), "),Ya=o("strong"),xf=s("but you should modify it"),Gf=s("."),ni=f(),c(Vt.$$.fragment),ri=f(),Bt=o("img"),ii=f(),Yt=o("img"),si=f(),Te=o("p"),Zf=s("As an experiment, try to modify some other hyperparameters. Unity provides very "),Xt=o("a"),Nf=s("good documentation explaining each of them here"),Wf=s("."),hi=f(),lo=o("p"),Cf=s("Now that you\u2019ve created the config file and understand what most hyperparameters do, we\u2019re ready to train our agent \u{1F525}."),ui=f(),V=o("h3"),$e=o("a"),Xa=o("span"),c(Ft.$$.fragment),Pf=f(),Fa=o("span"),Lf=s("Train the agent"),fi=f(),Ot=o("p"),Rf=s("To train our agent, we need to "),Oa=o("strong"),Hf=s("launch mlagents-learn and select the executable containing the environment."),pi=f(),oo=o("p"),zf=s("We define four parameters:"),ci=f(),_=o("ol"),ao=o("li"),Qa=o("code"),Vf=s("mlagents-learn <config>"),Bf=s(": the path where the hyperparameter config file is."),Yf=f(),no=o("li"),Da=o("code"),Xf=s("--env"),Ff=s(": where the environment executable is."),Of=f(),ro=o("li"),qa=o("code"),Qf=s("--run_id"),Df=s(": the name you want to give to your training run id."),qf=f(),io=o("li"),Ka=o("code"),Kf=s("--no-graphics"),ep=s(": to not launch the visualization during the training."),mi=f(),Qt=o("img"),gi=f(),Je=o("p"),tp=s("Train the model and use the "),en=o("code"),lp=s("--resume"),op=s(" flag to continue training in case of interruption."),di=f(),so=o("blockquote"),Dt=o("p"),ap=s("It will fail the first time if and when you use "),tn=o("code"),np=s("--resume"),rp=s(". Try rerunning the block to bypass the error."),vi=f(),ho=o("p"),ip=s("The training will take 10 to 35min depending on your config. Go take a \u2615\uFE0F you deserve it \u{1F917}."),yi=f(),c(qt.$$.fragment),wi=f(),B=o("h3"),Ue=o("a"),ln=o("span"),c(Kt.$$.fragment),sp=f(),on=o("span"),hp=s("Push the agent to the Hugging Face Hub"),bi=f(),uo=o("ul"),fo=o("li"),up=s("Now that we\u2019ve trained our agent, we\u2019re "),an=o("strong"),fp=s("ready to push it to the Hub and visualize it playing on your browser\u{1F525}."),Mi=f(),po=o("p"),pp=s("To be able to share your model with the community, there are three more steps to follow:"),_i=f(),el=o("p"),cp=s("1\uFE0F\u20E3 (If it\u2019s not already done) create an account to HF \u27A1 "),tl=o("a"),mp=s("https://huggingface.co/join"),Ei=f(),co=o("p"),gp=s("2\uFE0F\u20E3 Sign in and store your authentication token from the Hugging Face website."),Ti=f(),mo=o("ul"),ke=o("li"),dp=s("Create a new token ("),ll=o("a"),vp=s("https://huggingface.co/settings/tokens"),yp=s(") "),nn=o("strong"),wp=s("with write role"),$i=f(),ol=o("img"),Ji=f(),Ie=o("ul"),rn=o("li"),bp=s("Copy the token"),Mp=f(),sn=o("li"),_p=s("Run the cell below and paste the token"),Ui=f(),c(al.$$.fragment),ki=f(),nl=o("p"),Ep=s("If you don\u2019t want to use Google Colab or a Jupyter Notebook, you need to use this command instead: "),hn=o("code"),Tp=s("huggingface-cli login"),Ii=f(),je=o("p"),$p=s("Then we need to run "),un=o("code"),Jp=s("mlagents-push-to-hf"),Up=s("."),ji=f(),go=o("p"),kp=s("And we define four parameters:"),Ai=f(),E=o("ol"),vo=o("li"),fn=o("code"),Ip=s("--run-id"),jp=s(": the name of the training run id."),Ap=f(),yo=o("li"),pn=o("code"),Sp=s("--local-dir"),xp=s(": where the agent was saved, it\u2019s results/<run_id name>, so in my case results/First Training."),Gp=f(),rl=o("li"),cn=o("code"),Zp=s("--repo-id"),Np=s(`: the name of the Hugging Face repo you want to create or update. It\u2019s always <your huggingface username>/<the repo name>
If the repo does not exist `),mn=o("strong"),Wp=s("it will be created automatically"),Cp=f(),wo=o("li"),gn=o("code"),Pp=s("--commit-message"),Lp=s(": since HF repos are git repositories you need to give a commit message."),Si=f(),il=o("img"),xi=f(),bo=o("p"),Rp=s("For instance:"),Gi=f(),Mo=o("p"),dn=o("code"),Hp=s('mlagents-push-to-hf --run-id="SnowballTarget1" --local-dir="./results/SnowballTarget1" --repo-id="ThomasSimonini/ppo-SnowballTarget" --commit-message="First Push"'),Zi=f(),c(sl.$$.fragment),Ni=f(),_o=o("p"),zp=s("If everything worked you should see this at the end of the process (but with a different url \u{1F606}) :"),Wi=f(),c(hl.$$.fragment),Ci=f(),ul=o("p"),Vp=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. "),vn=o("strong"),Bp=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."),Pi=f(),fl=o("p"),Yp=s("But now comes the best: "),yn=o("strong"),Xp=s("being able to visualize your agent online \u{1F440}."),Li=f(),Y=o("h3"),Ae=o("a"),wn=o("span"),c(pl.$$.fragment),Fp=f(),bn=o("span"),Op=s("Watch your agent playing \u{1F440}"),Ri=f(),Eo=o("p"),Qp=s("This step it\u2019s simple:"),Hi=f(),j=o("ol"),Mn=o("li"),_n=o("p"),Dp=s("Remember your repo-id"),qp=f(),En=o("li"),To=o("p"),Kp=s("Go here: "),cl=o("a"),ec=s("https://huggingface.co/spaces/ThomasSimonini/ML-Agents-SnowballTarget"),tc=f(),Tn=o("li"),$n=o("p"),lc=s("Launch the game and put it in full screen by clicking on the bottom right button"),zi=f(),ml=o("img"),Vi=f(),Se=o("ol"),Jn=o("li"),Un=o("p"),oc=s("In step 1, choose your model repository, which is the model id (in my case ThomasSimonini/ppo-SnowballTarget)."),ac=f(),kn=o("li"),gl=o("p"),nc=s("In step 2, "),In=o("strong"),rc=s("choose what model you want to replay"),ic=s(":"),Bi=f(),xe=o("ul"),jn=o("li"),sc=s("I have multiple ones since we saved a model every 500000 timesteps."),hc=f(),$o=o("li"),uc=s("But if I want the more recent I choose "),An=o("code"),fc=s("SnowballTarget.onnx"),Yi=f(),dl=o("p"),pc=s("\u{1F449} It\u2019s nice to "),Sn=o("strong"),cc=s("try different model stages to see the improvement of the agent."),Xi=f(),Jo=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}"),Fi=f(),Uo=o("p"),gc=s("Now let\u2019s try a more challenging environment called Pyramids."),Oi=f(),X=o("h2"),Ge=o("a"),xn=o("span"),c(vl.$$.fragment),dc=f(),Gn=o("span"),vc=s("Pyramids \u{1F3C6}"),Qi=f(),F=o("h3"),Ze=o("a"),Zn=o("span"),c(yl.$$.fragment),yc=f(),ko=o("span"),wc=s("Download and move the environment zip file in "),Nn=o("code"),bc=s("./training-envs-executables/linux/"),Di=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"),Mc=s("Download the file Pyramids.zip from "),wl=o("a"),_c=s("https://drive.google.com/uc?export=download&id=1UiFNdKlsH0NTu32xV-giYUEVKV4-vc7H"),Ec=s(" using "),Wn=o("code"),Tc=s("wget"),$c=s(". Check out the full solution to download large files from GDrive "),bl=o("a"),Jc=s("here"),qi=f(),c(Ml.$$.fragment),Ki=f(),Io=o("p"),Uc=s("Unzip it"),es=f(),c(_l.$$.fragment),ts=f(),jo=o("p"),kc=s("Make sure your file is accessible"),ls=f(),c(El.$$.fragment),os=f(),O=o("h3"),Ne=o("a"),Cn=o("span"),c(Tl.$$.fragment),Ic=f(),Pn=o("span"),jc=s("Modify the PyramidsRND config file"),as=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
`),Ao=o("p"),Ac=s("For this training, we\u2019ll modify one thing:"),ns=f(),So=o("ul"),xo=o("li"),Sc=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,`),Ln=o("strong"),xc=s("and change max_steps to 1000000."),rs=f(),$l=o("img"),is=f(),We=o("p"),Gc=s("As an experiment, you should also try to modify some other hyperparameters. Unity provides very "),Jl=o("a"),Zc=s("good documentation explaining each of them here"),Nc=s("."),ss=f(),Go=o("p"),Wc=s("We\u2019re now ready to train our agent \u{1F525}."),hs=f(),Q=o("h3"),Ce=o("a"),Rn=o("span"),c(Ul.$$.fragment),Cc=f(),Hn=o("span"),Pc=s("Train the agent"),us=f(),Zo=o("p"),Lc=s("The training will take 30 to 45min depending on your machine, go take a \u2615\uFE0F you deserve it \u{1F917}."),fs=f(),c(kl.$$.fragment),ps=f(),D=o("h3"),Pe=o("a"),zn=o("span"),c(Il.$$.fragment),Rc=f(),Vn=o("span"),Hc=s("Push the agent to the Hugging Face Hub"),cs=f(),No=o("ul"),Wo=o("li"),zc=s("Now that we trained our agent, we\u2019re "),Bn=o("strong"),Vc=s("ready to push it to the Hub to be able to visualize it playing on your browser\u{1F525}."),ms=f(),c(jl.$$.fragment),gs=f(),q=o("h3"),Le=o("a"),Yn=o("span"),c(Al.$$.fragment),Bc=f(),Xn=o("span"),Yc=s("Watch your agent playing \u{1F440}"),ds=f(),Sl=o("p"),Xc=s("\u{1F449} "),xl=o("a"),Fc=s("https://huggingface.co/spaces/unity/ML-Agents-Pyramids"),vs=f(),K=o("h3"),Re=o("a"),Fn=o("span"),c(Gl.$$.fragment),Oc=f(),On=o("span"),Qc=s("\u{1F381} Bonus: Why not train on another environment?"),ys=s(`

  
Now that you know how to train an agent using MLAgents, **why not try another environment?**
`),Co=o("p"),Dc=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."),ws=f(),Po=o("p"),Lo=o("img"),bs=f(),Zl=o("p"),qc=s("You have the full list of the one currently available environments on Hugging Face here \u{1F449} "),Nl=o("a"),Kc=s("https://github.com/huggingface/ml-agents#the-environments"),Ms=f(),Wl=o("p"),em=s("For the demos to visualize your agent \u{1F449} "),Cl=o("a"),tm=s("https://huggingface.co/unity"),_s=f(),Ro=o("p"),lm=s("For now we have integrated:"),Es=f(),He=o("ul"),ze=o("li"),Pl=o("a"),om=s("Worm"),am=s(" demo where you teach a "),Qn=o("strong"),nm=s("worm to crawl"),rm=s("."),im=f(),Ve=o("li"),Ll=o("a"),sm=s("Walker"),hm=s(" demo where you teach an agent "),Dn=o("strong"),um=s("to walk towards a goal"),fm=s("."),Ts=f(),Ho=o("p"),pm=s("That\u2019s all for today. Congrats on finishing this tutorial!"),$s=f(),zo=o("p"),cm=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!"),Js=f(),Vo=o("p"),mm=s("See you on Unit 6 \u{1F525},"),Us=f(),ee=o("h2"),Be=o("a"),qn=o("span"),c(Rl.$$.fragment),gm=f(),Kn=o("span"),dm=s("Keep Learning, Stay awesome \u{1F917}"),this.h()},l(e){const r=Yy('[data-svelte="svelte-1phssyn"]',document.head);A=a(r,"META",{name:!0,content:!0}),r.forEach(t),ar=p(e),S=a(e,"H1",{class:!0});var Is=n(S);te=a(Is,"A",{id:!0,class:!0,href:!0});var ug=n(te);Do=a(ug,"SPAN",{});var fg=n(Do);m(Fe.$$.fragment,fg),fg.forEach(t),ug.forEach(t),$h=p(Is),qo=a(Is,"SPAN",{});var pg=n(qo);Jh=h(pg,"Hands-on"),pg.forEach(t),Is.forEach(t),nr=p(e),m(Oe.$$.fragment,e),rr=p(e),zl=a(e,"P",{});var cg=n(zl);Uh=h(cg,"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!"),cg.forEach(t),ir=p(e),Qe=a(e,"IMG",{src:!0,alt:!0}),sr=p(e),$=a(e,"P",{});var Bo=n($);kh=h(Bo,"To validate this hands-on for the certification process, you "),Ko=a(Bo,"STRONG",{});var mg=n(Ko);Ih=h(mg,"just need to push your trained models to the Hub."),mg.forEach(t),jh=h(Bo,`
There are `),ea=a(Bo,"STRONG",{});var gg=n(ea);Ah=h(gg,"no minimum results to attain"),gg.forEach(t),Sh=h(Bo," in order to validate this Hands On. But if you want to get nice results, you can try to reach the following:"),Bo.forEach(t),hr=p(e),le=a(e,"UL",{});var js=n(le);De=a(js,"LI",{});var As=n(De);xh=h(As,"For "),qe=a(As,"A",{href:!0,rel:!0});var dg=n(qe);Gh=h(dg,"Pyramids"),dg.forEach(t),Zh=h(As,": Mean Reward = 1.75"),As.forEach(t),Nh=p(js),Ke=a(js,"LI",{});var Ss=n(Ke);Wh=h(Ss,"For "),et=a(Ss,"A",{href:!0,rel:!0});var vg=n(et);Ch=h(vg,"SnowballTarget"),vg.forEach(t),Ph=h(Ss,": Mean Reward = 15 or 30 targets shoot in an episode."),Ss.forEach(t),js.forEach(t),ur=p(e),tt=a(e,"P",{});var vm=n(tt);Lh=h(vm,"For more information about the certification process, check this section \u{1F449} "),lt=a(vm,"A",{href:!0,rel:!0});var yg=n(lt);Rh=h(yg,"https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),yg.forEach(t),vm.forEach(t),fr=p(e),ot=a(e,"P",{});var ym=n(ot);ta=a(ym,"STRONG",{});var wg=n(ta);Hh=h(wg,"To start the hands-on, click on Open In Colab button"),wg.forEach(t),zh=h(ym," \u{1F447} :"),ym.forEach(t),pr=p(e),Vl=a(e,"P",{});var bg=n(Vl);at=a(bg,"A",{href:!0,rel:!0});var Mg=n(at);Bl=a(Mg,"IMG",{src:!0,alt:!0}),Mg.forEach(t),bg.forEach(t),cr=p(e),oe=a(e,"P",{});var xs=n(oe);Vh=h(xs,"We strongly "),la=a(xs,"STRONG",{});var _g=n(la);Bh=h(_g,"recommend students use Google Colab for the hands-on exercises"),_g.forEach(t),Yh=h(xs," instead of running them on their personal computers."),xs.forEach(t),mr=p(e),ae=a(e,"P",{});var Gs=n(ae);Xh=h(Gs,"By using Google Colab, "),oa=a(Gs,"STRONG",{});var Eg=n(oa);Fh=h(Eg,"you can focus on learning and experimenting without worrying about the technical aspects"),Eg.forEach(t),Oh=h(Gs," of setting up your environments."),Gs.forEach(t),gr=p(e),x=a(e,"H1",{class:!0});var Zs=n(x);ne=a(Zs,"A",{id:!0,class:!0,href:!0});var Tg=n(ne);aa=a(Tg,"SPAN",{});var $g=n(aa);m(nt.$$.fragment,$g),$g.forEach(t),Tg.forEach(t),Qh=p(Zs),na=a(Zs,"SPAN",{});var Jg=n(na);Dh=h(Jg,"Unit 5: An Introduction to ML-Agents"),Jg.forEach(t),Zs.forEach(t),dr=p(e),rt=a(e,"IMG",{src:!0,alt:!0}),vr=p(e),Yl=a(e,"P",{});var Ug=n(Yl);qh=h(Ug,"In this notebook, you\u2019ll learn about ML-Agents and train two agents."),Ug.forEach(t),yr=p(e),re=a(e,"UL",{});var Ns=n(re);it=a(Ns,"LI",{});var Ws=n(it);Kh=h(Ws,"The first one will learn to "),ra=a(Ws,"STRONG",{});var kg=n(ra);eu=h(kg,"shoot snowballs onto spawning targets"),kg.forEach(t),tu=h(Ws,"."),Ws.forEach(t),lu=p(Ns),st=a(Ns,"LI",{});var Cs=n(st);ou=h(Cs,"The second needs to press a button to spawn a pyramid, then navigate to the pyramid, knock it over, "),ia=a(Cs,"STRONG",{});var Ig=n(ia);au=h(Ig,"and move to the gold brick at the top"),Ig.forEach(t),nu=h(Cs,". To do that, it will need to explore its environment, and we will use a technique called curiosity."),Cs.forEach(t),Ns.forEach(t),wr=p(e),ie=a(e,"P",{});var Ps=n(ie);ru=h(Ps,"After that, you\u2019ll be able "),sa=a(Ps,"STRONG",{});var jg=n(sa);iu=h(jg,"to watch your agents playing directly on your browser"),jg.forEach(t),su=h(Ps,"."),Ps.forEach(t),br=p(e),ht=a(e,"P",{});var wm=n(ht);hu=h(wm,"For more information about the certification process, check this section \u{1F449} "),ut=a(wm,"A",{href:!0,rel:!0});var Ag=n(ut);uu=h(Ag,"https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),Ag.forEach(t),wm.forEach(t),Mr=p(e),se=a(e,"P",{});var Ls=n(se);fu=h(Ls,"\u2B07\uFE0F Here is an example of what "),ha=a(Ls,"STRONG",{});var Sg=n(ha);pu=h(Sg,"you will achieve at the end of this unit."),Sg.forEach(t),cu=h(Ls," \u2B07\uFE0F"),Ls.forEach(t),_r=p(e),ft=a(e,"IMG",{src:!0,alt:!0}),Er=p(e),pt=a(e,"IMG",{src:!0,alt:!0}),Tr=p(e),G=a(e,"H3",{class:!0});var Rs=n(G);he=a(Rs,"A",{id:!0,class:!0,href:!0});var xg=n(he);ua=a(xg,"SPAN",{});var Gg=n(ua);m(ct.$$.fragment,Gg),Gg.forEach(t),xg.forEach(t),mu=p(Rs),fa=a(Rs,"SPAN",{});var Zg=n(fa);gu=h(Zg,"\u{1F3AE} Environments:"),Zg.forEach(t),Rs.forEach(t),$r=p(e),ue=a(e,"UL",{});var Hs=n(ue);pa=a(Hs,"LI",{});var Ng=n(pa);mt=a(Ng,"A",{href:!0,rel:!0});var Wg=n(mt);du=h(Wg,"Pyramids"),Wg.forEach(t),Ng.forEach(t),vu=p(Hs),ca=a(Hs,"LI",{});var Cg=n(ca);yu=h(Cg,"SnowballTarget"),Cg.forEach(t),Hs.forEach(t),Jr=p(e),Z=a(e,"H3",{class:!0});var zs=n(Z);fe=a(zs,"A",{id:!0,class:!0,href:!0});var Pg=n(fe);ma=a(Pg,"SPAN",{});var Lg=n(ma);m(gt.$$.fragment,Lg),Lg.forEach(t),Pg.forEach(t),wu=p(zs),ga=a(zs,"SPAN",{});var Rg=n(ga);bu=h(Rg,"\u{1F4DA} RL-Library:"),Rg.forEach(t),zs.forEach(t),Ur=p(e),Xl=a(e,"UL",{});var Hg=n(Xl);da=a(Hg,"LI",{});var zg=n(da);dt=a(zg,"A",{href:!0,rel:!0});var Vg=n(dt);Mu=h(Vg,"ML-Agents"),Vg.forEach(t),zg.forEach(t),Hg.forEach(t),kr=p(e),J=a(e,"P",{});var Yo=n(J);_u=h(Yo,"We\u2019re constantly trying to improve our tutorials, so "),va=a(Yo,"STRONG",{});var Bg=n(va);Eu=h(Bg,"if you find some issues in this notebook"),Bg.forEach(t),Tu=h(Yo,", please "),vt=a(Yo,"A",{href:!0,rel:!0});var Yg=n(vt);$u=h(Yg,"open an issue on the GitHub Repo"),Yg.forEach(t),Ju=h(Yo,"."),Yo.forEach(t),Ir=p(e),N=a(e,"H2",{class:!0});var Vs=n(N);pe=a(Vs,"A",{id:!0,class:!0,href:!0});var Xg=n(pe);ya=a(Xg,"SPAN",{});var Fg=n(ya);m(yt.$$.fragment,Fg),Fg.forEach(t),Xg.forEach(t),Uu=p(Vs),wa=a(Vs,"SPAN",{});var Og=n(wa);ku=h(Og,"Objectives of this notebook \u{1F3C6}"),Og.forEach(t),Vs.forEach(t),jr=p(e),Fl=a(e,"P",{});var Qg=n(Fl);Iu=h(Qg,"At the end of the notebook, you will:"),Qg.forEach(t),Ar=p(e),ce=a(e,"UL",{});var Bs=n(ce);wt=a(Bs,"LI",{});var Ys=n(wt);ju=h(Ys,"Understand how "),ba=a(Ys,"STRONG",{});var Dg=n(ba);Au=h(Dg,"ML-Agents"),Dg.forEach(t),Su=h(Ys," works and the environment library."),Ys.forEach(t),xu=p(Bs),bt=a(Bs,"LI",{});var Xs=n(bt);Gu=h(Xs,"Be able to "),Ma=a(Xs,"STRONG",{});var qg=n(Ma);Zu=h(qg,"train agents in Unity Environments"),qg.forEach(t),Nu=h(Xs,"."),Xs.forEach(t),Bs.forEach(t),Sr=p(e),W=a(e,"H2",{class:!0});var Fs=n(W);me=a(Fs,"A",{id:!0,class:!0,href:!0});var Kg=n(me);_a=a(Kg,"SPAN",{});var ed=n(_a);m(Mt.$$.fragment,ed),ed.forEach(t),Kg.forEach(t),Wu=p(Fs),Ea=a(Fs,"SPAN",{});var td=n(Ea);Cu=h(td,"Prerequisites \u{1F3D7}\uFE0F"),td.forEach(t),Fs.forEach(t),xr=h(e,`

Before diving into the notebook, you need to:
`),ge=a(e,"P",{});var Os=n(ge);Pu=h(Os,"\u{1F532} \u{1F4DA} "),Ol=a(Os,"STRONG",{});var bm=n(Ol);Lu=h(bm,"Study "),_t=a(bm,"A",{href:!0,rel:!0});var ld=n(_t);Ru=h(ld,"what ML-Agents is and how it works by reading Unit 5"),ld.forEach(t),bm.forEach(t),Hu=h(Os,"  \u{1F917}"),Os.forEach(t),Gr=p(e),C=a(e,"H1",{class:!0});var Qs=n(C);de=a(Qs,"A",{id:!0,class:!0,href:!0});var od=n(de);Ta=a(od,"SPAN",{});var ad=n(Ta);m(Et.$$.fragment,ad),ad.forEach(t),od.forEach(t),zu=p(Qs),$a=a(Qs,"SPAN",{});var nd=n($a);Vu=h(nd,"Let's train our agents \u{1F680}"),nd.forEach(t),Qs.forEach(t),Zr=p(e),P=a(e,"H2",{class:!0});var Ds=n(P);ve=a(Ds,"A",{id:!0,class:!0,href:!0});var rd=n(ve);Ja=a(rd,"SPAN",{});var id=n(Ja);m(Tt.$$.fragment,id),id.forEach(t),rd.forEach(t),Bu=p(Ds),Ua=a(Ds,"SPAN",{});var sd=n(Ua);Yu=h(sd,"Set the GPU \u{1F4AA}"),sd.forEach(t),Ds.forEach(t),Nr=p(e),Ql=a(e,"UL",{});var hd=n(Ql);ye=a(hd,"LI",{});var er=n(ye);Xu=h(er,"To "),ka=a(er,"STRONG",{});var ud=n(ka);Fu=h(ud,"accelerate the agent\u2019s training, we\u2019ll use a GPU"),ud.forEach(t),Ou=h(er,". To do that, go to "),Ia=a(er,"CODE",{});var fd=n(Ia);Qu=h(fd,"Runtime > Change Runtime type"),fd.forEach(t),er.forEach(t),hd.forEach(t),Wr=p(e),$t=a(e,"IMG",{src:!0,alt:!0}),Cr=p(e),Dl=a(e,"UL",{});var pd=n(Dl);ja=a(pd,"LI",{});var cd=n(ja);Aa=a(cd,"CODE",{});var md=n(Aa);Du=h(md,"Hardware Accelerator > GPU"),md.forEach(t),cd.forEach(t),pd.forEach(t),Pr=p(e),Jt=a(e,"IMG",{src:!0,alt:!0}),Lr=p(e),L=a(e,"H2",{class:!0});var qs=n(L);we=a(qs,"A",{id:!0,class:!0,href:!0});var gd=n(we);Sa=a(gd,"SPAN",{});var dd=n(Sa);m(Ut.$$.fragment,dd),dd.forEach(t),gd.forEach(t),qu=p(qs),xa=a(qs,"SPAN",{});var vd=n(xa);Ku=h(vd,"Clone the repository and install the dependencies \u{1F53D}"),vd.forEach(t),qs.forEach(t),Rr=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(kt.$$.fragment,e),Hr=p(e),m(It.$$.fragment,e),zr=p(e),R=a(e,"H2",{class:!0});var Ks=n(R);be=a(Ks,"A",{id:!0,class:!0,href:!0});var yd=n(be);Ga=a(yd,"SPAN",{});var wd=n(Ga);m(jt.$$.fragment,wd),wd.forEach(t),yd.forEach(t),ef=p(Ks),Za=a(Ks,"SPAN",{});var bd=n(Za);tf=h(bd,"SnowballTarget \u26C4"),bd.forEach(t),Ks.forEach(t),Vr=p(e),At=a(e,"P",{});var Mm=n(At);lf=h(Mm,`If you need a refresher on how this environment works check this section \u{1F449}
`),St=a(Mm,"A",{href:!0,rel:!0});var Md=n(St);of=h(Md,"https://huggingface.co/deep-rl-course/unit5/snowball-target"),Md.forEach(t),Mm.forEach(t),Br=p(e),H=a(e,"H3",{class:!0});var eh=n(H);Me=a(eh,"A",{id:!0,class:!0,href:!0});var _d=n(Me);Na=a(_d,"SPAN",{});var Ed=n(Na);m(xt.$$.fragment,Ed),Ed.forEach(t),_d.forEach(t),af=p(eh),ql=a(eh,"SPAN",{});var _m=n(ql);nf=h(_m,"Download and move the environment zip file in "),Wa=a(_m,"CODE",{});var Td=n(Wa);rf=h(Td,"./training-envs-executables/linux/"),Td.forEach(t),_m.forEach(t),eh.forEach(t),Yr=p(e),U=a(e,"UL",{});var Xo=n(U);Ca=a(Xo,"LI",{});var $d=n(Ca);sf=h($d,"Our environment executable is in a zip file."),$d.forEach(t),hf=p(Xo),Kl=a(Xo,"LI",{});var Em=n(Kl);uf=h(Em,"We need to download it and place it to "),Pa=a(Em,"CODE",{});var Jd=n(Pa);ff=h(Jd,"./training-envs-executables/linux/"),Jd.forEach(t),Em.forEach(t),pf=p(Xo),La=a(Xo,"LI",{});var Ud=n(La);cf=h(Ud,"We use a linux executable because we use colab, and colab machines OS is Ubuntu (linux)"),Ud.forEach(t),Xo.forEach(t),Xr=p(e),m(Gt.$$.fragment,e),Fr=p(e),k=a(e,"P",{});var Fo=n(k);mf=h(Fo,"Download the file SnowballTarget.zip from "),Zt=a(Fo,"A",{href:!0,rel:!0});var kd=n(Zt);gf=h(kd,"https://drive.google.com/file/d/1YHHLjyj6gaZ3Gemx1hQgqrPgSS2ZhmB5"),kd.forEach(t),df=h(Fo," using "),Ra=a(Fo,"CODE",{});var Id=n(Ra);vf=h(Id,"wget"),Id.forEach(t),yf=h(Fo,"."),Fo.forEach(t),Or=p(e),Nt=a(e,"P",{});var Tm=n(Nt);wf=h(Tm,"Check out the full solution to download large files from GDrive "),Wt=a(Tm,"A",{href:!0,rel:!0});var jd=n(Wt);bf=h(jd,"here"),jd.forEach(t),Tm.forEach(t),Qr=p(e),m(Ct.$$.fragment,e),Dr=p(e),eo=a(e,"P",{});var Ad=n(eo);Mf=h(Ad,"We unzip the executable.zip file"),Ad.forEach(t),qr=p(e),m(Pt.$$.fragment,e),Kr=p(e),to=a(e,"P",{});var Sd=n(to);_f=h(Sd,"Make sure your file is accessible"),Sd.forEach(t),ei=p(e),m(Lt.$$.fragment,e),ti=p(e),z=a(e,"H3",{class:!0});var th=n(z);_e=a(th,"A",{id:!0,class:!0,href:!0});var xd=n(_e);Ha=a(xd,"SPAN",{});var Gd=n(Ha);m(Rt.$$.fragment,Gd),Gd.forEach(t),xd.forEach(t),Ef=p(th),za=a(th,"SPAN",{});var Zd=n(za);Tf=h(Zd,"Define the SnowballTarget config file"),Zd.forEach(t),th.forEach(t),li=h(e,`

- In ML-Agents, you define the **training hyperparameters in config.yaml files.**
`),Ht=a(e,"P",{});var $m=n(Ht);$f=h($m,"There are multiple hyperparameters. To understand them better, you should read the explanation for each one in "),zt=a($m,"A",{href:!0,rel:!0});var Nd=n(zt);Jf=h(Nd,"the documentation"),Nd.forEach(t),$m.forEach(t),oi=p(e),Ee=a(e,"P",{});var lh=n(Ee);Uf=h(lh,"You need to create a "),Va=a(lh,"CODE",{});var Wd=n(Va);kf=h(Wd,"SnowballTarget.yaml"),Wd.forEach(t),If=h(lh," config file in ./content/ml-agents/config/ppo/"),lh.forEach(t),ai=p(e),I=a(e,"P",{});var Oo=n(I);jf=h(Oo,"We\u2019ll give you a preliminary version of this config (to copy and paste into your "),Ba=a(Oo,"CODE",{});var Cd=n(Ba);Af=h(Cd,"SnowballTarget.yaml file"),Cd.forEach(t),Sf=h(Oo,"), "),Ya=a(Oo,"STRONG",{});var Pd=n(Ya);xf=h(Pd,"but you should modify it"),Pd.forEach(t),Gf=h(Oo,"."),Oo.forEach(t),ni=p(e),m(Vt.$$.fragment,e),ri=p(e),Bt=a(e,"IMG",{src:!0,alt:!0}),ii=p(e),Yt=a(e,"IMG",{src:!0,alt:!0}),si=p(e),Te=a(e,"P",{});var oh=n(Te);Zf=h(oh,"As an experiment, try to modify some other hyperparameters. Unity provides very "),Xt=a(oh,"A",{href:!0,rel:!0});var Ld=n(Xt);Nf=h(Ld,"good documentation explaining each of them here"),Ld.forEach(t),Wf=h(oh,"."),oh.forEach(t),hi=p(e),lo=a(e,"P",{});var Rd=n(lo);Cf=h(Rd,"Now that you\u2019ve created the config file and understand what most hyperparameters do, we\u2019re ready to train our agent \u{1F525}."),Rd.forEach(t),ui=p(e),V=a(e,"H3",{class:!0});var ah=n(V);$e=a(ah,"A",{id:!0,class:!0,href:!0});var Hd=n($e);Xa=a(Hd,"SPAN",{});var zd=n(Xa);m(Ft.$$.fragment,zd),zd.forEach(t),Hd.forEach(t),Pf=p(ah),Fa=a(ah,"SPAN",{});var Vd=n(Fa);Lf=h(Vd,"Train the agent"),Vd.forEach(t),ah.forEach(t),fi=p(e),Ot=a(e,"P",{});var Jm=n(Ot);Rf=h(Jm,"To train our agent, we need to "),Oa=a(Jm,"STRONG",{});var Bd=n(Oa);Hf=h(Bd,"launch mlagents-learn and select the executable containing the environment."),Bd.forEach(t),Jm.forEach(t),pi=p(e),oo=a(e,"P",{});var Yd=n(oo);zf=h(Yd,"We define four parameters:"),Yd.forEach(t),ci=p(e),_=a(e,"OL",{});var Ye=n(_);ao=a(Ye,"LI",{});var Um=n(ao);Qa=a(Um,"CODE",{});var Xd=n(Qa);Vf=h(Xd,"mlagents-learn <config>"),Xd.forEach(t),Bf=h(Um,": the path where the hyperparameter config file is."),Um.forEach(t),Yf=p(Ye),no=a(Ye,"LI",{});var km=n(no);Da=a(km,"CODE",{});var Fd=n(Da);Xf=h(Fd,"--env"),Fd.forEach(t),Ff=h(km,": where the environment executable is."),km.forEach(t),Of=p(Ye),ro=a(Ye,"LI",{});var Im=n(ro);qa=a(Im,"CODE",{});var Od=n(qa);Qf=h(Od,"--run_id"),Od.forEach(t),Df=h(Im,": the name you want to give to your training run id."),Im.forEach(t),qf=p(Ye),io=a(Ye,"LI",{});var jm=n(io);Ka=a(jm,"CODE",{});var Qd=n(Ka);Kf=h(Qd,"--no-graphics"),Qd.forEach(t),ep=h(jm,": to not launch the visualization during the training."),jm.forEach(t),Ye.forEach(t),mi=p(e),Qt=a(e,"IMG",{src:!0,alt:!0}),gi=p(e),Je=a(e,"P",{});var nh=n(Je);tp=h(nh,"Train the model and use the "),en=a(nh,"CODE",{});var Dd=n(en);lp=h(Dd,"--resume"),Dd.forEach(t),op=h(nh," flag to continue training in case of interruption."),nh.forEach(t),di=p(e),so=a(e,"BLOCKQUOTE",{});var qd=n(so);Dt=a(qd,"P",{});var rh=n(Dt);ap=h(rh,"It will fail the first time if and when you use "),tn=a(rh,"CODE",{});var Kd=n(tn);np=h(Kd,"--resume"),Kd.forEach(t),rp=h(rh,". Try rerunning the block to bypass the error."),rh.forEach(t),qd.forEach(t),vi=p(e),ho=a(e,"P",{});var ev=n(ho);ip=h(ev,"The training will take 10 to 35min depending on your config. Go take a \u2615\uFE0F you deserve it \u{1F917}."),ev.forEach(t),yi=p(e),m(qt.$$.fragment,e),wi=p(e),B=a(e,"H3",{class:!0});var ih=n(B);Ue=a(ih,"A",{id:!0,class:!0,href:!0});var tv=n(Ue);ln=a(tv,"SPAN",{});var lv=n(ln);m(Kt.$$.fragment,lv),lv.forEach(t),tv.forEach(t),sp=p(ih),on=a(ih,"SPAN",{});var ov=n(on);hp=h(ov,"Push the agent to the Hugging Face Hub"),ov.forEach(t),ih.forEach(t),bi=p(e),uo=a(e,"UL",{});var av=n(uo);fo=a(av,"LI",{});var Am=n(fo);up=h(Am,"Now that we\u2019ve trained our agent, we\u2019re "),an=a(Am,"STRONG",{});var nv=n(an);fp=h(nv,"ready to push it to the Hub and visualize it playing on your browser\u{1F525}."),nv.forEach(t),Am.forEach(t),av.forEach(t),Mi=p(e),po=a(e,"P",{});var rv=n(po);pp=h(rv,"To be able to share your model with the community, there are three more steps to follow:"),rv.forEach(t),_i=p(e),el=a(e,"P",{});var Sm=n(el);cp=h(Sm,"1\uFE0F\u20E3 (If it\u2019s not already done) create an account to HF \u27A1 "),tl=a(Sm,"A",{href:!0,rel:!0});var iv=n(tl);mp=h(iv,"https://huggingface.co/join"),iv.forEach(t),Sm.forEach(t),Ei=p(e),co=a(e,"P",{});var sv=n(co);gp=h(sv,"2\uFE0F\u20E3 Sign in and store your authentication token from the Hugging Face website."),sv.forEach(t),Ti=p(e),mo=a(e,"UL",{});var hv=n(mo);ke=a(hv,"LI",{});var tr=n(ke);dp=h(tr,"Create a new token ("),ll=a(tr,"A",{href:!0,rel:!0});var uv=n(ll);vp=h(uv,"https://huggingface.co/settings/tokens"),uv.forEach(t),yp=h(tr,") "),nn=a(tr,"STRONG",{});var fv=n(nn);wp=h(fv,"with write role"),fv.forEach(t),tr.forEach(t),hv.forEach(t),$i=p(e),ol=a(e,"IMG",{src:!0,alt:!0}),Ji=p(e),Ie=a(e,"UL",{});var sh=n(Ie);rn=a(sh,"LI",{});var pv=n(rn);bp=h(pv,"Copy the token"),pv.forEach(t),Mp=p(sh),sn=a(sh,"LI",{});var cv=n(sn);_p=h(cv,"Run the cell below and paste the token"),cv.forEach(t),sh.forEach(t),Ui=p(e),m(al.$$.fragment,e),ki=p(e),nl=a(e,"P",{});var xm=n(nl);Ep=h(xm,"If you don\u2019t want to use Google Colab or a Jupyter Notebook, you need to use this command instead: "),hn=a(xm,"CODE",{});var mv=n(hn);Tp=h(mv,"huggingface-cli login"),mv.forEach(t),xm.forEach(t),Ii=p(e),je=a(e,"P",{});var hh=n(je);$p=h(hh,"Then we need to run "),un=a(hh,"CODE",{});var gv=n(un);Jp=h(gv,"mlagents-push-to-hf"),gv.forEach(t),Up=h(hh,"."),hh.forEach(t),ji=p(e),go=a(e,"P",{});var dv=n(go);kp=h(dv,"And we define four parameters:"),dv.forEach(t),Ai=p(e),E=a(e,"OL",{});var Xe=n(E);vo=a(Xe,"LI",{});var Gm=n(vo);fn=a(Gm,"CODE",{});var vv=n(fn);Ip=h(vv,"--run-id"),vv.forEach(t),jp=h(Gm,": the name of the training run id."),Gm.forEach(t),Ap=p(Xe),yo=a(Xe,"LI",{});var Zm=n(yo);pn=a(Zm,"CODE",{});var yv=n(pn);Sp=h(yv,"--local-dir"),yv.forEach(t),xp=h(Zm,": where the agent was saved, it\u2019s results/<run_id name>, so in my case results/First Training."),Zm.forEach(t),Gp=p(Xe),rl=a(Xe,"LI",{});var uh=n(rl);cn=a(uh,"CODE",{});var wv=n(cn);Zp=h(wv,"--repo-id"),wv.forEach(t),Np=h(uh,`: the name of the Hugging Face repo you want to create or update. It\u2019s always <your huggingface username>/<the repo name>
If the repo does not exist `),mn=a(uh,"STRONG",{});var bv=n(mn);Wp=h(bv,"it will be created automatically"),bv.forEach(t),uh.forEach(t),Cp=p(Xe),wo=a(Xe,"LI",{});var Nm=n(wo);gn=a(Nm,"CODE",{});var Mv=n(gn);Pp=h(Mv,"--commit-message"),Mv.forEach(t),Lp=h(Nm,": since HF repos are git repositories you need to give a commit message."),Nm.forEach(t),Xe.forEach(t),Si=p(e),il=a(e,"IMG",{src:!0,alt:!0}),xi=p(e),bo=a(e,"P",{});var _v=n(bo);Rp=h(_v,"For instance:"),_v.forEach(t),Gi=p(e),Mo=a(e,"P",{});var Ev=n(Mo);dn=a(Ev,"CODE",{});var Tv=n(dn);Hp=h(Tv,'mlagents-push-to-hf --run-id="SnowballTarget1" --local-dir="./results/SnowballTarget1" --repo-id="ThomasSimonini/ppo-SnowballTarget" --commit-message="First Push"'),Tv.forEach(t),Ev.forEach(t),Zi=p(e),m(sl.$$.fragment,e),Ni=p(e),_o=a(e,"P",{});var $v=n(_o);zp=h($v,"If everything worked you should see this at the end of the process (but with a different url \u{1F606}) :"),$v.forEach(t),Wi=p(e),m(hl.$$.fragment,e),Ci=p(e),ul=a(e,"P",{});var Wm=n(ul);Vp=h(Wm,"It\u2019s the link to your model. It contains a model card that explains how to use it, your Tensorboard, and your config file. "),vn=a(Wm,"STRONG",{});var Jv=n(vn);Bp=h(Jv,"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."),Jv.forEach(t),Wm.forEach(t),Pi=p(e),fl=a(e,"P",{});var Cm=n(fl);Yp=h(Cm,"But now comes the best: "),yn=a(Cm,"STRONG",{});var Uv=n(yn);Xp=h(Uv,"being able to visualize your agent online \u{1F440}."),Uv.forEach(t),Cm.forEach(t),Li=p(e),Y=a(e,"H3",{class:!0});var fh=n(Y);Ae=a(fh,"A",{id:!0,class:!0,href:!0});var kv=n(Ae);wn=a(kv,"SPAN",{});var Iv=n(wn);m(pl.$$.fragment,Iv),Iv.forEach(t),kv.forEach(t),Fp=p(fh),bn=a(fh,"SPAN",{});var jv=n(bn);Op=h(jv,"Watch your agent playing \u{1F440}"),jv.forEach(t),fh.forEach(t),Ri=p(e),Eo=a(e,"P",{});var Av=n(Eo);Qp=h(Av,"This step it\u2019s simple:"),Av.forEach(t),Hi=p(e),j=a(e,"OL",{});var Qo=n(j);Mn=a(Qo,"LI",{});var Sv=n(Mn);_n=a(Sv,"P",{});var xv=n(_n);Dp=h(xv,"Remember your repo-id"),xv.forEach(t),Sv.forEach(t),qp=p(Qo),En=a(Qo,"LI",{});var Gv=n(En);To=a(Gv,"P",{});var Pm=n(To);Kp=h(Pm,"Go here: "),cl=a(Pm,"A",{href:!0,rel:!0});var Zv=n(cl);ec=h(Zv,"https://huggingface.co/spaces/ThomasSimonini/ML-Agents-SnowballTarget"),Zv.forEach(t),Pm.forEach(t),Gv.forEach(t),tc=p(Qo),Tn=a(Qo,"LI",{});var Nv=n(Tn);$n=a(Nv,"P",{});var Wv=n($n);lc=h(Wv,"Launch the game and put it in full screen by clicking on the bottom right button"),Wv.forEach(t),Nv.forEach(t),Qo.forEach(t),zi=p(e),ml=a(e,"IMG",{src:!0,alt:!0}),Vi=p(e),Se=a(e,"OL",{});var ph=n(Se);Jn=a(ph,"LI",{});var Cv=n(Jn);Un=a(Cv,"P",{});var Pv=n(Un);oc=h(Pv,"In step 1, choose your model repository, which is the model id (in my case ThomasSimonini/ppo-SnowballTarget)."),Pv.forEach(t),Cv.forEach(t),ac=p(ph),kn=a(ph,"LI",{});var Lv=n(kn);gl=a(Lv,"P",{});var ch=n(gl);nc=h(ch,"In step 2, "),In=a(ch,"STRONG",{});var Rv=n(In);rc=h(Rv,"choose what model you want to replay"),Rv.forEach(t),ic=h(ch,":"),ch.forEach(t),Lv.forEach(t),ph.forEach(t),Bi=p(e),xe=a(e,"UL",{});var mh=n(xe);jn=a(mh,"LI",{});var Hv=n(jn);sc=h(Hv,"I have multiple ones since we saved a model every 500000 timesteps."),Hv.forEach(t),hc=p(mh),$o=a(mh,"LI",{});var Lm=n($o);uc=h(Lm,"But if I want the more recent I choose "),An=a(Lm,"CODE",{});var zv=n(An);fc=h(zv,"SnowballTarget.onnx"),zv.forEach(t),Lm.forEach(t),mh.forEach(t),Yi=p(e),dl=a(e,"P",{});var Rm=n(dl);pc=h(Rm,"\u{1F449} It\u2019s nice to "),Sn=a(Rm,"STRONG",{});var Vv=n(Sn);cc=h(Vv,"try different model stages to see the improvement of the agent."),Vv.forEach(t),Rm.forEach(t),Xi=p(e),Jo=a(e,"P",{});var Bv=n(Jo);mc=h(Bv,"And don\u2019t hesitate to share the best score your agent gets on discord in the #rl-i-made-this channel \u{1F525}"),Bv.forEach(t),Fi=p(e),Uo=a(e,"P",{});var Yv=n(Uo);gc=h(Yv,"Now let\u2019s try a more challenging environment called Pyramids."),Yv.forEach(t),Oi=p(e),X=a(e,"H2",{class:!0});var gh=n(X);Ge=a(gh,"A",{id:!0,class:!0,href:!0});var Xv=n(Ge);xn=a(Xv,"SPAN",{});var Fv=n(xn);m(vl.$$.fragment,Fv),Fv.forEach(t),Xv.forEach(t),dc=p(gh),Gn=a(gh,"SPAN",{});var Ov=n(Gn);vc=h(Ov,"Pyramids \u{1F3C6}"),Ov.forEach(t),gh.forEach(t),Qi=p(e),F=a(e,"H3",{class:!0});var dh=n(F);Ze=a(dh,"A",{id:!0,class:!0,href:!0});var Qv=n(Ze);Zn=a(Qv,"SPAN",{});var Dv=n(Zn);m(yl.$$.fragment,Dv),Dv.forEach(t),Qv.forEach(t),yc=p(dh),ko=a(dh,"SPAN",{});var Hm=n(ko);wc=h(Hm,"Download and move the environment zip file in "),Nn=a(Hm,"CODE",{});var qv=n(Nn);bc=h(qv,"./training-envs-executables/linux/"),qv.forEach(t),Hm.forEach(t),dh.forEach(t),Di=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 Hl=n(T);Mc=h(Hl,"Download the file Pyramids.zip from "),wl=a(Hl,"A",{href:!0,rel:!0});var Kv=n(wl);_c=h(Kv,"https://drive.google.com/uc?export=download&id=1UiFNdKlsH0NTu32xV-giYUEVKV4-vc7H"),Kv.forEach(t),Ec=h(Hl," using "),Wn=a(Hl,"CODE",{});var ey=n(Wn);Tc=h(ey,"wget"),ey.forEach(t),$c=h(Hl,". Check out the full solution to download large files from GDrive "),bl=a(Hl,"A",{href:!0,rel:!0});var ty=n(bl);Jc=h(ty,"here"),ty.forEach(t),Hl.forEach(t),qi=p(e),m(Ml.$$.fragment,e),Ki=p(e),Io=a(e,"P",{});var ly=n(Io);Uc=h(ly,"Unzip it"),ly.forEach(t),es=p(e),m(_l.$$.fragment,e),ts=p(e),jo=a(e,"P",{});var oy=n(jo);kc=h(oy,"Make sure your file is accessible"),oy.forEach(t),ls=p(e),m(El.$$.fragment,e),os=p(e),O=a(e,"H3",{class:!0});var vh=n(O);Ne=a(vh,"A",{id:!0,class:!0,href:!0});var ay=n(Ne);Cn=a(ay,"SPAN",{});var ny=n(Cn);m(Tl.$$.fragment,ny),ny.forEach(t),ay.forEach(t),Ic=p(vh),Pn=a(vh,"SPAN",{});var ry=n(Pn);jc=h(ry,"Modify the PyramidsRND config file"),ry.forEach(t),vh.forEach(t),as=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
`),Ao=a(e,"P",{});var iy=n(Ao);Ac=h(iy,"For this training, we\u2019ll modify one thing:"),iy.forEach(t),ns=p(e),So=a(e,"UL",{});var sy=n(So);xo=a(sy,"LI",{});var zm=n(xo);Sc=h(zm,`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,`),Ln=a(zm,"STRONG",{});var hy=n(Ln);xc=h(hy,"and change max_steps to 1000000."),hy.forEach(t),zm.forEach(t),sy.forEach(t),rs=p(e),$l=a(e,"IMG",{src:!0,alt:!0}),is=p(e),We=a(e,"P",{});var yh=n(We);Gc=h(yh,"As an experiment, you should also try to modify some other hyperparameters. Unity provides very "),Jl=a(yh,"A",{href:!0,rel:!0});var uy=n(Jl);Zc=h(uy,"good documentation explaining each of them here"),uy.forEach(t),Nc=h(yh,"."),yh.forEach(t),ss=p(e),Go=a(e,"P",{});var fy=n(Go);Wc=h(fy,"We\u2019re now ready to train our agent \u{1F525}."),fy.forEach(t),hs=p(e),Q=a(e,"H3",{class:!0});var wh=n(Q);Ce=a(wh,"A",{id:!0,class:!0,href:!0});var py=n(Ce);Rn=a(py,"SPAN",{});var cy=n(Rn);m(Ul.$$.fragment,cy),cy.forEach(t),py.forEach(t),Cc=p(wh),Hn=a(wh,"SPAN",{});var my=n(Hn);Pc=h(my,"Train the agent"),my.forEach(t),wh.forEach(t),us=p(e),Zo=a(e,"P",{});var gy=n(Zo);Lc=h(gy,"The training will take 30 to 45min depending on your machine, go take a \u2615\uFE0F you deserve it \u{1F917}."),gy.forEach(t),fs=p(e),m(kl.$$.fragment,e),ps=p(e),D=a(e,"H3",{class:!0});var bh=n(D);Pe=a(bh,"A",{id:!0,class:!0,href:!0});var dy=n(Pe);zn=a(dy,"SPAN",{});var vy=n(zn);m(Il.$$.fragment,vy),vy.forEach(t),dy.forEach(t),Rc=p(bh),Vn=a(bh,"SPAN",{});var yy=n(Vn);Hc=h(yy,"Push the agent to the Hugging Face Hub"),yy.forEach(t),bh.forEach(t),cs=p(e),No=a(e,"UL",{});var wy=n(No);Wo=a(wy,"LI",{});var Vm=n(Wo);zc=h(Vm,"Now that we trained our agent, we\u2019re "),Bn=a(Vm,"STRONG",{});var by=n(Bn);Vc=h(by,"ready to push it to the Hub to be able to visualize it playing on your browser\u{1F525}."),by.forEach(t),Vm.forEach(t),wy.forEach(t),ms=p(e),m(jl.$$.fragment,e),gs=p(e),q=a(e,"H3",{class:!0});var Mh=n(q);Le=a(Mh,"A",{id:!0,class:!0,href:!0});var My=n(Le);Yn=a(My,"SPAN",{});var _y=n(Yn);m(Al.$$.fragment,_y),_y.forEach(t),My.forEach(t),Bc=p(Mh),Xn=a(Mh,"SPAN",{});var Ey=n(Xn);Yc=h(Ey,"Watch your agent playing \u{1F440}"),Ey.forEach(t),Mh.forEach(t),ds=p(e),Sl=a(e,"P",{});var Bm=n(Sl);Xc=h(Bm,"\u{1F449} "),xl=a(Bm,"A",{href:!0,rel:!0});var Ty=n(xl);Fc=h(Ty,"https://huggingface.co/spaces/unity/ML-Agents-Pyramids"),Ty.forEach(t),Bm.forEach(t),vs=p(e),K=a(e,"H3",{class:!0});var _h=n(K);Re=a(_h,"A",{id:!0,class:!0,href:!0});var $y=n(Re);Fn=a($y,"SPAN",{});var Jy=n(Fn);m(Gl.$$.fragment,Jy),Jy.forEach(t),$y.forEach(t),Oc=p(_h),On=a(_h,"SPAN",{});var Uy=n(On);Qc=h(Uy,"\u{1F381} Bonus: Why not train on another environment?"),Uy.forEach(t),_h.forEach(t),ys=h(e,`

  
Now that you know how to train an agent using MLAgents, **why not try another environment?**
`),Co=a(e,"P",{});var ky=n(Co);Dc=h(ky,"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."),ky.forEach(t),ws=p(e),Po=a(e,"P",{});var Iy=n(Po);Lo=a(Iy,"IMG",{src:!0,alt:!0}),Iy.forEach(t),bs=p(e),Zl=a(e,"P",{});var Ym=n(Zl);qc=h(Ym,"You have the full list of the one currently available environments on Hugging Face here \u{1F449} "),Nl=a(Ym,"A",{href:!0,rel:!0});var jy=n(Nl);Kc=h(jy,"https://github.com/huggingface/ml-agents#the-environments"),jy.forEach(t),Ym.forEach(t),Ms=p(e),Wl=a(e,"P",{});var Xm=n(Wl);em=h(Xm,"For the demos to visualize your agent \u{1F449} "),Cl=a(Xm,"A",{href:!0,rel:!0});var Ay=n(Cl);tm=h(Ay,"https://huggingface.co/unity"),Ay.forEach(t),Xm.forEach(t),_s=p(e),Ro=a(e,"P",{});var Sy=n(Ro);lm=h(Sy,"For now we have integrated:"),Sy.forEach(t),Es=p(e),He=a(e,"UL",{});var Eh=n(He);ze=a(Eh,"LI",{});var lr=n(ze);Pl=a(lr,"A",{href:!0,rel:!0});var xy=n(Pl);om=h(xy,"Worm"),xy.forEach(t),am=h(lr," demo where you teach a "),Qn=a(lr,"STRONG",{});var Gy=n(Qn);nm=h(Gy,"worm to crawl"),Gy.forEach(t),rm=h(lr,"."),lr.forEach(t),im=p(Eh),Ve=a(Eh,"LI",{});var or=n(Ve);Ll=a(or,"A",{href:!0,rel:!0});var Zy=n(Ll);sm=h(Zy,"Walker"),Zy.forEach(t),hm=h(or," demo where you teach an agent "),Dn=a(or,"STRONG",{});var Ny=n(Dn);um=h(Ny,"to walk towards a goal"),Ny.forEach(t),fm=h(or,"."),or.forEach(t),Eh.forEach(t),Ts=p(e),Ho=a(e,"P",{});var Wy=n(Ho);pm=h(Wy,"That\u2019s all for today. Congrats on finishing this tutorial!"),Wy.forEach(t),$s=p(e),zo=a(e,"P",{});var Cy=n(zo);cm=h(Cy,"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!"),Cy.forEach(t),Js=p(e),Vo=a(e,"P",{});var Py=n(Vo);mm=h(Py,"See you on Unit 6 \u{1F525},"),Py.forEach(t),Us=p(e),ee=a(e,"H2",{class:!0});var Th=n(ee);Be=a(Th,"A",{id:!0,class:!0,href:!0});var Ly=n(Be);qn=a(Ly,"SPAN",{});var Ry=n(qn);m(Rl.$$.fragment,Ry),Ry.forEach(t),Ly.forEach(t),gm=p(Th),Kn=a(Th,"SPAN",{});var Hy=n(Kn);dm=h(Hy,"Keep Learning, Stay awesome \u{1F917}"),Hy.forEach(t),Th.forEach(t),this.h()},h(){u(A,"name","hf:doc:metadata"),u(A,"content",JSON.stringify(Dy)),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,Om="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/envs.png")||u(Qe,"src",Om),u(Qe,"alt","Environments"),u(qe,"href","https://huggingface.co/spaces/unity/ML-Agents-Pyramids"),u(qe,"rel","nofollow"),u(et,"href","https://huggingface.co/spaces/ThomasSimonini/ML-Agents-SnowballTarget"),u(et,"rel","nofollow"),u(lt,"href","https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),u(lt,"rel","nofollow"),M(Bl.src,Qm="https://colab.research.google.com/assets/colab-badge.svg")||u(Bl,"src",Qm),u(Bl,"alt","Open In Colab"),u(at,"href","https://colab.research.google.com/github/huggingface/deep-rl-class/blob/master/notebooks/unit5/unit5.ipynb"),u(at,"rel","nofollow"),u(ne,"id","unit-5-an-introduction-to-mlagents"),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","#unit-5-an-introduction-to-mlagents"),u(x,"class","relative group"),M(rt.src,Dm="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/thumbnail.png")||u(rt,"src",Dm),u(rt,"alt","Thumbnail"),u(ut,"href","https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process"),u(ut,"rel","nofollow"),M(ft.src,qm="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/pyramids.gif")||u(ft,"src",qm),u(ft,"alt","Pyramids"),M(pt.src,Km="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballtarget.gif")||u(pt,"src",Km),u(pt,"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(mt,"href","https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Learning-Environment-Examples.md#pyramids"),u(mt,"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(dt,"href","https://github.com/Unity-Technologies/ml-agents"),u(dt,"rel","nofollow"),u(vt,"href","https://github.com/huggingface/deep-rl-class/issues"),u(vt,"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(_t,"href","https://huggingface.co/deep-rl-course/unit5/introduction"),u(_t,"rel","nofollow"),u(de,"id","lets-train-our-agents"),u(de,"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(de,"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($t.src,eg="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/notebooks/gpu-step1.jpg")||u($t,"src",eg),u($t,"alt","GPU Step 1"),M(Jt.src,tg="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/notebooks/gpu-step2.jpg")||u(Jt,"src",tg),u(Jt,"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(St,"href","https://huggingface.co/deep-rl-course/unit5/snowball-target"),u(St,"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(Zt,"href","https://drive.google.com/file/d/1YHHLjyj6gaZ3Gemx1hQgqrPgSS2ZhmB5"),u(Zt,"rel","nofollow"),u(Wt,"href","https://bcrf.biochem.wisc.edu/2021/02/05/download-google-drive-files-using-wget/"),u(Wt,"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(zt,"href","https://github.com/Unity-Technologies/ml-agents/blob/release_20_docs/docs/Training-Configuration-File.md"),u(zt,"rel","nofollow"),M(Bt.src,lg="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballfight_config1.png")||u(Bt,"src",lg),u(Bt,"alt","Config SnowballTarget"),M(Yt.src,og="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballfight_config2.png")||u(Yt,"src",og),u(Yt,"alt","Config SnowballTarget"),u(Xt,"href","https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Training-Configuration-File.md"),u(Xt,"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,ag="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/mlagentslearn.png")||u(Qt,"src",ag),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(tl,"href","https://huggingface.co/join"),u(tl,"rel","nofollow"),u(ll,"href","https://huggingface.co/settings/tokens"),u(ll,"rel","nofollow"),M(ol.src,ng="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/notebooks/create-token.jpg")||u(ol,"src",ng),u(ol,"alt","Create HF Token"),M(il.src,rg="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/mlagentspushtohub.png")||u(il,"src",rg),u(il,"alt","Push to Hub"),u(Ae,"id","watch-your-agent-playing"),u(Ae,"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(Ae,"href","#watch-your-agent-playing"),u(Y,"class","relative group"),u(cl,"href","https://huggingface.co/spaces/ThomasSimonini/ML-Agents-SnowballTarget"),u(cl,"rel","nofollow"),M(ml.src,ig="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballtarget_load.png")||u(ml,"src",ig),u(ml,"alt","Snowballtarget load"),u(Ge,"id","pyramids"),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","#pyramids"),u(X,"class","relative group"),u(Ze,"id","download-and-move-the-environment-zip-file-in-trainingenvsexecutableslinux"),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","#download-and-move-the-environment-zip-file-in-trainingenvsexecutableslinux"),u(F,"class","relative group"),u(wl,"href","https://drive.google.com/uc?export=download&id=1UiFNdKlsH0NTu32xV-giYUEVKV4-vc7H"),u(wl,"rel","nofollow"),u(bl,"href","https://bcrf.biochem.wisc.edu/2021/02/05/download-google-drive-files-using-wget/"),u(bl,"rel","nofollow"),u(Ne,"id","modify-the-pyramidsrnd-config-file"),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","#modify-the-pyramidsrnd-config-file"),u(O,"class","relative group"),M($l.src,sg="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/pyramids-config.png")||u($l,"src",sg),u($l,"alt","Pyramids config"),u(Jl,"href","https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Training-Configuration-File.md"),u(Jl,"rel","nofollow"),u(Ce,"id","train-the-agent"),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","#train-the-agent"),u(Q,"class","relative group"),u(Pe,"id","push-the-agent-to-the-hugging-face-hub"),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","#push-the-agent-to-the-hugging-face-hub"),u(D,"class","relative group"),u(Le,"id","watch-your-agent-playing"),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","#watch-your-agent-playing"),u(q,"class","relative group"),u(xl,"href","https://huggingface.co/spaces/unity/ML-Agents-Pyramids"),u(xl,"rel","nofollow"),u(Re,"id","bonus-why-not-train-on-another-environment"),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","#bonus-why-not-train-on-another-environment"),u(K,"class","relative group"),M(Lo.src,hg="https://miro.medium.com/max/1400/0*xERdThTRRM2k_U9f.png")||u(Lo,"src",hg),u(Lo,"alt","cover"),u(Nl,"href","https://github.com/huggingface/ml-agents#the-environments"),u(Nl,"rel","nofollow"),u(Cl,"href","https://huggingface.co/unity"),u(Cl,"rel","nofollow"),u(Pl,"href","https://huggingface.co/spaces/unity/ML-Agents-Worm"),u(Pl,"rel","nofollow"),u(Ll,"href","https://huggingface.co/spaces/unity/ML-Agents-Walker"),u(Ll,"rel","nofollow"),u(Be,"id","keep-learning-stay-awesome"),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","#keep-learning-stay-awesome"),u(ee,"class","relative group")},m(e,r){l(document.head,A),i(e,ar,r),i(e,S,r),l(S,te),l(te,Do),g(Fe,Do,null),l(S,$h),l(S,qo),l(qo,Jh),i(e,nr,r),g(Oe,e,r),i(e,rr,r),i(e,zl,r),l(zl,Uh),i(e,ir,r),i(e,Qe,r),i(e,sr,r),i(e,$,r),l($,kh),l($,Ko),l(Ko,Ih),l($,jh),l($,ea),l(ea,Ah),l($,Sh),i(e,hr,r),i(e,le,r),l(le,De),l(De,xh),l(De,qe),l(qe,Gh),l(De,Zh),l(le,Nh),l(le,Ke),l(Ke,Wh),l(Ke,et),l(et,Ch),l(Ke,Ph),i(e,ur,r),i(e,tt,r),l(tt,Lh),l(tt,lt),l(lt,Rh),i(e,fr,r),i(e,ot,r),l(ot,ta),l(ta,Hh),l(ot,zh),i(e,pr,r),i(e,Vl,r),l(Vl,at),l(at,Bl),i(e,cr,r),i(e,oe,r),l(oe,Vh),l(oe,la),l(la,Bh),l(oe,Yh),i(e,mr,r),i(e,ae,r),l(ae,Xh),l(ae,oa),l(oa,Fh),l(ae,Oh),i(e,gr,r),i(e,x,r),l(x,ne),l(ne,aa),g(nt,aa,null),l(x,Qh),l(x,na),l(na,Dh),i(e,dr,r),i(e,rt,r),i(e,vr,r),i(e,Yl,r),l(Yl,qh),i(e,yr,r),i(e,re,r),l(re,it),l(it,Kh),l(it,ra),l(ra,eu),l(it,tu),l(re,lu),l(re,st),l(st,ou),l(st,ia),l(ia,au),l(st,nu),i(e,wr,r),i(e,ie,r),l(ie,ru),l(ie,sa),l(sa,iu),l(ie,su),i(e,br,r),i(e,ht,r),l(ht,hu),l(ht,ut),l(ut,uu),i(e,Mr,r),i(e,se,r),l(se,fu),l(se,ha),l(ha,pu),l(se,cu),i(e,_r,r),i(e,ft,r),i(e,Er,r),i(e,pt,r),i(e,Tr,r),i(e,G,r),l(G,he),l(he,ua),g(ct,ua,null),l(G,mu),l(G,fa),l(fa,gu),i(e,$r,r),i(e,ue,r),l(ue,pa),l(pa,mt),l(mt,du),l(ue,vu),l(ue,ca),l(ca,yu),i(e,Jr,r),i(e,Z,r),l(Z,fe),l(fe,ma),g(gt,ma,null),l(Z,wu),l(Z,ga),l(ga,bu),i(e,Ur,r),i(e,Xl,r),l(Xl,da),l(da,dt),l(dt,Mu),i(e,kr,r),i(e,J,r),l(J,_u),l(J,va),l(va,Eu),l(J,Tu),l(J,vt),l(vt,$u),l(J,Ju),i(e,Ir,r),i(e,N,r),l(N,pe),l(pe,ya),g(yt,ya,null),l(N,Uu),l(N,wa),l(wa,ku),i(e,jr,r),i(e,Fl,r),l(Fl,Iu),i(e,Ar,r),i(e,ce,r),l(ce,wt),l(wt,ju),l(wt,ba),l(ba,Au),l(wt,Su),l(ce,xu),l(ce,bt),l(bt,Gu),l(bt,Ma),l(Ma,Zu),l(bt,Nu),i(e,Sr,r),i(e,W,r),l(W,me),l(me,_a),g(Mt,_a,null),l(W,Wu),l(W,Ea),l(Ea,Cu),i(e,xr,r),i(e,ge,r),l(ge,Pu),l(ge,Ol),l(Ol,Lu),l(Ol,_t),l(_t,Ru),l(ge,Hu),i(e,Gr,r),i(e,C,r),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yn),g(Al,Yn,null),l(q,Bc),l(q,Xn),l(Xn,Yc),i(e,ds,r),i(e,Sl,r),l(Sl,Xc),l(Sl,xl),l(xl,Fc),i(e,vs,r),i(e,K,r),l(K,Re),l(Re,Fn),g(Gl,Fn,null),l(K,Oc),l(K,On),l(On,Qc),i(e,ys,r),i(e,Co,r),l(Co,Dc),i(e,ws,r),i(e,Po,r),l(Po,Lo),i(e,bs,r),i(e,Zl,r),l(Zl,qc),l(Zl,Nl),l(Nl,Kc),i(e,Ms,r),i(e,Wl,r),l(Wl,em),l(Wl,Cl),l(Cl,tm),i(e,_s,r),i(e,Ro,r),l(Ro,lm),i(e,Es,r),i(e,He,r),l(He,ze),l(ze,Pl),l(Pl,om),l(ze,am),l(ze,Qn),l(Qn,nm),l(ze,rm),l(He,im),l(He,Ve),l(Ve,Ll),l(Ll,sm),l(Ve,hm),l(Ve,Dn),l(Dn,um),l(Ve,fm),i(e,Ts,r),i(e,Ho,r),l(Ho,pm),i(e,$s,r),i(e,zo,r),l(zo,cm),i(e,Js,r),i(e,Vo,r),l(Vo,mm),i(e,Us,r),i(e,ee,r),l(ee,Be),l(Be,qn),g(Rl,qn,null),l(ee,gm),l(ee,Kn),l(Kn,dm),ks=!0},p:Xy,i(e){ks||(d(Fe.$$.fragment,e),d(Oe.$$.fragment,e),d(nt.$$.fragment,e),d(ct.$$.fragment,e),d(gt.$$.fragment,e),d(yt.$$.fragment,e),d(Mt.$$.fragment,e),d(Et.$$.fragment,e),d(Tt.$$.fragment,e),d(Ut.$$.fragment,e),d(kt.$$.fragment,e),d(It.$$.fragment,e),d(jt.$$.fragment,e),d(xt.$$.fragment,e),d(Gt.$$.fragment,e),d(Ct.$$.fragment,e),d(Pt.$$.fragment,e),d(Lt.$$.fragment,e),d(Rt.$$.fragment,e),d(Vt.$$.fragment,e),d(Ft.$$.fragment,e),d(qt.$$.fragment,e),d(Kt.$$.fragment,e),d(al.$$.fragment,e),d(sl.$$.fragment,e),d(hl.$$.fragment,e),d(pl.$$.fragment,e),d(vl.$$.fragment,e),d(yl.$$.fragment,e),d(Ml.$$.fragment,e),d(_l.$$.fragment,e),d(El.$$.fragment,e),d(Tl.$$.fragment,e),d(Ul.$$.fragment,e),d(kl.$$.fragment,e),d(Il.$$.fragment,e),d(jl.$$.fragment,e),d(Al.$$.fragment,e),d(Gl.$$.fragment,e),d(Rl.$$.fragment,e),ks=!0)},o(e){v(Fe.$$.fragment,e),v(Oe.$$.fragment,e),v(nt.$$.fragment,e),v(ct.$$.fragment,e),v(gt.$$.fragment,e),v(yt.$$.fragment,e),v(Mt.$$.fragment,e),v(Et.$$.fragment,e),v(Tt.$$.fragment,e),v(Ut.$$.fragment,e),v(kt.$$.fragment,e),v(It.$$.fragment,e),v(jt.$$.fragment,e),v(xt.$$.fragment,e),v(Gt.$$.fragment,e),v(Ct.$$.fragment,e),v(Pt.$$.fragment,e),v(Lt.$$.fragment,e),v(Rt.$$.fragment,e),v(Vt.$$.fragment,e),v(Ft.$$.fragment,e),v(qt.$$.fragment,e),v(Kt.$$.fragment,e),v(al.$$.fragment,e),v(sl.$$.fragment,e),v(hl.$$.fragment,e),v(pl.$$.fragment,e),v(vl.$$.fragment,e),v(yl.$$.fragment,e),v(Ml.$$.fragment,e),v(_l.$$.fragment,e),v(El.$$.fragment,e),v(Tl.$$.fragment,e),v(Ul.$$.fragment,e),v(kl.$$.fragment,e),v(Il.$$.fragment,e),v(jl.$$.fragment,e),v(Al.$$.fragment,e),v(Gl.$$.fragment,e),v(Rl.$$.fragment,e),ks=!1},d(e){t(A),e&&t(ar),e&&t(S),y(Fe),e&&t(nr),y(Oe,e),e&&t(rr),e&&t(zl),e&&t(ir),e&&t(Qe),e&&t(sr),e&&t($),e&&t(hr),e&&t(le),e&&t(ur),e&&t(tt),e&&t(fr),e&&t(ot),e&&t(pr),e&&t(Vl),e&&t(cr),e&&t(oe),e&&t(mr),e&&t(ae),e&&t(gr),e&&t(x),y(nt),e&&t(dr),e&&t(rt),e&&t(vr),e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t(Ei),e&&t(co),e&&t(Ti),e&&t(mo),e&&t($i),e&&t(ol),e&&t(Ji),e&&t(Ie),e&&t(Ui),y(al,e),e&&t(ki),e&&t(nl),e&&t(Ii),e&&t(je),e&&t(ji),e&&t(go),e&&t(Ai),e&&t(E),e&&t(Si),e&&t(il),e&&t(xi),e&&t(bo),e&&t(Gi),e&&t(Mo),e&&t(Zi),y(sl,e),e&&t(Ni),e&&t(_o),e&&t(Wi),y(hl,e),e&&t(Ci),e&&t(ul),e&&t(Pi),e&&t(fl),e&&t(Li),e&&t(Y),y(pl),e&&t(Ri),e&&t(Eo),e&&t(Hi),e&&t(j),e&&t(zi),e&&t(ml),e&&t(Vi),e&&t(Se),e&&t(Bi),e&&t(xe),e&&t(Yi),e&&t(dl),e&&t(Xi),e&&t(Jo),e&&t(Fi),e&&t(Uo),e&&t(Oi),e&&t(X),y(vl),e&&t(Qi),e&&t(F),y(yl),e&&t(Di),e&&t(T),e&&t(qi),y(Ml,e),e&&t(Ki),e&&t(Io),e&&t(es),y(_l,e),e&&t(ts),e&&t(jo),e&&t(ls),y(El,e),e&&t(os),e&&t(O),y(Tl),e&&t(as),e&&t(Ao),e&&t(ns),e&&t(So),e&&t(rs),e&&t($l),e&&t(is),e&&t(We),e&&t(ss),e&&t(Go),e&&t(hs),e&&t(Q),y(Ul),e&&t(us),e&&t(Zo),e&&t(fs),y(kl,e),e&&t(ps),e&&t(D),y(Il),e&&t(cs),e&&t(No),e&&t(ms),y(jl,e),e&&t(gs),e&&t(q),y(Al),e&&t(ds),e&&t(Sl),e&&t(vs),e&&t(K),y(Gl),e&&t(ys),e&&t(Co),e&&t(ws),e&&t(Po),e&&t(bs),e&&t(Zl),e&&t(Ms),e&&t(Wl),e&&t(_s),e&&t(Ro),e&&t(Es),e&&t(He),e&&t(Ts),e&&t(Ho),e&&t($s),e&&t(zo),e&&t(Js),e&&t(Vo),e&&t(Us),e&&t(ee),y(Rl)}}}const Dy={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 qy(Fm){return Fy(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ow extends zy{constructor(A){super();Vy(this,A,qy,Qy,By,{})}}export{ow as default,Dy as metadata};
