# 2.12 Machine learning lecture 12 course notes  (Page 8/8)

 Page 8 / 8

In detail, the algorithm is as follows:

1. Randomly sample $m$ states ${s}^{\left(1\right)},{s}^{\left(2\right)},...{s}^{\left(m\right)}\in S$ .
2. Initialize $\theta :=0$ .
3. Repeat $\left\{$
1. For $i=1,...,m$ $\left\{$
1. For each action $a\in A$ $\left\{$
1. Sample ${s}_{1}^{\text{'}},...,{s}_{k}^{\text{'}}\sim {P}_{{s}^{\left(i\right)}a}$ (using a model of the MDP).
2. Set $q\left(a\right)=\frac{1}{k}{\sum }_{j=1}^{k}R\left({s}^{\left(i\right)}\right)+\gamma V\left({s}_{j}^{\text{'}}\right)$
3. $\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}//$ Hence, $q\left(a\right)$ is an estimate of $R\left({s}^{\left(i\right)}\right)+\gamma {\mathrm{E}}_{{s}^{\text{'}}\sim {P}_{{s}^{\left(i\right)}a}}\left[V\left({s}^{\text{'}}\right)\right]$ .
2. $\right\}$
3. Set ${y}^{\left(i\right)}={max}_{a}q\left(a\right)$ .
4. $\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}//$ Hence, ${y}^{\left(i\right)}$ is an estimate of $R\left({s}^{\left(i\right)}\right)+\gamma {max}_{a}{\mathrm{E}}_{{s}^{\text{'}}\sim {P}_{{s}^{\left(i\right)}a}}\left[V\left({s}^{\text{'}}\right)\right]$ .
2. $\right\}$
3. $//$ In the original value iteration algorithm (over discrete states)
4. $//$ we updated the value function according to $V\left({s}^{\left(i\right)}\right):={y}^{\left(i\right)}$ .
5. $//$ In this algorithm, we want $V\left({s}^{\left(i\right)}\right)\approx {y}^{\left(i\right)}$ , which we'll achieve
6. $//$ using supervised learning (linear regression).
7. Set $\theta :=arg{min}_{\theta }\frac{1}{2}{\sum }_{i=1}^{m}{\left({\theta }^{T},\phi ,\left({s}^{\left(i\right)}\right),-,{y}^{\left(i\right)}\right)}^{2}$
4. $\right\}$

Above, we had written out fitted value iteration using linear regression as the algorithm to try to make $V\left({s}^{\left(i\right)}\right)$ close to ${y}^{\left(i\right)}$ . That step of the algorithm is completely analogous to a standard supervised learning (regression) problem in which we have a training set $\left({x}^{\left(1\right)},{y}^{\left(1\right)}\right),\left({x}^{\left(2\right)},{y}^{\left(2\right)}\right),...,\left({x}^{\left(m\right)},{y}^{\left(m\right)}\right)$ , and want to learn a function mapping from $x$ to $y$ ; the only difference is that here $s$ plays the role of $x$ . Eventhough our description above used linear regression, clearly other regression algorithms (such as locally weighted linear regression) can also be used.

Unlike value iteration over a discrete set of states, fitted value iteration cannot be proved to always to converge. However, in practice, it often does converge (or approximately converge), and works well for many problems.Note also that if we are using a deterministic simulator/model of the MDP, then fitted value iteration can be simplified by setting $k=1$ in the algorithm. This is because the expectation in Equation  [link] becomes an expectation over a deterministic distribution, and so a single example is sufficient to exactly compute that expectation.Otherwise, in the algorithm above, we had to draw $k$ samples, and average to try to approximate that expectation (see the definition of $q\left(a\right)$ , in the algorithm pseudo-code).

Finally, fitted value iteration outputs $V$ , which is an approximation to ${V}^{*}$ . This implicitly defines our policy. Specifically,when our system is in some state $s$ , and we need to choose an action, we would like to choose the action

$arg\underset{a}{max}{\mathrm{E}}_{{s}^{\text{'}}\sim {P}_{sa}}\left[V\left({s}^{\text{'}}\right)\right]$

The process for computing/approximating this is similar to the inner-loop of fitted value iteration, where for each action, we sample ${s}_{1}^{\text{'}},...,{s}_{k}^{\text{'}}\sim {P}_{sa}$ to approximate the expectation. (And again, if the simulator is deterministic, we can set $k=1$ .)

In practice, there're often other ways to approximate this step as well. For example, one very common case is if thesimulator is of the form ${s}_{t+1}=f\left({s}_{t},{a}_{t}\right)+{ϵ}_{t}$ , where $f$ is some determinstic function of the states (such as $f\left({s}_{t},{a}_{t}\right)=A{s}_{t}+B{a}_{t}$ ), and $ϵ$ is zero-mean Gaussian noise. In this case, we can pick the action given by

$arg\underset{a}{max}V\left(f\left(s,a\right)\right).$

In other words, here we are just setting ${ϵ}_{t}=0$ (i.e., ignoring the noise in the simulator), and setting $k=1$ . Equivalently, this can be derived from Equation  [link] using the approximation

$\begin{array}{ccc}\hfill {\mathrm{E}}_{{s}^{\text{'}}}\left[V\left({s}^{\text{'}}\right)\right]& \approx & V\left({\mathrm{E}}_{{s}^{\text{'}}}\left[{s}^{\text{'}}\right]\right)\hfill \\ & =& V\left(f\left(s,a\right)\right),\hfill \end{array}$

where here the expection is over the random ${s}^{\text{'}}\sim {P}_{sa}$ . So long as the noise terms ${ϵ}_{t}$ are small, this will usually be a reasonable approximation.

However, for problems that don't lend themselves to such approximations, having to sample $k|A|$ states using the model, in order to approximate the expectation above, can be computationally expensive.

Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
it is a goid question and i want to know the answer as well
Maciej
Abigail
for teaching engĺish at school how nano technology help us
Anassong
Do somebody tell me a best nano engineering book for beginners?
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
what is fullerene does it is used to make bukky balls
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
so some one know about replacing silicon atom with phosphorous in semiconductors device?
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
for screen printed electrodes ?
SUYASH
What is lattice structure?
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
Got questions? Join the online conversation and get instant answers!