Files
8.-samopisnyy-poiskovyy-age…/README.md
T
kuzakhmetovartur 1039c7065c
CI / build (3.1) (push) Has been cancelled
CI / build (3.11) (push) Has been cancelled
CI / build (3.8) (push) Has been cancelled
CI / build (3.9) (push) Has been cancelled
feat: solution for '8. Самописный поисковый агент на основе deep agents from scratch'
2026-06-30 16:22:52 +03:00

907 B
Raw Blame History

DeepAgent

DeepAgent is a minimal example of a deep learning based search agent.
It demonstrates how to combine a neural network with a simple search algorithm (MonteCarlo Tree Search style) without relying on external search libraries.

Installation

# Create a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate   # On Windows use `.venv\\Scripts\\activate`

# Install the package
pip install .

Usage

from src.search_agent import SearchAgent, PolicyValueNet

# Create a policyvalue network
net = PolicyValueNet(input_dim=1, action_space=2)

# Create the agent
agent = SearchAgent(policy_value_net=net, max_depth=3)

# Run the agent on a simple state
state = 0
action = agent.act(state)
print(f"Chosen action: {action}")

Running Tests

pytest

License

MIT License see the LICENSE file for details.