import{s as lt,a as X,n as st,o as rt}from"../chunks/scheduler.ef843396.js";import{S as ot,i as ut,e as s,s as a,c as Y,h as mt,a as r,d as n,b as l,f as Z,g as tt,j as m,k as x,l as gt,m as i,n as et,t as nt,o as it,p as at}from"../chunks/index.05ef1181.js";import{H as pt,E as ft}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.ef6649bf.js";function ct(j){let o,M,$,T,g,y,u,D,C,p,F="In the first unit of this class, we learned about Reinforcement Learning (RL), the RL process, and the different methods to solve an RL problem. We also <strong>trained our first agents and uploaded them to the Hugging Face Hub.</strong>",P,f,U="In this unit, we’re going to <strong>dive deeper into one of the Reinforcement Learning methods: value-based methods</strong> and study our first RL algorithm: <strong>Q-Learning.</strong>",R,c,O="We’ll also <strong>implement our first RL agent from scratch</strong>, a Q-Learning agent, and will train it in two environments:",k,d,W="<li>Frozen-Lake-v1 (non-slippery version): where our agent will need to <strong>go from the starting state (S) to the goal state (G)</strong> by walking only on frozen tiles (F) and avoiding holes (H).</li> <li>An autonomous taxi: where our agent will need <strong>to learn to navigate</strong> a city to <strong>transport its passengers from point A to point B.</strong></li>",E,h,B,q,v,J="Concretely, we will:",I,L,K="<li>Learn about <strong>value-based methods</strong>.</li> <li>Learn about the <strong>differences between Monte Carlo and Temporal Difference Learning</strong>.</li> <li>Study and implement <strong>our first RL algorithm</strong>: Q-Learning.</li>",Q,_,N="This unit is <strong>fundamental if you want to be able to work on Deep Q-Learning</strong>: the first Deep RL algorithm that played Atari games and beat the human level on some of them (breakout, space invaders, etc).",S,b,V="So let’s get started! 🚀",z,w,A,H,G;return g=new pt({props:{title:"Introduction to Q-Learning",local:"introduction-q-learning",headingTag:"h1"}}),w=new ft({props:{source:"https://github.com/huggingface/deep-rl-class/blob/main/units/en/unit2/introduction.mdx"}}),{c(){o=s("meta"),M=a(),$=s("p"),T=a(),Y(g.$$.fragment),y=a(),u=s("img"),C=a(),p=s("p"),p.innerHTML=F,P=a(),f=s("p"),f.innerHTML=U,R=a(),c=s("p"),c.innerHTML=O,k=a(),d=s("ol"),d.innerHTML=W,E=a(),h=s("img"),q=a(),v=s("p"),v.textContent=J,I=a(),L=s("ul"),L.innerHTML=K,Q=a(),_=s("p"),_.innerHTML=N,S=a(),b=s("p"),b.textContent=V,z=a(),Y(w.$$.fragment),A=a(),H=s("p"),this.h()},l(t){const e=mt("svelte-u9bgzb",document.head);o=r(e,"META",{name:!0,content:!0}),e.forEach(n),M=l(t),$=r(t,"P",{}),Z($).forEach(n),T=l(t),tt(g.$$.fragment,t),y=l(t),u=r(t,"IMG",{src:!0,alt:!0,width:!0}),C=l(t),p=r(t,"P",{"data-svelte-h":!0}),m(p)!=="svelte-1ynp68f"&&(p.innerHTML=F),P=l(t),f=r(t,"P",{"data-svelte-h":!0}),m(f)!=="svelte-1dfcpck"&&(f.innerHTML=U),R=l(t),c=r(t,"P",{"data-svelte-h":!0}),m(c)!=="svelte-1xt90qk"&&(c.innerHTML=O),k=l(t),d=r(t,"OL",{"data-svelte-h":!0}),m(d)!=="svelte-1avcekp"&&(d.innerHTML=W),E=l(t),h=r(t,"IMG",{src:!0,alt:!0}),q=l(t),v=r(t,"P",{"data-svelte-h":!0}),m(v)!=="svelte-innzr2"&&(v.textContent=J),I=l(t),L=r(t,"UL",{"data-svelte-h":!0}),m(L)!=="svelte-y97j7m"&&(L.innerHTML=K),Q=l(t),_=r(t,"P",{"data-svelte-h":!0}),m(_)!=="svelte-1c70rr4"&&(_.innerHTML=N),S=l(t),b=r(t,"P",{"data-svelte-h":!0}),m(b)!=="svelte-vkoquy"&&(b.textContent=V),z=l(t),tt(w.$$.fragment,t),A=l(t),H=r(t,"P",{}),Z(H).forEach(n),this.h()},h(){x(o,"name","hf:doc:metadata"),x(o,"content",dt),X(u.src,D="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit3/thumbnail.jpg")||x(u,"src",D),x(u,"alt","Unit 2 thumbnail"),x(u,"width","100%"),X(h.src,B="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit3/envs.gif")||x(h,"src",B),x(h,"alt","Environments")},m(t,e){gt(document.head,o),i(t,M,e),i(t,$,e),i(t,T,e),et(g,t,e),i(t,y,e),i(t,u,e),i(t,C,e),i(t,p,e),i(t,P,e),i(t,f,e),i(t,R,e),i(t,c,e),i(t,k,e),i(t,d,e),i(t,E,e),i(t,h,e),i(t,q,e),i(t,v,e),i(t,I,e),i(t,L,e),i(t,Q,e),i(t,_,e),i(t,S,e),i(t,b,e),i(t,z,e),et(w,t,e),i(t,A,e),i(t,H,e),G=!0},p:st,i(t){G||(nt(g.$$.fragment,t),nt(w.$$.fragment,t),G=!0)},o(t){it(g.$$.fragment,t),it(w.$$.fragment,t),G=!1},d(t){t&&(n(M),n($),n(T),n(y),n(u),n(C),n(p),n(P),n(f),n(R),n(c),n(k),n(d),n(E),n(h),n(q),n(v),n(I),n(L),n(Q),n(_),n(S),n(b),n(z),n(A),n(H)),n(o),at(g,t),at(w,t)}}}const dt='{"title":"Introduction to Q-Learning","local":"introduction-q-learning","sections":[],"depth":1}';function ht(j){return rt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bt extends ot{constructor(o){super(),ut(this,o,ht,ct,lt,{})}}export{bt as component};
