19
1 ! " # ! " $! " ! %! & ! " ( ( ) ) * ( )" + ! " ! Robot Environment Robot action state

Learning robots.ppt [Read-Only] - arti.vub.ac.bearti.vub.ac.be/cursus/2003-2004/autosys/material/learning_robots.pdf · 3 ˇ0˚ 1 ˚ ˛ ˛ ˘ ˚ ’ ˛ ˝ ˙˛ ˛ ˚ ˙˛ ˛ " $ ˘

  • Upload
    doannhi

  • View
    223

  • Download
    0

Embed Size (px)

Citation preview

1

������������������ �����������

����������������������������������

����������������������������

������������������ �����������

������������������������������

� �������������������������������������������������������

�����������

� ����������������������������

� ������������������������!�������������������"

� #������������!�����������������������"

� $��!�����������������������������������������"

� ���������!���������������������������

� ������%�����!�������&'

� �����!��������������'

� ���������������������"

������������������ �����������

((������������������������������������������))

� ����������������������������������������������������*�

����(��������������)"

� +��������������������������������!�������"

������������������ �����������

���������������������������� ����������������������������

� ������!����������������

� �������������������������

Robot

EnvironmentRobot

action state

2

������������������ �����������

�����������!��������� �����������!���������

� ������������������"

� ,��������������������"

� -���!�����������������"

������������������ �����������

������������������������������������

� $������!������%�������(s, a) ���������������������������������������"

� ���������������������������������������������������������������"

Robot

EnvironmentRobot

action state Training data

������������������ �����������

,��������������������,��������������������

� �����������������������������x1, x2, … xn'

� #������������������������������������!�x �����������������!������������'������������&���'�������!�������'�.

Robot

EnvironmentRobot

action state

������������������ �����������

-���!�����������������-���!�����������������

� /���!������&��������������������������!����'��������!�����!�

��������������"

Robot

EnvironmentRobot

action state Reward

3

������������������ �����������

��������� ���������

� 0����������1������������

��������������������������������������� ���������������'�

������������������������������������������ �������������������"

$������*���������������������������������������������

� 2����������!��������

-���������������!����������������'���������������������������������������������������������������"

������������������ �����������

TerminologyTerminology

• Generalisation

What the robot learns is extended further than the training data.

• Over-specification

When learning the robot learns only the specific training samples and fails to generalise. This is the opposite of generalisation.

������������������ �����������

���������������3����������������������������3�������������

� ����!�������������������&�

� ���&�����������

� 0����������������������

� 4�����������������

� -���!�����������������

� 5���������

������������������ �����������

0��������!�����������������60��������!�����������������6

����!�����������������!�������������

������&�������&�

4

������������������ �����������

�##*�����������������������##*����������������������

� #�����������������������!�����������!�����������������������

�������"

� ���'�����������������������!�������"

� 0�����������������������������"

������������������ �����������

�##*��������������������##*�������������������

� �������������������������

x1

x2

xn

x0

w1

w2

wn

w0

��

� ��

� ���

� ��

� ���

� ��� �� ����� ��

��

� ��

� �� ��

� � �

� ���� ��� ����� � �

������������������ �����������

�##*�!����!�������������&��##*�!����!�������������&�i1 i2 i3 i4 i5

o1 o2 o3

input

hidden

output

�� ��

� ��� ��� �� ����� ��

�� ���� �

� � �� �� �� ��� �� �� �� ��� ��� ��� � �� �� �

������������������ �����������

�##*���������������##*��������������

� $������!�����������������������������������ti"

� +����������

� �����������������������������"

� ����������������������������������������������"

� �����!����������������������������������������������"

5

������������������ �����������

�##*����������!����!�������������&��##*����������!����!�������������&�

� ����������!�����������&*�������������������������&�

����������������������������

� ��

�������

� � � �

� � �

� � �

• The task:

try to find weights for the network that make the error minimal.

• The solution:

backpropagation algorithm

Training value d at output k

Output k for training input

d

������������������ �����������

�##*��##*����&��������������&�����������

� ������.

� �������!������������������

� ��������&������nin �����������'�nhidden �����������������noutput ������������"

� ����������������������������������������������"

� #�������.

� 7�����!���������������������8*�

� ������!�������������������8*�

� �������������*�

� ���

���

���

������������������ �����������

�##*��##*����&�������&����������������������

� +���������������������

6" $���������������!�������������������������&"

9" +��������������&������������'�������������������������*

:" +�������������������'�������������������������*

;" ,�������������������������������&*

� ���

� � �� � � � �� � � �� �

�������

� � � �

� � �� �

� �

���� �� � ��� � �� ��

������������������ �����������

�##*��##*����&�������&��������������������������������<<��

� ������������������������������������������������!��������

��������(������)"

� ��������������������!������=

� 7�����!�����������������������

� �������������������������

� ����������������������������������������������������������

Q: So, when it set the learning rate � to a high value, learning

will be super fast?”A: No… If the learning rate is too high, the network will overshoot

its goal.

6

������������������ �����������

�##*��##*����&�������&��������������������������������

� �������������������&�����

� �!������!�������������!�����������"

2����<����������������������!�������"

� �������������������������������������"

2�������!�����!������"

� ���������������������������������������������������������

���������"

������������������ �����������

�##*��������&�������!��##*��������&�������!����&�������&����

� ���&����������� ������������&����������������"

� #�������������!�����������������������������"

� ��������������������������������

� ����������'����.

� �����������!������*����������������>��������������&"

� 2������������

A solution which is not the best, but lies on an isolated peak

in the fitness landscape.

������������������ �����������

�##*��������������##*����������������&�������&������

� ����������������'�������������"

� 7�����!����������������"

� ���������������������������������������%������������"

� ���������!���������������������������"

� ?����������������"

� ����������������������&�������������������������������������"

� �������������������������������������"

� ��������������&���������������������������"

������������������ �����������

�����������*���@7##�����������*���@7##

� ����������������@������������#������

#�����&"

� ����

� 7����*�:A���:9�������������������"

� +��������������!����!�������������&"

� /�����*�:A�������������"

� �������������������������������������"

� $��!�������

� BB���1��!���CA������������!��������!�

�������������

7

������������������ �����������

0��������!�����������������90��������!�����������������9

4�����������������4�����������������

������������������ �����������

4�*����������������������4�*����������������������

� �����������������������������"

� 0���������������������!�����������������

���!��������������D�������������E"

� �����������������������������������"

� ��������!�(���������) ����������������������������������"�����������������

����������!�����"�+������������������������

��������������"

� ����������!���������������3�����"

������������������ �����������

4�*��������������4�*��������������

� ����������������������������������������������������������"

� �������!��������������������������������������������"

� ����������������������������������������'��������������������

!��������������"

� +�������������������&���������������������'������������������

����������������������!��������������"

� -��������������������������������������������������������"

������������������ �����������

4�*�����������4�*�����������

� ���������������������������������!������������!��������������"

� ������������������������������!������������"

���������������������������������������!��������'����������������������������������������!�A6A6AA66A6A6AA6���������������������������������������������!����������"

8

������������������ �����������

4�*�!�����������������������������4�*�!�����������������������������D���������!�7����������ED���������!�7����������E

6" 4��������9A����������3��������!�!��������������������

9" +����������������!�������������������������������������������������

:" �������������������!������������

;" $��&�����������������������!�������'����&���������������

B" $�������9A�������������!������'�����������������������!���3�������!�������������������!�������

F" -������!����D9E���"

•Fold TL to BR towards you

•Fold horiz middle away

•Fold vertical middle towards

������������������ �����������

4�*���������������������������4�*���������������������������

� �������������������������������������������"

� G������������������������������������"

� #������"

� 7!%����������"

� ����"

� $�������"

� ���"

� 4�������"

� .

���������������

������������������ �����������

4�*���������4�*���������

� H���������������!�������������������!������������"

���������������

����� ���������

������������������ �����������

4�*����������4�*����������

� �����������������������������'��������������������!������

������"

��������������� ����������������

��������� �����

9

������������������ �����������

4�*��������������4�*��������������

� ������.

� ��������������!�N �����������"

� ��!�������!��������fitness(p).

� ��!��������r �!������������������������������������������"

� ����������������m

������������������ �����������

4�*���������������4�*���������������

6" H�������!��������!����������������*�fitness(pi)

9" H�����������������������������$<

6" ������(1-r).p ����������������������$< �������������������������

9" H��������*��������(r.p)/2 ������!����$��������������prob'���&�������������������������������$<"

:" ?�������*��������m ���������!�$�!�����������"

� �

� ��

������� �����

������� ���

������������������ �����������

4�*�����������������������4�*�����������������������

� ���������������!����������������������������������������������

�����������!������'����������������������������������!��������!�������"

� ��������������!���������������������������������������������������������"

� 4�����!����������������������������������!�������������"

� �

� ��

������� �����

������� ���

������������������ �����������

4�*�����!�������!�������4�*�����!�������!�������

� ���!�������!�����������&���������������"

� @������������������!����������������������"

� ��!�������������������������������������������������*�����!������"

� 0��������������!��������!������������������&������'����������������������=

10

������������������ �����������

4�*���������������4�*���������������

� ����������������4��

� 7!�������������������!�����������������������������"

������������������������!����"

� 7!�����!��������!�������������������������������������������"

������������������ �����������

4�*��������������������4�*��������������������

� 4�������������������������������������!�������

� ����������������

0����������!������������������D��������E'�����4/�0?����8����D4����������/�����I�����!���&��0�������?��������E�

� ������������

������������������ �����������

4�*�!������������������4�*�!������������������

� 0���������������������������'���������������8���������

�����<�����������������������������������!�����"

� �������*������������ +����������������������������"

� ��������������������������"

� �����������������(����)"

� ������������������%�����������

������!���"

������������������ �����������

4�*�!������������������4�*�!������������������

� 0��������������������%�����"

� 7���������������"

� �����������������!��������D�!������������������!���E"

� ,������������������������!������!!������D������������������'��������

������������&E"

� 7�<����������������

11

������������������ �����������

�����������*���������������������!�����������������*���������������������!������

� -������� ������D9AAAE"

� 0�����������

� ����������������'�

� ����������'�

� �����!��%�����������1�����������������������������������������������"

� 0����������*�6:A�����9AA����������������������������������������"

� ��&*�����������"

� H�������������������*�������!���%!�����������!�������������������&"

� 0����������!��������������!�����������&"

� +�����������������*������������������"

������������������ �����������

�����������*����������������*�����<<��

������������������ �����������

0��������!�����������������:0��������!�����������������:

-���!���������-���!���������

����������������55%%����������������

������������������ �����������

�����������!������������������ �����������!������������������

• Only feedback on how well the robot performs, in the form of a scalar value.

Robot

EnvironmentRobot

action state Reward

12

������������������ �����������

�����'�������������������������'��������������������

� ����������������������������!�����������������D����������������������������������=E

,������������'��"�"�������<�'����������"

� ���������������!������������

0"�"�(!���������������)'�(����������)'�(�������������)"

� ������������������������������������������'�������������������

�������������"

-�����������������������'��"�"��������!������������������"

������������������ �����������

-�������������������-�������������������

� ����������������������������!�����������������������������������������������"

� 7������!��������������������������π �����������������'��������������������������������������������������"

� �� �

������������������ �����������

������&���-���������� ������&���-����������

� 2������������

-����������������������������������������'������������

������"�0"�"���������������������������������'����������������������������"

� 0����������1������������

���������������������������������������������������������������������������������������"� ���������������������������

����" ���������!!������!�������������������������������������������

������D�"�"����&����'�4�E"

������������������ �����������

������&���-���������� ������&���-����������

� $�������������������������

�����������������������������!�������������������

�������������������'����������������������������������������������������������!��������"

� ��!�%�������������

-�����������������&��������������������������������������&�'��������������������������������������"

� D �����������������������������������������������������������������������������E

13

������������������ �����������

?��&���2��������$������?��&���2��������$������

� ���<�����������������������

� ����!����������

� ����!�����������

� �� ��������������

� ��� ��������� �������

�����!�����������������&�����������������=

� ���������������������������������������������������'�����

����������������������������������'�����������?��&���2��������$������"

� �

� �

� ��

� � �

� � �

� � � �

� �

������������������ �����������

$����������������������$����������������������

� $����

. ������������������������������������������������"

� ���������������������������������������������������������������������"

� �� �

� � ��

���� � �� � ��

� � � � ��

� �

� �� � �

���

������ �

�� � �� � �

� � � � �� � � �

� �

Discounted cumulative award

������������������ �����������

/������������/������������

� H��������������� ����������������������������������������������π �������������!��������������

� ������������������������������������������������������������������������

� ���������!��������!����������������������������������

� ��

�� � �

� � �� �

� �

� �� ������ � ��

� �� �

� ��� �

������������������ �����������

����������������������������������������������������

� ���������!������������������������������������������������

�����������������=

7!�������������������������������������������������6�����9'����������������������������������&������!�����������"

� ������������������������ ��������������������������������������������������������������!�����"

� � � �� �� �� � � ��

� � � �

� � � �� �� �

������

������

� � �

� � � � � �

� �

� �

� �

14

������������������ �����������

H��������H��������

� ����������������������������.

� ���������&������������������������!����&����������������!�����������������������������������!������������'��������������������<��&���������=

� ��������������������������������!��������!�����������

��������.

����5�!�������"

� � � � � �� �� �� ������� � � � � � � ��

� � ��

?

������������������ �����������

5�!�������5�!�������

� ����������������������������������������������������������������������!����������� �����!���������������"

� 0���������%������������������� �����"

� ���������������������������������������������������������"

� ����������������������������������������������������� �����

� � � � � �� �� � � � � � � � � �� ��

� � � �� ������ �

� � � �� �

� � � �� ��� �

� � � � ��

������������������ �����������

���������5���������5

� ����������������'�����������������������!��"

� ������&�������!�����!����������!���������'���������� ���������

���������������

� 7�������������������������"

� ������������������������������'���������������������������������"

��

� � �� � �

������������������ �����������

������������������

6" /������������������������

9" 2��!������6" ����������������� ��������������"

9" -�������������������������"

:" /�����������������������

;" ,���������������������!���

B"

� � �� � �

� � � � � ��

��� � ��

� � � � � � ���

�� ��

15

������������������ �����������

0������0������

� -��������������!��������

� �������������������������

R G

Reward

100

������������������ �����������

0������0������

� 7���������������������������

% 1 = N, 2 = E, 3 = S, 4 = W

% [currentState action nextState reward]

sa = [1 2 2 0

1 3 4 0

2 2 3 100

2 3 5 0

2 4 1 0

3 1 3 0

3 2 3 0

3 3 3 0

3 4 3 0

4 1 1 0

4 2 5 0

5 1 2 0

5 2 6 0

5 4 4 0

6 2 5 0

6 1 3 100];

1 2 3

4 5 6

1

2

3

4

������������������ �����������

0������0������

� ���������������������5��������������� �

% state action Q-value

Q= [1.0000 3.0000 72.9000

4.0000 2.0000 81.0000

5.0000 2.0000 90.0000

6.0000 2.0000 81.0000

5.0000 1.0000 90.0000

2.0000 2.0000 100.0000

5.0000 4.0000 72.9000

6.0000 1.0000 100.0000

4.0000 1.0000 81.0000

1.0000 2.0000 90.0000

2.0000 3.0000 81.0000

2.0000 4.0000 81.0000

3.0000 2.0000 0

3.0000 1.0000 0

3.0000 4.0000 0

3.0000 3.0000 0]

R G

������������������ �����������

0������0������

� �����������������������������(��������)*����&�����������

������������������������������������"��!��������'��������������������!!������������������������������"

� ��������������������������������������!��������%I��������������������������������������"

� �!��������'������������������!��������������������������������!���������������������������"

� � �� � �

� � �� � �

16

������������������ �����������

0������0������

� 0�������������������������������*

���������������'�!������������������������������������������������"��

� ������������������!�������������� �������������������D������E�

����������"

� � �� � �

� � �� � �

������������������ �����������

$�����������!��������������$�����������!��������������

� �������������������������������������"

� ������������������������������������������� ���������������5�

������"

� ����������������������������3��������5������������

� ����������������������������?2$��������"

� ���������������������������������"

� �������������������������������%���������������!��������!���"

� #���������������������������'�����������5%������������&����������"���������������������������!�������!������3���������"

� � �� � �

� � �� � �

� � �� � �

������������������ �����������

���������������5������������������������5���������

� ����!������������������'�����!�������������������������"

�����������������'���������������������%����������������

����������5������"�?�������������������������"

� ��������������������!������������'��������������������������

���������!������������������������������������"

H�����������������������������������������������

� ��� �

�� �

� � �

� � � �

�� � �

���

Large values of k will let the agent exploit high Q-values

������������������ �����������

@�������������5���������@�������������5���������

� #��%��������������������������'���������������������*

� ���������������������������������������������������'

� ������������������������������"

� /!�������������������!��������������������������������

���������"

� ,�����������!������������

� � � � � � � � � � �� �� ��

� ��� � �

� �

� �� � ��

� � � � � � � � � �

������ � �

� �

� The adjustments to the Q

values are made more gradually

17

������������������ �����������

�������������������������������� ��������������������������������

����������������� 2��������������������������������������������������������"

� ?�&������������������"

7��������!�������������∈JA'6AAK'�������������∈ L����'�����'����'�!���M"

� ,�������!!����������������!�����������������������'

� #�����������������'��������������������������������������������

������"�0"�"����������������&"

� � �� � �

������������������ �����������

$���������������������$���������������������

θ

������������������ �����������

$�������������*������'������������������$�������������*������'������������������

� ������������

� ������������������ !���" !��#

� ���������!�������!�������������������������"�

θ

� �

� �

��

��� ��� ��� ��� � � � �� � � �

������������������ �����������

$�������������*�$�������������*�������������������������

� 2��������������������������DN�6AA����������������E

� 2��������������������������'�����������������������$ !���%�"& !��'"

� 7!�������������(������������������) �������������>�A"

� 7!�����������'���������������������"

18

������������������ �����������

$�������������$�������������

Schaal & Atkeson (USC)

������������������ �����������

���������������������*����������&�������������������������*����������&����

����������� ��������������������������������������������!������������&�

������"

� ���������������

������������������!�����������'��������������������������

���������"

� ��������������������������������������

� ������������*������������3���������������������������� ���������

�����������"�?�����������������������������������������������"

� � �����������*��!��������������������'����������������9"

� � ������������*��!���������������������<����������������������B������'����������������9"

������������������ �����������

���������&������������������&���������

� ���������������������������������!�����������������������

� ��������������������������'����������������"����<����&����

�������!�(��������)

#�G��#���������

���������

������!���B�

�������

,��������$����������&�������

,��������$������+�����������

�>>-�O-�N-2�!!�������

��������

:96$������

������������������ �����������

���������&������������������&���������

#�G��#��

����������

������������

!���B�

�������

,�������

$����������&�

������

,�������

$������+�����

������

�>>-�O-�N-2�!!�����

����������

:96$������

.

A'6'A'A;

9'A'A'A:

6'A'A'A9

A'A'A'A6

$�����������

We have 3x2x2x2 = 24 different states

19

������������������ �����������

���������&������������������&���������

� ���<����!�����������

-��'�!��C

+��'����P

-��'����Q

+��'�!��F

-��'�����B

+��'�����;

���'����:

���'�!��9

���'�����6

?��������!�'������������

������������������ �����������

���������&������������������&���������

� ����9;������������C��������'����������������5%������

�����������96F�5%������"

� -�����������������������

� ���������������������γ �����������������������������������������������������������������!��������������"

� ��������������������������������������������D�"�"�A"9E���������������������������"

� � � � � ��

��� ������� � � � � � ���

������������������ �����������

��������� ��������� ��������������

������������������ �����������

���������������3����������������������������3�������������

� ����!�������������������&�

� ���&�����������

� 0����������������������

� 4�����������������

� -���!�����������������

� 5���������

Is this supervised, unsupervised, or reinforcement

learning?