import{s as se,f as V,n as le,o as oe}from"../chunks/scheduler.37c15a92.js";import{S as re,i as ue,g as l,s as a,r as X,A as me,h as o,f as n,c as s,j as Z,u as ee,x as m,k as y,y as ce,a as i,v as te,d as ne,t as ie,w as ae}from"../chunks/index.7cb9c9b8.js";import{H as pe,E as fe}from"../chunks/EditOnGithub.858acfec.js";function ge(Q){let r,T,$,C,c,L,p,U,P,f,D="In the last unit, we learned about Deep Q-Learning. In this value-based deep reinforcement learning algorithm, we <strong>used a deep neural network to approximate the different Q-values for each possible action at a state.</strong>",H,g,F="Since the beginning of the course, we have only studied value-based methods, <strong>where we estimate a value function as an intermediate step towards finding an optimal policy.</strong>",E,d,O,I,h,W="In value-based methods, the policy <strong>(π) only exists because of the action value estimates since the policy is just a function</strong> (for instance, greedy-policy) that will select the action with the highest value given a state.",k,v,Y="With policy-based methods, we want to optimize the policy directly <strong>without having an intermediate step of learning a value function.</strong>",j,_,B=`So today, <strong>we’ll learn about policy-based methods and study a subset of these methods called policy gradient</strong>. Then we’ll implement our first policy gradient algorithm called Monte Carlo <strong>Reinforce</strong> from scratch using PyTorch.
Then, we’ll test its robustness using the CartPole-v1 and PixelCopter environments.`,S,b,J="You’ll then be able to iterate and improve this implementation for more advanced environments.",q,u,K='<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit6/envs.gif" alt="Environments"/>',G,x,N="Let’s get started!",z,w,R,M,A;return c=new pe({props:{title:"Introduction",local:"introduction",headingTag:"h1"}}),w=new fe({props:{source:"https://github.com/huggingface/deep-rl-class/blob/main/units/en/unit4/introduction.mdx"}}),{c(){r=l("meta"),T=a(),$=l("p"),C=a(),X(c.$$.fragment),L=a(),p=l("img"),P=a(),f=l("p"),f.innerHTML=D,H=a(),g=l("p"),g.innerHTML=F,E=a(),d=l("img"),I=a(),h=l("p"),h.innerHTML=W,k=a(),v=l("p"),v.innerHTML=Y,j=a(),_=l("p"),_.innerHTML=B,S=a(),b=l("p"),b.textContent=J,q=a(),u=l("figure"),u.innerHTML=K,G=a(),x=l("p"),x.textContent=N,z=a(),X(w.$$.fragment),R=a(),M=l("p"),this.h()},l(e){const t=me("svelte-u9bgzb",document.head);r=o(t,"META",{name:!0,content:!0}),t.forEach(n),T=s(e),$=o(e,"P",{}),Z($).forEach(n),C=s(e),ee(c.$$.fragment,e),L=s(e),p=o(e,"IMG",{src:!0,alt:!0}),P=s(e),f=o(e,"P",{"data-svelte-h":!0}),m(f)!=="svelte-j9zk2f"&&(f.innerHTML=D),H=s(e),g=o(e,"P",{"data-svelte-h":!0}),m(g)!=="svelte-2xpx7a"&&(g.innerHTML=F),E=s(e),d=o(e,"IMG",{src:!0,alt:!0}),I=s(e),h=o(e,"P",{"data-svelte-h":!0}),m(h)!=="svelte-10c158u"&&(h.innerHTML=W),k=s(e),v=o(e,"P",{"data-svelte-h":!0}),m(v)!=="svelte-1btggbm"&&(v.innerHTML=Y),j=s(e),_=o(e,"P",{"data-svelte-h":!0}),m(_)!=="svelte-4of5it"&&(_.innerHTML=B),S=s(e),b=o(e,"P",{"data-svelte-h":!0}),m(b)!=="svelte-liqaak"&&(b.textContent=J),q=s(e),u=o(e,"FIGURE",{class:!0,"data-svelte-h":!0}),m(u)!=="svelte-1dadvfq"&&(u.innerHTML=K),G=s(e),x=o(e,"P",{"data-svelte-h":!0}),m(x)!=="svelte-4b3xjd"&&(x.textContent=N),z=s(e),ee(w.$$.fragment,e),R=s(e),M=o(e,"P",{}),Z(M).forEach(n),this.h()},h(){y(r,"name","hf:doc:metadata"),y(r,"content",de),V(p.src,U="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit6/thumbnail.png")||y(p,"src",U),y(p,"alt","thumbnail"),V(d.src,O="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit3/link-value-policy.jpg")||y(d,"src",O),y(d,"alt","Link value policy"),y(u,"class","image table text-center m-0 w-full")},m(e,t){ce(document.head,r),i(e,T,t),i(e,$,t),i(e,C,t),te(c,e,t),i(e,L,t),i(e,p,t),i(e,P,t),i(e,f,t),i(e,H,t),i(e,g,t),i(e,E,t),i(e,d,t),i(e,I,t),i(e,h,t),i(e,k,t),i(e,v,t),i(e,j,t),i(e,_,t),i(e,S,t),i(e,b,t),i(e,q,t),i(e,u,t),i(e,G,t),i(e,x,t),i(e,z,t),te(w,e,t),i(e,R,t),i(e,M,t),A=!0},p:le,i(e){A||(ne(c.$$.fragment,e),ne(w.$$.fragment,e),A=!0)},o(e){ie(c.$$.fragment,e),ie(w.$$.fragment,e),A=!1},d(e){e&&(n(T),n($),n(C),n(L),n(p),n(P),n(f),n(H),n(g),n(E),n(d),n(I),n(h),n(k),n(v),n(j),n(_),n(S),n(b),n(q),n(u),n(G),n(x),n(z),n(R),n(M)),n(r),ae(c,e),ae(w,e)}}}const de='{"title":"Introduction","local":"introduction","sections":[],"depth":1}';function he(Q){return oe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xe extends re{constructor(r){super(),ue(this,r,he,ge,se,{})}}export{xe as component};
