import{s as M,n as q,o as A}from"../chunks/scheduler.37c15a92.js";import{S as B,i as U,g as h,s as m,r as L,A as j,h as d,f as a,c,j as P,u as R,x as k,k as E,y as D,a as n,v as z,d as C,t as S,w as H}from"../chunks/index.7cb9c9b8.js";import{H as F,E as G}from"../chunks/index.e79b7fff.js";function O(_){let o,g,p,f,i,w,s,$="That was a lot of information! Let’s summarize:",y,r,T="<li><p>Reinforcement Learning is a computational approach of learning from actions. We build an agent that learns from the environment <strong>by interacting with it through trial and error</strong> and receiving rewards (negative or positive) as feedback.</p></li> <li><p>The goal of any RL agent is to maximize its expected cumulative reward (also called expected return) because RL is based on the <strong>reward hypothesis</strong>, which is that <strong>all goals can be described as the maximization of the expected cumulative reward.</strong></p></li> <li><p>The RL process is a loop that outputs a sequence of <strong>state, action, reward and next state.</strong></p></li> <li><p>To calculate the expected cumulative reward (expected return), we discount the rewards: the rewards that come sooner (at the beginning of the game) <strong>are more probable to happen since they are more predictable than the long term future reward.</strong></p></li> <li><p>To solve an RL problem, you want to <strong>find an optimal policy</strong>. The policy is the “brain” of your agent, which will tell us <strong>what action to take given a state.</strong> The optimal policy is the one which <strong>gives you the actions that maximize the expected return.</strong></p></li> <li><p>There are two ways to find your optimal policy:</p> <ol><li>By training your policy directly: <strong>policy-based methods.</strong></li> <li>By training a value function that tells us the expected return the agent will get at each state and use this function to define our policy: <strong>value-based methods.</strong></li></ol></li> <li><p>Finally, we speak about Deep RL because we introduce <strong>deep neural networks to estimate the action to take (policy-based) or to estimate the value of a state (value-based)</strong> hence the name “deep”.</p></li>",b,l,v,u,x;return i=new F({props:{title:"Summary",local:"summary",headingTag:"h1"}}),l=new G({props:{source:"https://github.com/huggingface/deep-rl-class/blob/main/units/en/unit1/summary.mdx"}}),{c(){o=h("meta"),g=m(),p=h("p"),f=m(),L(i.$$.fragment),w=m(),s=h("p"),s.textContent=$,y=m(),r=h("ul"),r.innerHTML=T,b=m(),L(l.$$.fragment),v=m(),u=h("p"),this.h()},l(e){const t=j("svelte-u9bgzb",document.head);o=d(t,"META",{name:!0,content:!0}),t.forEach(a),g=c(e),p=d(e,"P",{}),P(p).forEach(a),f=c(e),R(i.$$.fragment,e),w=c(e),s=d(e,"P",{"data-svelte-h":!0}),k(s)!=="svelte-u7ov70"&&(s.textContent=$),y=c(e),r=d(e,"UL",{"data-svelte-h":!0}),k(r)!=="svelte-pq29ug"&&(r.innerHTML=T),b=c(e),R(l.$$.fragment,e),v=c(e),u=d(e,"P",{}),P(u).forEach(a),this.h()},h(){E(o,"name","hf:doc:metadata"),E(o,"content",W)},m(e,t){D(document.head,o),n(e,g,t),n(e,p,t),n(e,f,t),z(i,e,t),n(e,w,t),n(e,s,t),n(e,y,t),n(e,r,t),n(e,b,t),z(l,e,t),n(e,v,t),n(e,u,t),x=!0},p:q,i(e){x||(C(i.$$.fragment,e),C(l.$$.fragment,e),x=!0)},o(e){S(i.$$.fragment,e),S(l.$$.fragment,e),x=!1},d(e){e&&(a(g),a(p),a(f),a(w),a(s),a(y),a(r),a(b),a(v),a(u)),a(o),H(i,e),H(l,e)}}}const W='{"title":"Summary","local":"summary","sections":[],"depth":1}';function I(_){return A(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Q extends B{constructor(o){super(),U(this,o,I,O,M,{})}}export{Q as component};
