artificial intelligence ai l2-tac tu

Download Artificial intelligence ai l2-tac tu

Post on 22-Jan-2017

4 views

Category:

Education

0 download

Embed Size (px)

TRANSCRIPT

  • Tr Tu Nhn To (Artificial Intelligence)

    Vin Cng ngh thng tin v Truyn thng Trng i hc Bch Khoa H Ni

    Nm 2016

    Thn Quang Khot

    khoattq@soict.hust.edu.vn

  • Ni dung mn hc: n Gii thiu v Tr tu nhn to

    n Tc t q nh ngha q Mi trng cng vic q Cc kiu mi trng q Cc kiu tc t

    n Gii quyt vn : Tm kim, Tha mn rng buc

    n Logic v suy din

    n Biu din tri thc

    n Biu din tri thc khng chc chn

    n Hc my

    Tr tu nhn to 2

  • Tc t - nh ngha n Tc t l bt c ci g (con ngi, ngi my, software

    robots, cc b n nhit,) c kh nng cm nhn (nhn bit) mi trng xung quanh n thng qua cc b phn cm bin (sensors) v hnh ng ph hp theo mi trng thng qua cc b phn hot ng (actuators)

    n Tc t con ngi q Cc b phn cm bin: mt, tai, v mt s b phn c th khc q Cc b phn hot ng: tay, chn, ming, v mt s b phn c

    th khc n Tc t ngi my

    q Cc b phn cm bin: cc my quay (cameras), cc b truy tm tn hiu hng ngoi

    q Cc b phn hot ng: cc loi ng c (motors)

    3 Tr tu nhn to

  • Tc t v Mi trng

    n Hm tc t: l hm nh x t lch s nhn thc ti cc hnh ng:

    f: P* A n Chng trnh tc t: hot ng (chy) da trn kin trc

    thc t ca hm f

    n Tc t = Kin trc + Chng trnh 4 Tr tu nhn to

  • V d: Th gii ca my ht bi

    n Cc nhn thc q V tr v mc sch s q V d: [A, Bn], [B, Bn]

    n Cc hnh ng q Di chuyn (my ht bi) sang tri, sang phi, ht bi, hoc khng

    lm g

    5 Tr tu nhn to

  • Tc t my ht bi Bng hnh ng ca tc t my ht bi

    Chui cc nhn thc Hnh ng [A, Sch] Di chuyn sang phi [A, Bn] Ht bi [B, Sch] Di chuyn sang tri [B, Bn] Ht bi [A, Sch], [A, Sch] Di chuyn sang phi [A, Sch], [A, Bn] Ht bi . . .

    function Reflex-Vacuum-Agent( [location, status]) returns an action if status = Dirty then return Suck else if location = A then return Right else if location = B then return Left

    6 Tr tu nhn to

  • Tc t hp l (1) n Tc t cn phn u lm ng vic cn lm, da

    trn nhng g n nhn thc (nhn bit) c v da trn cc hnh ng m n c th thc hin

    n Mt hnh ng ng (hp l) l hnh ng gip cho tc t t c thnh cng cao nht i vi mc tiu t ra

    n nh gi hiu qu hot ng: l tiu chun nh gi mc thnh cng trong hot ng ca mt tc t q V d: Tiu ch nh gi hiu qu hot ng ca mt tc t my

    ht bi c th l: mc lm sch, thi gian ht bi, mc in nng tiu tn, mc ting n gy ra,

    7 Tr tu nhn to

  • Tc t hp l (2)

    n Tc t hp l q Vi mi chui nhn thc c c,

    q Mt tc t hp l cn phi la chn mt hnh ng gip cc i ha tiu ch nh gi hiu qu hot ng ca tc t ,

    q Da trn cc thng tin c cung cp bi chui nhn thc v cc tri thc c s hu bi tc t

    8 Tr tu nhn to

  • Tc t hp l (3) n S hp l S thng sut mi th

    q S thng sut mi th = Bit tt c mi th, vi tri thc v hn q V cc nhn thc c th khng cung cp tt c cc thng tin lin

    quan

    n Cc tc t c th thc hin cc hnh ng nhm thay i cc nhn thc trong tng lai, vi mc ch thu c cc thng tin hu ch (v d: thu thp thng tin, khm ph tri thc)

    n Tc t t tr (autonomous agent) l mt tc t m cc hnh ng ca n c quyt nh bi chnh kinh nghim ca tc t (cng vi kh nng hc v thch nghi)

    9 Tr tu nhn to

  • Mi trng cng vic PEAS (1)

    n PEAS q Performance measure: Tiu ch nh gi hiu qu hot ng

    q Environment: Mi trng xung quanh

    q Actuators: Cc b phn hnh ng q Sensors: Cc b phn cm bin

    n thit k mt tc t thng minh (hp l), trc tin cn phi xc nh (thit lp) cc gi tr ca cc thnh phn ca PEAS

    10 Tr tu nhn to

  • Mi trng cng vic PEAS (2)

    n V d: Thit k mt tc t li xe taxi t ng q nh gi hiu qu hot ng (P): an ton, nhanh, ng lut

    giao thng, mc hi lng ca khch hng, ti u li nhun,

    q Mi trng xung quanh (E): cc con ng (ph), cc phng tin khc cng tham gia giao thng, nhng ngi i b, cc khch hng,

    q Cc b phn hnh ng (A): bnh li, chn ga, phanh, n tn hiu, ci xe,

    q Cc b phn cm bin (S): my quay (cameras), ng h tc , GPS, ng h o khong cch qung ng, cc b cm bin ng c,

    11 Tr tu nhn to

  • Mi trng cng vic PEAS (3)

    n V d: Thit k mt tc t chun on y t q nh gi hiu qu hot ng (P): mc sc khe ca bnh

    nhn, cc tiu ha cc chi ph, cc vic kin co, q Mi trng xung quanh (E): bnh nhn, bnh vin, nhn vin y

    t, q Cc b phn hnh ng (A): hin th trn mn hnh cc cu hi,

    cc xt nghim, cc chun on, cc iu tr, cc ch dn, q Cc b phn cm bin (S): bn phm nhp vo cc thng tin

    v triu chng, cc tr li ca bnh nhn i vi cc cu hi,

    12 Tr tu nhn to

  • Mi trng cng vic PEAS (4)

    n V d: Thit k mt tc t nht vt

    q nh gi hiu qu hot ng (P): t l (bao nhiu phn trm) cc vt c t vo ng cc thng

    q Mi trng xung quanh (E): dy chuyn chuyn ng trn c cc vt, cc thng ng

    q Cc b phn hnh ng (A): cnh tay v bn tay c kt ni

    q Cc b phn cm bin (S): my quay (camera), cc b cm bin cc gc (cc hng)

    13 Tr tu nhn to

  • Mi trng cng vic PEAS (5)

    n V d: Thit k mt tc t dy ting Anh tng tc

    q nh gi hiu qu hot ng (P): cc i ha im thi ting Anh ca hc vin

    q Mi trng xung quanh (E): mt nhm hc vin

    q Cc b phn hnh ng (A): hin th mn hnh cc bi tp, cc gi , sa (cha) bi tp

    q Cc b phn cm bin (S): bn phm

    14 Tr tu nhn to

  • Mi trng cng vic PEAS (6)

    n V d: Thit k mt tc t lc th rc (spam emails filtering)

    q nh gi hiu qu hot ng (P): kh nng lc th rc (amount of error: false positives, false negatives)

    q Mi trng xung quanh (E): email server and clients

    q Cc b phn hnh ng (A): nh du th rc, gi thng bo

    q Cc b phn cm bin (S): nhn v phn tch ni dung cc emails

    15 Tr tu nhn to

  • Cc kiu mi trng (1) n C th quan st c hon ton (hay c th quan st c mt phn)? q Cc b cm bin ca mt tc t cho php n truy cp ti trng

    thi y ca mi trng ti mi thi im

    n Xc nh (hay ngu nhin)? q Trng thi tip theo ca mi trng c xc nh hon ton da

    trn trng thi hin ti v hnh ng ca tc t (ti trng thi hin ti ny)

    q Nu mt mi trng l xc nh, ngoi tr i vi cc hnh ng ca cc tc t khc, th gi l mi trng chin lc

    16 Tr tu nhn to

  • Cc kiu mi trng (2) n Phn on (hay lin tip)?

    q Lch s kinh nghim ca tc t c chia thnh cc giai on (chng/hi)

    q Mi giai on bao gm vic nhn thc ca tc t v hnh ng m n thc hin

    q mi giai on, vic la chn hnh ng thc hin ch ph thuc vo giai on (khng ph thuc vo cc giai on khc)

    n Tnh (hay ng)? q Mi trng khng thay i trong khi tc t cn nhc (xem nn a ra hnh ng no)

    q Mi trng bn ng (semi-dynamic) l mi trng m khi thi gian tri qua th n (mi trng) khng thay i, nhng hiu qu hot ng ca tc t th thay i n V d: Cc chng trnh tr chi c tnh gi

    17 Tr tu nhn to

  • Cc kiu mi trng (2) n Ri rc (hay lin tc)?

    q Tp cc nhn thc v cc hnh ng l hu hn, c nh ngha phn bit r rng

    n Tc t n l (hay a tc t)? q Mt tc t hot ng c lp (khng ph thuc / lin h vi cc

    tc t khc) trong mt mi trng

    18 Tr tu nhn to

  • Cc kiu mi trng V d Chi c Chi c khng Li xe taxi tnh gi tnh gi

    Quan st y ? c c khng Xc nh? chin lc chin lc khng Phn on? khng khng khng Tnh? bn ng c khng Ri rc? c c khng Tc t n? khng khng khng

    n Kiu ca mi trng c nh hng quyt nh i vi vic thit k tc t

    n Mi trng trong thc t thng c cc c im: ch c th quan st c mt phn, ngu nhin, lin tip, thay i (ng), lin tc, a tc t

    19 Tr tu nhn to

  • Cc kiu tc t

    n 4 kiu tc t c bn

    q Tc t phn x n gin (simple reflex agents)

    q Tc t phn x da trn m hnh (model-based reflex agents)

    q Tc t da trn mc tiu (goal-based agents)

    q Tc t da trn li ch (utility-based agents)

    20 Tr tu nhn to

  • Tc t phn x n gin (1) Tc t phn x n gin: Hnh ng theo mt quy tc (lut) c iu kin ph hp vi trng thi hin thi (ca mi trng)

    21 Tr tu nhn to

    function SIMPLE-REFLEX-AGENT(percept) static: rules (tp cc lut c dng: iu kin-hnh ng)

    state INTERPRET-INPUT(percept) rule RULE-MATCH(state, rules) action RULE-ACTION[rule] return action

  • Tc t phn x n gin (2)

    22 Tr tu nhn to

  • Tc t phn x da trn m hnh (1)

    Tc t phn x da trn m hnh: q S dng mt m hnh ni b gim st trng thi hin ti ca

    mi trng q La chn hnh ng: ging nh i vi tc t phn x n gin

    23 Tr tu nhn to

    function REFLEX-AGENT-WITH-STATE(percept) static: state (m t trng thi hin ti ca mi trng)

    rules (tp cc lut c dng: iu kin-hnh ng) action (hnh ng gn nht)

    state UPDATE-STATE(state, action, percept) rule RULE-MATCH(state, rules) action RULE-ACTION[rule] return action

  • Tc t phn x da trn m hnh (2)

    24 Tr tu nhn to

  • Tc t da trn mc tiu (1) n Bit v trng thi hin ti ca mi trng: cha

    Cn bit thm thng tin v mc tiu qTrng thi hin ti ca mi trng: mt ng t, xe taxi c th

    r tri, r phi, hoc i thng

    qThng tin v mc tiu: xe taxi cn i ti ch n ca hnh khch

    n Tc t da trn mc tiu qTheo di trng thi hin ti ca mi trng

    qLu gi mt tp cc mc tiu (cn t c)

    qChn hnh ng cho php (rt cuc) s t n cc mc tiu

    25 Tr tu nhn to

  • Tc t da trn mc tiu (2)

    26 Tr tu nhn to

  • Tc t da trn li ch (1) n Trong nhiu mi trng, thng tin v cc mc tiu khng nh gi hiu qu ca cc hnh ng qC rt nhiu chui cc hnh ng cho php taxi i n ch (tc

    l t n mc tiu)

    qNhng: chui hnh ng no nhanh hn, an ton hn, ng tin cy hn, chi ph thp hn?

    n Cn s nh gi li ch i vi tc t

    n Hm li ch (utility function) qnh x t chui cc trng thi ca mi trng ti mt gi tr s

    thc (th hin mc li ch i vi tc t)

    27 Tr tu nhn to

  • Tc t da trn li ch (2)

    28 Tr tu nhn to

  • Tc t c kh nng hc (1) n Kh nng hc cho php tc t ci thin hiu qu hot ng ca n

    n 4 thnh phn to nn mt tc t c kh nng hc q Thnh phn hnh ng: m nhim vic la chn cc hnh ng

    q Thnh phn nh gi (bnh lun): nh gi hiu qu hot ng

    q Thnh phn hc: gip ci thin hiu qu hot ng - da