Skip to content

Commit

Permalink
Removing DQN (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidnarayanan authored Sep 5, 2024
1 parent d544617 commit d25ec6d
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 1,212 deletions.
3 changes: 0 additions & 3 deletions ldp/agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class DefaultLLMModelNames(StrEnum):

from .agent import Agent, AgentConfig
from .agent_client import HTTPAgentClient, make_simple_agent_server
from .dqn_agent import DQNAgent, MultipleCompletionLLMCallOp
from .memory_agent import MemoryAgent
from .react_agent import ReActAgent
from .simple_agent import SimpleAgent, SimpleAgentState
Expand All @@ -20,11 +19,9 @@ class DefaultLLMModelNames(StrEnum):
__all__ = [
"Agent",
"AgentConfig",
"DQNAgent",
"DefaultLLMModelNames",
"HTTPAgentClient",
"MemoryAgent",
"MultipleCompletionLLMCallOp",
"ReActAgent",
"SimpleAgent",
"SimpleAgentState",
Expand Down
154 changes: 0 additions & 154 deletions ldp/agent/dqn_agent.py

This file was deleted.

14 changes: 1 addition & 13 deletions ldp/alg/optimizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

from pydantic import BaseModel, ConfigDict, Field

from ldp.agent import Agent, DQNAgent, MemoryAgent, ReActAgent
from ldp.agent import Agent, MemoryAgent, ReActAgent
from ldp.alg.optimizer.ape import APEOpt, APEScoreFn
from ldp.alg.optimizer.dqn import DQNOptimizer, DQNOptimizerConfig
from ldp.alg.optimizer.memory import MemoryOpt, PositiveMemoryOpt
from ldp.alg.optimizer.opt import _OPTIMIZER_REGISTRY, ChainedOptimizer, Optimizer

Expand All @@ -22,7 +21,6 @@ class OptimizerConfig(BaseModel):

_DEFAULT_OPTIMIZER_MAP: dict[type[Agent], type[Optimizer]] = {
MemoryAgent: MemoryOpt,
DQNAgent: DQNOptimizer,
ReActAgent: APEOpt,
}

Expand Down Expand Up @@ -63,14 +61,6 @@ def default_optimizer_factory(
)
)
return MemoryOpt.from_agent(agent, **optimizer_kwargs)
if isinstance(agent, DQNAgent):
if optimizer_cls != DQNOptimizer:
raise NotImplementedError(
_DEFAULT_OPTIMIZER_ERROR_MSG.format(
opt_type=optimizer_cls.__name__, agent_type=DQNAgent.__name__
)
)
return DQNOptimizer.from_agent(agent, **optimizer_kwargs)
if isinstance(agent, ReActAgent):
if optimizer_cls != APEOpt:
raise NotImplementedError(
Expand All @@ -86,8 +76,6 @@ def default_optimizer_factory(
"APEOpt",
"APEScoreFn",
"ChainedOptimizer",
"DQNOptimizer",
"DQNOptimizerConfig",
"MemoryOpt",
"Optimizer",
"OptimizerConfig",
Expand Down
Loading

0 comments on commit d25ec6d

Please sign in to comment.