AI/Artificial Intelligence

[인공지능 : AI, Artificial Intelligence]Chapter 2 : Intelligent Agent

LiDARian 2022. 4. 6. 20:24
반응형

Chapter 2

Inteligent Agent

  • Agent란 무엇인가?
    • 센서를 통해서 environment을 파악
    • 환경 위에서 actuator를 통해서 acting을 한다.

ImageImage

agent의 큰 그림

  • 아키텍쳐 = 동작하는 구조
  • 프로그램 = 중간에 있는 function

Image

예시

  • 오목을 둔다고 해보자.
    • 여기서는 오목판이 environment
    • 이걸 perceive하고 판단 및 행동 (percept한 것을 저장하는데, 이를 precepted sequence라고도 한다.)
    • environment가 변화
    • 이를 반복
  • 그런데 이를 어떻게 할 것인가?
    • AI를 이용한다
    • Agent = 자율적, 연속적 판단 및 행동
    • human, robot, softbot 등이 agent
    • motor, screen 등이 action이다.

예) 로봇 청소기

Image

하지만 이렇게 하면 행동이 계속 반복된다. 비효율 적이다.

그래서 Rational Agent를 도입한다.


  • Rational Agent란 무엇인가?
    • Rational Agent의 조건 (Rationality의 조건)
      • preformance measure needed
      • prior knowledge of the environment needed
      • actions that can perform
      • agent's percept sequence to date (정보 최신화)
    • performance measure의 평균을 최대화 하는 것이 목적이다. 어떤 percept sequence와 built in knowledge을 가지고 있더라도. 어떤 상황에서던, 성능을 극대화하도록 행동하는 Agent이다.
    • 이를 Standard model라고 부른다.
      • Search
      • Logical Inference = Reasoning
      • Learning
  • Rational Agent의 구조
    • percept -> f(x)(agent) -> acting
      • f(x)를 agent program이라고도 한다. 이 과정을 일종의 함수로 볼 수 있다는 의미도 된다.

ImageImage

예시) 자율 주행

Image

  • environment
    • 도로, 교통상황, 고객, 보행자, 타 차량
  • Sensor
    • 거리 측정기, 속도 측정기 등등
  • actuator
    • 빵빵이, 엑셀
  • Performance Measure 정의
    • 성능 후보군 : safe, fast, legal, comfortable trip, maximize profits
    • 많은 Agent가 성능 최대화를 fittness function을 성능으로 사용. 강화학습은 reward function, Neural Network는 Loss Funciton을 사용한다.

강의노트 살표보기

모든 미로를 푸는 프로그램을 만들고 싶다. 다음과 같은 구조로 만든다.

Image

로봇 청소기의 예시를 다시 보자.

Image

잘못 만든것. 안끝나니깐.


Rational Agent

  • Expected to maximize its performance measure(Utility라고도 한다.).
  • Rationality is relative to a perormace measure

rationality based on (노트)

  • criterion
  • prior knowledge of the environment
  • possible actions (가능한 모든 행동들 고려)
  • percept sequence (지금까지 한 행동, 인식을 기억하고 있는지)

Rational Agent의 4가지 구성을 PEAS라고 한다.


각종 예시들

ImageImageImage


agent의 4가지 타입

  • simple reflex agent
  • model based reflex agent
  • goal based agent
  • utility based agent

모두 다 learning agent(학습을 통해 performance를 향상하는 모형)로 일반화 가능하다.

simple reflex agent

Image

current percept를 기준으로 action을 선택한다.
그 전의 percept는 잊는다.
environment가 fully observable해야만 작업 가능하다.
직전의 로봇청소기와 같은 경우이다.
reflex = 생각없는 단순 반응(반사 반응)
condition action rule이라고도 한다.
무한 Loop에 빠질 수도 있다.

model based reflex agent

Image

모든 environment에 대해서 알 수는 없다. 즉 현재는 partial observation밖에 없다.
-> keep track of the part of the world agent cant see now
즉, 지나온 것에 대해서 계속해서 기억하거나,
전체 환경의 지도를 가지고 있거나,
즉, environment에 대한 model을 가지고 있는 것이다.

vacuum cleaner 예시를 돌아본다.

  • simple reflex였을 때에는
    • 무한 루프 : A->B, B->A
  • 반면 model based는
    • A, B 모두 clean하면 정지 : A, B까지만 있다는 것을 알기 때문

goal based agent

Image

앞선 것들은 Goal이 없었는데, 여기선 Goal이 있다.
현재를 알고 있는 것은 충분하지 않다.
그러므로 Goal에 대한 정보가 필요하다.
그에 따라서 의사결정을 할 것이다.
Search, Planning이 여기에 해당한다.
1과 0 딱 그 crude한 수치이다. 약간 이분법적인 on/off 방식의 판단

utility based agent

Image

Goal도 퍼포먼스 최대화에 충분치 않다.
그래서 Goal 대신에 Utility가 들어간다.
Utility = Goal에 가까운지 아닌지 판단.
utility function = performance measure
Search algorithm은 heuristic function을 선택하고,
유전알고리즘은 Fitness function,
NN에서는 Loss function을 사용한다.
Expected Utility를 최대/최소로하는 action을 선택한다.

이 모든 agent는 Performance를 잘못 설정하면 잘못된 action을 하게된다.

learning agent

Image

직전보다 행동을 개선하는 방식이다.
Learning machine을 만들어서 학습시키고 그 스스로 행동하게 만드는것이 목적이다.

요약

Image

번외 - Environment types

ImageImage

반응형