Model Pipeline - What is an AI agent
An AI agent is a computer program that senses its environment, thinks about what it senses, and acts to achieve a goal. It works like a smart helper that learns and makes decisions step-by-step.
Jump into concepts and practice - no test required
An AI agent is a computer program that senses its environment, thinks about what it senses, and acts to achieve a goal. It works like a smart helper that learns and makes decisions step-by-step.
Loss: 0.8 |**** Loss: 0.6 |****** Loss: 0.4 |******** Loss: 0.3 |********* Loss: 0.2 |**********
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.8 | 0.3 | Agent starts learning basic actions with low accuracy |
| 2 | 0.6 | 0.5 | Agent improves understanding and action choices |
| 3 | 0.4 | 0.7 | Agent learns to make better decisions |
| 4 | 0.3 | 0.8 | Agent actions become more accurate and goal-oriented |
| 5 | 0.2 | 0.9 | Agent reliably performs tasks with high accuracy |
class SimpleAgent:
def __init__(self):
self.state = 0
def perceive(self, input):
self.state += input
def decide(self):
return 'act' if self.state > 5 else 'wait'
def act(self):
return f'Action with state {self.state}'
agent = SimpleAgent()
agent.perceive(3)
agent.perceive(4)
decision = agent.decide()
action = agent.act()
print(decision, action)class BuggyAgent:
def __init__(self):
self.state = 0
def perceive(self, input):
self.state =+ input
def decide(self):
return 'act' if self.state > 5 else 'wait'